Skip to content

Commit a3ad4f9

Browse files
authored
Drop pkg_resources module, since that is only python <3.8 (#428)
Since pykeepass dropped support for python <3.8, we can remove the hack to rely on setuptools' pkg_resources for these versions. Also, we need to record the dependency on importlib-metadata, since this is otherwise not installed and attempted to fall back on the obsolete pkg_resources codepath.
1 parent 34e5319 commit a3ad4f9

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

pykeepass/version.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
__all__= ["__version__"]
22

3-
try:
4-
# Retrieval of metadata version for Python 3.8 and above
5-
from importlib.metadata import version
6-
__version__ = version('pykeepass')
7-
except ImportError:
8-
# Fallback for older Python versions (< 3.8)
9-
from pkg_resources import get_distribution
10-
__version__ = get_distribution('pykeepass').version
3+
from importlib.metadata import version
4+
__version__ = version('pykeepass')

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ keywords = ["vault", "keepass"]
1414
requires-python = ">=3.7"
1515
dependencies = [
1616
"pyotp>=2.9.0",
17-
"setuptools; python_version<'3.8'",
17+
"importlib-metadata",
1818
"construct>=2.10.53",
1919
"argon2_cffi>=18.1.0",
2020
"pycryptodomex>=3.6.2",

0 commit comments

Comments
 (0)