Skip to content

Commit 54d560b

Browse files
authored
Merge pull request #66 from templateflow/maint/pep518
MAINT: Update build system to be PEP518 fully compliant
2 parents 6bba1b2 + 153d278 commit 54d560b

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ jobs:
142142
source /tmp/setup_install/bin/activate
143143
python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
144144
setuptools_scm_git_archive "${{ matrix.pip }}"
145+
if [ "${{ matrix.python-version }}" == "3.6" ]; then
146+
pip install "numpy < 1.20"
147+
fi
145148
python setup.py install
146149
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
147150
echo "INSTALLED: \"${INSTALLED_VERSION}\""
@@ -174,6 +177,9 @@ jobs:
174177
source /tmp/setup_develop/bin/activate
175178
python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
176179
setuptools_scm_git_archive "${{ matrix.pip }}"
180+
if [ "${{ matrix.python-version }}" == "3.6" ]; then
181+
pip install "numpy < 1.20"
182+
fi
177183
python setup.py develop
178184
INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")')
179185
echo "INSTALLED: \"${INSTALLED_VERSION}\""

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 34.4",
3+
"setuptools >= 40.9",
44
"setuptools_scm[toml] >= 3.4",
55
"wheel"
66
]
7+
build-backend = "setuptools.build_meta"
78

89
[tool.setuptools_scm]
910
write_to = "templateflow/_version.py"

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ long_description = file:README.rst
1414
long_description_content_type = text/x-rst; charset=UTF-8
1515
maintainer = The NiPreps developers
1616
maintainer_email = [email protected]
17+
name = templateflow
1718
project_urls =
1819
Archive = https://github.com/templateflow/templateflow
1920
Bug Tracker = https://github.com/templateflow/python-client/issues
@@ -23,6 +24,10 @@ project_urls =
2324

2425
[options]
2526
python_requires = >= 3.6
27+
setup_requires =
28+
setuptools >= 40.9
29+
setuptools_scm[toml] >= 3.4
30+
wheel
2631
install_requires =
2732
pybids >= 0.12.1
2833
requests

setup.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
#!/usr/bin/env python
2-
"""Templateflow's setup script."""
3-
import sys
2+
"""Templateflow's PEP518 setup.py shim."""
43
from setuptools import setup
54

6-
7-
# Give setuptools a hint to complain if it's too old a version
8-
# 30.3.0 allows us to put most metadata in setup.cfg
9-
# Should match pyproject.toml
10-
# setuptools >= 34.4 required by setuptools_scm
11-
# 40.8.0 includes license_file, reducing MANIFEST.in requirements
12-
#
13-
# To install, 34.4.0 is enough, but if we're building an sdist, require 40.8.0
14-
# This imposes a stricter rule on the maintainer than the user
15-
# Keep the installation version synchronized with pyproject.toml
16-
SETUP_REQUIRES = ['setuptools >= %s' % ("40.8.0" if "sdist" in sys.argv else "34.4")]
17-
SETUP_REQUIRES += ["setuptools_scm >= 3.4", "toml"]
18-
# This enables setuptools to install wheel on-the-fly
19-
SETUP_REQUIRES += ["wheel"] if "bdist_wheel" in sys.argv else []
20-
215
if __name__ == "__main__":
226
""" Install entry-point """
23-
setup(
24-
name="templateflow", setup_requires=SETUP_REQUIRES,
25-
)
7+
setup()

0 commit comments

Comments
 (0)