Skip to content

Commit

Permalink
Use importlib instead of deprecated pkg_resources (#25)
Browse files Browse the repository at this point in the history
Use importlib instead of deprecated pkg_resources
  • Loading branch information
mcara authored Nov 11, 2023
1 parent 59b36c3 commit 3867527
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
architecture: 'x64'

- script: |
python -m pip install setuptools
python -m pip install setuptools_scm
python -m pip install astropy
python setup.py sdist
displayName: 'Build sdist'
7 changes: 4 additions & 3 deletions azure-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ jobs:

strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
Python310:
python.version: '3.10'
Python311:
python.version: '3.11'
Python312:
python.version: '3.12'
maxParallel: 4

steps:
Expand Down Expand Up @@ -69,4 +71,3 @@ jobs:
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Python $(python.version)-${{ format(parameters.name) }}'

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
],
use_scm_version=True,
setup_requires=SETUP_REQUIRES,
python_requires='>=3.5',
python_requires='>=3.7',
install_requires=INSTALL_REQUIRES,
tests_require=TESTS_REQUIRE,
packages=find_packages(),
Expand Down
7 changes: 3 additions & 4 deletions wiimatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
"""wiimatch"""
from pkg_resources import get_distribution, DistributionNotFound


__docformat__ = 'restructuredtext en'
__author__ = 'Mihai Cara'


from importlib.metadata import PackageNotFoundError, version
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
__version__ = version(__name__)
except PackageNotFoundError:
__version__ = 'UNKNOWN'


Expand Down

0 comments on commit 3867527

Please sign in to comment.