Skip to content

Feature version variant hash#335

Merged
yujiahu415 merged 15 commits intoumyelab:masterfrom
ruck94301:feature-version-variant-hash
Jan 12, 2026
Merged

Feature version variant hash#335
yujiahu415 merged 15 commits intoumyelab:masterfrom
ruck94301:feature-version-variant-hash

Conversation

@ruck94301
Copy link
Contributor

This PR to calculate a "hash" or signature of the ~50 py-files in the LabGym package.

The main frame displays f'LabGym v{LabGym.version}', like 'LabGym v2.9.7', just like before.

The version-string reported via central logger to central logging receiver
is like '2.9.7 (aec48e5691dd35bdd08ebc8265122156)'

This behavior is consistent with preference stated by Henry on 1/8 in comments of #318, "LabGym version if running a customized LabGym"

@ruck94301
Copy link
Contributor Author

I'm a little puzzled right now. It's like this is now failing
# Confirm the assumption that under pytest, cwd is LabGym package's
# parent dir (the repo dir).
assert os.getcwd() == os.path.dirname(os.path.dirname(LabGym.file))

I'm not sure yet how this could be a new source of trouble...

@ruck94301
Copy link
Contributor Author

ruck94301 commented Jan 9, 2026

I’m done refining this PR now.
The CI exposed three things:

  1. An existing myargparse unit test needed to be updated for —version output.
  2. hash.py was doing an os.chdir() instead of a temporary chdir, so an assumption in test_load.py was no longer true. This led me to improve hash.py by employing a temporary chdir.
  3. The hashing of py-files used an open(file, ‘r’). But on Windows specifically, the default encoding was incompatible with some py-file content, so this needed to be changed to open(file, ‘r’, encoding=‘utf-8’)

These things are now corrected.

@yujiahu415 yujiahu415 merged commit 4e99764 into umyelab:master Jan 12, 2026
4 checks passed
@ruck94301 ruck94301 deleted the feature-version-variant-hash branch January 14, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants