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
Version checking with importlib and versioneer config update #1048
Conversation
Test Results 2 files + 1 2 suites +1 1m 39s ⏱️ - 16m 57s Results for commit 9985db8. ± Comparison against base commit 92e96c5. This pull request removes 239 and adds 481 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
|
||
try: | ||
__version__ = version("neptune-client") | ||
except PackageNotFoundError: |
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.
Is possible catch PackageNotFoundError
when python has the src/neptune/version.py
in path?
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.
importlib.metdata.version("something")
works similarly to pip list | grep something
instead of checking the current namespace.
For instance typing
is a proper builtin package but:
>>> import typing
>>> importlib.metadata.version("typing")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 984, in version
return distribution(distribution_name).version
File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 957, in distribution
return Distribution.from_name(distribution_name)
File "/Users/neptune/.conda/envs/neptune-client/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for typing
so I think that nothing will impact it except pip install neptune-client
or pip install -e .
or pip install .
(including direct call to python setup.py install
)
No description provided.