-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update versioneer #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @danejo3 @RyanBerger98 @agshumate @rnmitchell, we've had to pin some of our workflows to Python < 3.12 recently. In many cases, this was due to older versions of versioneer. Following this process may help with 3.12 compatibility.
versionfile_source = _version.py | ||
versionfile_build = _version.py | ||
versionfile_source = pytaxonkit_version.py | ||
versionfile_build = pytaxonkit_version.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change, made sure I had the latest version of versioneer
installed in my environment, then ran versioneer install
in the repo root directory. This updated versioneer.py
. I still had to make a few manual changes—delete _version.py
, update the import statement in pytaxonkit.py
, remove _version.py
from .gitattributes
, etc.
- os: ubuntu-latest | ||
python-version: "3.11" | ||
- os: ubuntu-latest | ||
python-version: "3.12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for Python 3.12 compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the purpose and contents of this file will be clear from its filename when it's in the Python environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PyTaxonKit uses versioneer to read version numbers from the git repo at deploy time. Typically, for Python packages, I configure versioneer to drop a
mypackage/_version.py
file in the package itself. When I originally configured versioneer for PyTaxonKit, I followed a similar strategy without thinking too much about it.But PyTaxonKit is not a package, it's a single module. So when it is installed into the environment, the
_version.py
file is placed alongside it outside of any package. This is what experts in the field call Not Great.I updated the PyTaxonKit config so that it would create a
pytaxonkit_version.py
file rather than just_version.py
. While I was at it, I also upgraded the vendored versioneer bundled in the repo, which appears to work fine with Python 3.12.