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

WIP: remove version retrieval exception handling code #2491

Closed
wants to merge 1 commit into from

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Feb 22, 2023

Found some outdated code per #2425 (comment), looking to see what happens if I remove it ;).

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #2491 (01a1816) into latest (59f48c1) will increase coverage by 7.80%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           latest    #2491      +/-   ##
==========================================
+ Coverage   84.72%   92.52%   +7.80%     
==========================================
  Files         132      103      -29     
  Lines       14731    11936    -2795     
  Branches     2503     2503              
==========================================
- Hits        12481    11044    -1437     
+ Misses       1948      590    -1358     
  Partials      302      302              
Flag Coverage Δ
python 92.52% <100.00%> (-0.01%) ⬇️
rust ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sourmash/__init__.py 100.00% <100.00%> (ø)
src/core/src/ffi/minhash.rs
src/core/src/sketch/hyperloglog/mod.rs
src/core/src/index/bigsi.rs
src/core/src/errors.rs
src/core/src/index/search.rs
src/core/src/ffi/storage.rs
src/core/src/ffi/index/mod.rs
src/core/src/ffi/utils.rs
src/core/src/sketch/hyperloglog/estimators.rs
... and 20 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -16,6 +16,7 @@ class MinHash - hash sketch class
BSD 3-Clause license.
"""
from deprecation import deprecated
from pkg_resources import get_distribution
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from pkg_resources import get_distribution
from importlib.metadata import version

(maybe add fallbacks for py3.8 too)

"This might be because you are installing from GitHub's tarballs, "
"use the PyPI ones."
)
VERSION = get_distribution(__name__).version
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VERSION = get_distribution(__name__).version
VERSION = version(__name__)

luizirber added a commit that referenced this pull request Mar 5, 2023
Close #2491 

Similar to dib-lab/screed#100 but also dealing
with `entry_points` (and the differences in stdlib for
[`importlib.metadata`](https://pypi.org/project/backports.entry-points-selectable/)...)
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