Skip to content

Commit a3119cf

Browse files
committed
MNT: Switch to setuptools_scm
1 parent 395f3ff commit a3119cf

File tree

6 files changed

+20
-31
lines changed

6 files changed

+20
-31
lines changed

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

nitime/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
__docformat__ = 'restructuredtext'
2323

24-
from .version import __version__
24+
from ._version import __version__
2525

2626
from . import algorithms
2727
from . import timeseries

nitime/version.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools",
4+
"setuptools_scm[toml]>=6.2",
45
"cython",
56
# Newer than NEP29-minimum: compile against oldest numpy available
67
"numpy==1.24; python_version >= '3.11'",
@@ -60,6 +61,9 @@ nitime = [
6061
"data/*.csv",
6162
]
6263

64+
[tool.setuptools_scm]
65+
write_to = "nitime/_version.py"
66+
6367
[tool.cibuildwheel]
6468
# Disable PyPy
6569
skip = "pp*"

setup.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
#!/usr/bin/env python
22
"""Setup file for the Python nitime package."""
3-
4-
import os
5-
from runpy import run_path
6-
73
from setuptools import setup
84

9-
# Get version and release info, which is all stored in nitime/version.py
10-
VARS = run_path(os.path.join('nitime', 'version.py'))
11-
12-
opts = {'version': VARS['__version__']}
13-
145
try:
156
from setuptools import Extension
167
from Cython.Build import cythonize
178
from numpy import get_include
9+
1810
# add Cython extensions to the setup options
19-
exts = [Extension('nitime._utils', ['nitime/_utils.pyx'],
20-
include_dirs=[get_include()])]
21-
opts['ext_modules'] = cythonize(exts, language_level='3')
11+
exts = [
12+
Extension(
13+
'nitime._utils',
14+
['nitime/_utils.pyx'],
15+
include_dirs=[get_include()],
16+
)
17+
]
18+
opts = {'ext_modules': cythonize(exts, language_level='3')}
2219
except ImportError:
2320
# no loop for you!
24-
pass
21+
opts = {}
2522

2623
# Now call the actual setup function
2724
if __name__ == '__main__':

0 commit comments

Comments
 (0)