Skip to content
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

Fix: Move from pkg_resources to packaging #271

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

mharista
Copy link
Contributor

No description provided.

Copy link

@rewati-arista rewati-arista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg, out of curiosity what is the reason to change from pkg_resources.parse_version to packaging.version.parse?

@mharista
Copy link
Contributor Author

@rewati-arista the reasoning is in the old PR #261

Here is a portion of the info:

https://docs.python.org/3/whatsnew/3.12.html

python/cpython#95299: Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environments

NOTE: it could have been possible to add setuptools to requirement to continue using pkg_resources but it gives a deprecation warning

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking so i've gone and approved anyway but could probably store parse(full_version) before the elif block instead of invoking it each stmt, or maybe map the versions to api versions in a data struct and iterate through that to make the comparison.

@mharista mharista merged commit d4117a5 into develop Apr 17, 2024
@mharista mharista deleted the move_to_packaging branch April 17, 2024 15:08
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.

3 participants