Skip to content

Commit 66f30fc

Browse files
committed
MNT: use static configuration for setuptools-scm
1 parent 2b5cbbc commit 66f30fc

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools>=61.2",
4-
"setuptools_scm>=6.2",
4+
"setuptools_scm>=8.0.0",
55
"wheel",
66
"jinja2>=2.10.3",
77
"numpy>=2.0.0rc1",
@@ -47,6 +47,9 @@ include-package-data = false
4747
exclude = ["erfa._dev"]
4848
namespaces = false
4949

50+
[tool.setuptools_scm]
51+
version_file = "erfa/_version.py"
52+
5053
[tool.pytest.ini_options]
5154
minversion = "4.6"
5255
testpaths = ["erfa", "docs", "README.rst"]

setup.py

-25
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import re
66
import sys
7-
import functools
87
import setuptools
98
import subprocess
109
from warnings import warn
@@ -179,31 +178,7 @@ def get_extensions():
179178
return [erfa_ext]
180179

181180

182-
try:
183-
with open('erfa/_dev/scm_version.py') as fd:
184-
source = fd.read()
185-
except FileNotFoundError:
186-
guess_next_dev = None
187-
else:
188-
import types
189-
scm_version = types.ModuleType('scm_version')
190-
scm_version.__file__ = 'erfa/_dev/scm_version.py'
191-
code = compile(source, scm_version.__file__, 'exec')
192-
try:
193-
exec(code, scm_version.__dict__)
194-
except ImportError:
195-
guess_next_dev = None
196-
else:
197-
guess_next_dev = functools.partial(scm_version._guess_next_dev,
198-
liberfadir=LIBERFADIR)
199-
200-
use_scm_version = {
201-
'write_to': os.path.join('erfa', '_version.py'),
202-
'version_scheme': guess_next_dev,
203-
}
204-
205181
setuptools.setup(
206-
use_scm_version=use_scm_version,
207182
ext_modules=get_extensions(),
208183
cmdclass={"bdist_wheel": bdist_wheel_abi3},
209184
)

0 commit comments

Comments
 (0)