Skip to content

Commit

Permalink
Fix missing dependencies when retrieving version from package metadat…
Browse files Browse the repository at this point in the history
…a. (#392)

Co-authored-by: Guillermo-N <[email protected]>
  • Loading branch information
guillermodotn and guillermodotn authored Jun 2, 2024
1 parent 79e0cab commit 4ae60b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pykeepass/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
__all__= ["__version__"]

# FIXME: switch to using importlib.metadata when dropping Python<=3.7
import pkg_resources
__version__ = pkg_resources.get_distribution('pykeepass').version
try:
# Retrieval of metadata version for Python 3.8 and above
from importlib.metadata import version
__version__ = version('pykeepass')
except ImportError:
# Fallback for older Python versions (< 3.8)
from pkg_resources import get_distribution
__version__ = get_distribution('pykeepass').version
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ authors = [
license = {text = "GPL-3.0"}
keywords = ["vault", "keepass"]
dependencies = [
"setuptools; python_version<'3.8'",
"construct>=2.10.53",
"argon2_cffi>=18.1.0",
"pycryptodomex>=3.6.2",
Expand Down

0 comments on commit 4ae60b4

Please sign in to comment.