From 94f964c1f120f7a071e6e036146cb4966d39ee36 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 6 Dec 2020 09:32:58 +0100 Subject: [PATCH 1/2] MAINT: Update build system to be PEP518 fully compliant --- pyproject.toml | 3 ++- setup.cfg | 5 +++++ setup.py | 22 ++-------------------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9d93f080..20d1f983 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,10 @@ [build-system] requires = [ - "setuptools >= 34.4", + "setuptools >= 40.9", "setuptools_scm[toml] >= 3.4", "wheel" ] +build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "templateflow/_version.py" diff --git a/setup.cfg b/setup.cfg index 60600bc8..4c7c6a34 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,7 @@ long_description = file:README.rst long_description_content_type = text/x-rst; charset=UTF-8 maintainer = The NiPreps developers maintainer_email = nipreps@gmail.com +name = templateflow project_urls = Archive = https://github.com/templateflow/templateflow Bug Tracker = https://github.com/templateflow/python-client/issues @@ -23,6 +24,10 @@ project_urls = [options] python_requires = >= 3.6 +setup_requires = + setuptools >= 40.9 + setuptools_scm[toml] >= 3.4 + wheel install_requires = pybids >= 0.12.1 requests diff --git a/setup.py b/setup.py index 56671f7f..cbd8588f 100644 --- a/setup.py +++ b/setup.py @@ -1,25 +1,7 @@ #!/usr/bin/env python -"""Templateflow's setup script.""" -import sys +"""Templateflow's PEP518 setup.py shim.""" from setuptools import setup - -# Give setuptools a hint to complain if it's too old a version -# 30.3.0 allows us to put most metadata in setup.cfg -# Should match pyproject.toml -# setuptools >= 34.4 required by setuptools_scm -# 40.8.0 includes license_file, reducing MANIFEST.in requirements -# -# To install, 34.4.0 is enough, but if we're building an sdist, require 40.8.0 -# This imposes a stricter rule on the maintainer than the user -# Keep the installation version synchronized with pyproject.toml -SETUP_REQUIRES = ['setuptools >= %s' % ("40.8.0" if "sdist" in sys.argv else "34.4")] -SETUP_REQUIRES += ["setuptools_scm >= 3.4", "toml"] -# This enables setuptools to install wheel on-the-fly -SETUP_REQUIRES += ["wheel"] if "bdist_wheel" in sys.argv else [] - if __name__ == "__main__": """ Install entry-point """ - setup( - name="templateflow", setup_requires=SETUP_REQUIRES, - ) + setup() From 153d2784b3f0b5a28fb29e4f269d313f0c10a529 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 6 Dec 2020 09:45:46 +0100 Subject: [PATCH 2/2] fix: numpy 1.20 has dropped Python 3.6 --- .github/workflows/pythonpackage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index a160a3f7..3e946794 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -142,6 +142,9 @@ jobs: source /tmp/setup_install/bin/activate python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ setuptools_scm_git_archive "${{ matrix.pip }}" + if [ "${{ matrix.python-version }}" == "3.6" ]; then + pip install "numpy < 1.20" + fi python setup.py install INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" @@ -174,6 +177,9 @@ jobs: source /tmp/setup_develop/bin/activate python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ setuptools_scm_git_archive "${{ matrix.pip }}" + if [ "${{ matrix.python-version }}" == "3.6" ]; then + pip install "numpy < 1.20" + fi python setup.py develop INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\""