Skip to content

Commit

Permalink
Replace pkg_resources with importlib (#186)
Browse files Browse the repository at this point in the history
* Replace pkg_resources with importlib

* Add Python 3.12 to CI tests, drop 3.9
  • Loading branch information
dougiesquire authored Jul 31, 2024
1 parent 411d5e4 commit 198e61b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Create conda environment
Expand Down
6 changes: 3 additions & 3 deletions ecgtools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python
# flake8: noqa
"""Top-level module for ecgtools ."""
from pkg_resources import DistributionNotFound, get_distribution
from importlib.metadata import PackageNotFoundError, version

from .builder import Builder, RootDirectory, glob_to_regex

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = version(__name__)
except PackageNotFoundError:
# package is not installed
__version__ = '0.0.0'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ select = B,C,E,F,W,T4,B9

[isort]
known_first_party=ecgtools
known_third_party=cf_xarray,joblib,pandas,pkg_resources,pydantic,pytest,setuptools,xarray
known_third_party=cf_xarray,joblib,pandas,pydantic,pytest,setuptools,xarray
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
Expand Down

0 comments on commit 198e61b

Please sign in to comment.