Skip to content

Commit 4411b30

Browse files
authored
Merge pull request #201 from effigies/mnt/pyprojectify
MNT: Consolidate build metadata in pyproject.toml
2 parents 8796a27 + f30a4db commit 4411b30

File tree

10 files changed

+83
-173
lines changed

10 files changed

+83
-173
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

.github/workflows/wheels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- uses: actions/checkout@v3
43+
with:
44+
fetch-depth: 0
4345
- name: Build sdist
4446
run: pipx run build -s
4547
- uses: actions/upload-artifact@v3
@@ -66,6 +68,8 @@ jobs:
6668

6769
steps:
6870
- uses: actions/checkout@v3
71+
with:
72+
fetch-depth: 0
6973

7074
- name: Build wheel(s)
7175
run: pipx run cibuildwheel

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
# Compiled python files
12
*.pyc
3+
4+
# Editor swap files
25
*~
6+
.*.swp
37

8+
# Build artifacts
49
*.so
510
*.c
11+
*.egg-info/
612
build/
13+
dist/
14+
15+
# setuptools_scm
16+
nitime/_version.py

MANIFEST.in

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

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 & 99 deletions
This file was deleted.

pyproject.toml

Lines changed: 47 additions & 3 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'",
@@ -10,10 +11,53 @@ requires = [
1011
]
1112
build-backend = "setuptools.build_meta"
1213

14+
[project]
15+
name = "nitime"
16+
dynamic = ["version"]
17+
description = "Nitime: timeseries analysis for neuroscience data"
18+
readme = "README.txt"
19+
license = { file = "LICENSE" }
20+
requires-python = ">=3.7"
21+
authors = [
22+
{ name = "Nitime developers", email = "[email protected]" },
23+
]
24+
maintainers = [
25+
{ name = "Nipy Developers", email = "[email protected]" },
26+
]
27+
classifiers = [
28+
"Development Status :: 3 - Alpha",
29+
"Environment :: Console",
30+
"Intended Audience :: Science/Research",
31+
"License :: OSI Approved :: BSD License",
32+
"Operating System :: OS Independent",
33+
"Programming Language :: Python",
34+
"Topic :: Scientific/Engineering",
35+
]
36+
dependencies = [
37+
"matplotlib",
38+
"numpy",
39+
"scipy",
40+
]
41+
42+
[project.optional-dependencies]
43+
full = [
44+
"networkx",
45+
"nibabel",
46+
]
47+
48+
[project.urls]
49+
Download = "http://github.com/nipy/nitime/downloads"
50+
Homepage = "http://nipy.org/nitime"
51+
52+
[tool.setuptools.packages.find]
53+
include = ["nitime*"]
54+
55+
[tool.setuptools_scm]
56+
write_to = "nitime/_version.py"
57+
1358
[tool.cibuildwheel]
14-
# Disable CPython 3.6 here; if project.requires-python gets defined,
15-
# cp36* can be removed
16-
skip = "pp* cp36*"
59+
# Disable PyPy
60+
skip = "pp*"
1761

1862
# 64-bit builds only; 32-bit builds seem pretty niche these days, so
1963
# don't bother unless someone asks

setup.py

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,29 @@
11
#!/usr/bin/env python
2-
"""Setup file for the Python nitime package."""
2+
"""Setup file for the Python nitime package.
33
4-
import os
5-
import sys
6-
7-
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
8-
# update it when the contents of directories change.
9-
if os.path.exists('MANIFEST'):
10-
os.remove('MANIFEST')
11-
12-
from setuptools import find_packages, setup
13-
14-
# Get version and release info, which is all stored in nitime/version.py
15-
ver_file = os.path.join('nitime', 'version.py')
16-
with open(ver_file) as f:
17-
exec(f.read())
18-
19-
REQUIRES = []
20-
21-
with open('requirements.txt') as f:
22-
ll = f.readline()[:-1]
23-
while ll:
24-
REQUIRES.append(ll)
25-
ll = f.readline()[:-1]
26-
27-
PACKAGES = find_packages()
28-
29-
30-
opts = dict(name=NAME,
31-
maintainer=MAINTAINER,
32-
maintainer_email=MAINTAINER_EMAIL,
33-
description=DESCRIPTION,
34-
long_description=LONG_DESCRIPTION,
35-
url=URL,
36-
download_url=DOWNLOAD_URL,
37-
license=LICENSE,
38-
classifiers=CLASSIFIERS,
39-
author=AUTHOR,
40-
author_email=AUTHOR_EMAIL,
41-
platforms=PLATFORMS,
42-
version=VERSION,
43-
packages=PACKAGES,
44-
package_data=PACKAGE_DATA,
45-
install_requires=REQUIRES,
46-
requires=REQUIRES,
47-
python_requires=PYTHON_REQUIRES,
48-
)
4+
This file only contains cython components.
5+
See pyproject.toml for the remaining configuration.
6+
"""
7+
from setuptools import setup
498

509
try:
5110
from setuptools import Extension
5211
from Cython.Build import cythonize
5312
from numpy import get_include
13+
5414
# add Cython extensions to the setup options
55-
exts = [Extension('nitime._utils', ['nitime/_utils.pyx'],
56-
include_dirs=[get_include()])]
57-
opts['ext_modules'] = cythonize(exts, language_level='3')
15+
exts = [
16+
Extension(
17+
'nitime._utils',
18+
['nitime/_utils.pyx'],
19+
include_dirs=[get_include()],
20+
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')],
21+
)
22+
]
23+
opts = {'ext_modules': cythonize(exts, language_level='3')}
5824
except ImportError:
5925
# no loop for you!
60-
pass
26+
opts = {}
6127

6228
# Now call the actual setup function
6329
if __name__ == '__main__':

setup_egg.py

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

0 commit comments

Comments
 (0)