Skip to content

Commit bf4ac2e

Browse files
authored
Merge pull request #36 from astropy/pkg_resources
Replace deprecated package `pkg_resources`
2 parents 35c3c63 + 9c82644 commit bf4ac2e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

astropylibrarian/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55

66
__all__ = ("__version__",)
77

8-
from pkg_resources import DistributionNotFound, get_distribution
9-
108
try:
11-
__version__ = get_distribution(__name__).version
12-
except DistributionNotFound:
9+
from ._version import __version__
10+
except ImportError:
1311
# package is not installed
14-
__version__ = "0.0.0"
12+
__version__ = ""

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[build-system]
22
requires = [
3-
"setuptools>=42",
3+
"setuptools>=64",
44
"wheel",
5-
"setuptools_scm"
5+
"setuptools_scm>=8"
66
]
7-
build-backend = 'setuptools.build_meta'
7+
build-backend = "setuptools.build_meta"
88

9-
[tools.setuptools_scm]
9+
[tool.setuptools_scm]
10+
version_file = "astropylibrarian/_version.py"
1011

1112
[tool.black]
1213
line-length = 79
13-
target-version = ["py37"]
14+
target-version = ["py311"]
1415
exclude = '''
1516
/(
1617
\.eggs
@@ -28,4 +29,4 @@ exclude = '''
2829
include_trailing_comma = true
2930
multi_line_output = 3
3031
known_first_party = ["astropylibrarian", "tests"]
31-
skip = ["docs/conf.py"]
32+
skip = ["docs/conf.py"]

0 commit comments

Comments
 (0)