Skip to content

Commit 5e8f9b9

Browse files
Replace pkg_resources and bump Python version requirements (#203)
* replace pkg_resources * replace pkg_resources use in datasets.py * Update setup.cfg * fix typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update Python versions * group Dependabot updates --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 858246c commit 5e8f9b9

File tree

7 files changed

+19
-11
lines changed

7 files changed

+19
-11
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ updates:
55
schedule:
66
# Check for updates once a week
77
interval: 'weekly'
8+
groups:
9+
actions:
10+
patterns:
11+
- "*"

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
python-version: ['3.9', '3.10', '3.11', '3.12']
36+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
3737
steps:
3838
- uses: actions/checkout@v5
3939
- uses: conda-incubator/setup-miniconda@v3

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 100
3-
target-version = ['py38']
3+
target-version = ['py39']
44
skip-string-normalization = true
55

66
[tool.check-manifest]

pythia_datasets/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env python3
22
# flake8: noqa
33
"""Top-level module for pythia-datasets ."""
4-
from pkg_resources import DistributionNotFound, get_distribution
4+
from importlib.metadata import version as _version
55

66
from .datasets import DATASETS, locate
77

88
try:
9-
__version__ = get_distribution(__name__).version
10-
except DistributionNotFound: # pragma: no cover
9+
__version__ = _version(__name__)
10+
except Exception: # pragma: no cover
1111
# package is not installed
1212
__version__ = 'unknown' # pragma: no cover

pythia_datasets/datasets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import pkg_resources
1+
from importlib.resources import files
2+
23
import pooch
34

45
DATASETS = pooch.create(
@@ -7,7 +8,8 @@
78
env='PYTHIA_DATASETS_DIR',
89
)
910

10-
with pkg_resources.resource_stream('pythia_datasets', 'registry.txt') as registry_file:
11+
ref = files('pythia_datasets').joinpath('registry.txt')
12+
with ref.open('rb') as registry_file:
1113
DATASETS.load_registry(registry_file)
1214

1315

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extend-ignore = E203,E501,E402,W605
88

99
[isort]
1010
known_first_party=pythia_datasets
11-
known_third_party=pkg_resources,pooch,setuptools
11+
known_third_party=pooch,setuptools
1212
multi_line_output=3
1313
include_trailing_comma=True
1414
force_grid_wrap=0

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212
setup(
1313
maintainer='Project Pythia Team',
1414
maintainer_email='',
15-
python_requires='>=3.7',
15+
python_requires='>=3.9',
1616
classifiers=[
1717
'Development Status :: 2 - Pre-Alpha',
1818
'License :: OSI Approved :: Apache Software License',
1919
'Natural Language :: English',
2020
'Programming Language :: Python :: 3',
21-
'Programming Language :: Python :: 3.7',
22-
'Programming Language :: Python :: 3.8',
2321
'Programming Language :: Python :: 3.9',
22+
'Programming Language :: Python :: 3.10',
23+
'Programming Language :: Python :: 3.11',
24+
'Programming Language :: Python :: 3.12',
25+
'Programming Language :: Python :: 3.13',
2426
'Topic :: Scientific/Engineering',
2527
'Operating System :: OS Independent',
2628
'Intended Audience :: Science/Research',

0 commit comments

Comments
 (0)