-
Notifications
You must be signed in to change notification settings - Fork 28
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
Get version without deprecation warnings #29
Conversation
obonet/__init__.py
Outdated
else: | ||
from pkg_resources import DistributionNotFound, get_distribution | ||
|
||
try: | ||
return str(get_distribution("obonet").version) | ||
except DistributionNotFound: | ||
return None |
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.
Thanks for the contribution!
What do you think about bumping to 3.8 at
Line 31 in fec6a82
requires-python = ">=3.7" |
Line 57 in fec6a82
target-version = "py37" |
obonet/.github/workflows/build.yaml
Line 16 in fec6a82
- "3.7" |
and then removing the from pkg_resources import DistributionNotFound, get_distribution
approach altogether?
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.
3.7 end of life as of June 27, 2023 and pip should know to install an older release of obonet if using python 3.7
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.
That's fine with me, I tend to always err on the side of broader compatibility unless there is a meaningful feature being blocked by it, but I think in this case, this would not be a big issue.
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.
Cool. I'm happy to make the changes after merging this or you can. Let me know which you prefer!
I tend to always err on the side of broader compatibility unless there is a meaningful feature being blocked by it, but I think in this case, this would not be a big issue.
Yes compatibility is good but also making this package as easy to maintain as possible is also good.
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 the changes, feel free to make further modifications if needed.
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.
Thanks! I'll drop a note here once there's a release.
Release |
The line
from pkg_resources import DistributionNotFound, get_distribution
produces deprecation warnings (see https://setuptools.pypa.io/en/latest/pkg_resources.html). This PR implements a variant for Python 3.8+ that avoids these deprecations.