Skip to content

Commit

Permalink
maint: modernize version inference
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-murray committed Jun 4, 2024
1 parent 76ad1c6 commit 2bce178
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ignore = [
"D1", # missing docstrings. TODO: add this back in.
"PERF203", # no try/except in loops
]
ignore-init-module-imports = true

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
Expand Down
9 changes: 5 additions & 4 deletions src/edges_io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from pkg_resources import DistributionNotFound, get_distribution
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
__version__ = "unknown"
finally:
del get_distribution, DistributionNotFound
del version, PackageNotFoundError

from pathlib import Path

Expand Down

0 comments on commit 2bce178

Please sign in to comment.