From a99e1888d0a3f817bf645789e55c610c702ed319 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 8 May 2020 19:07:09 -0700 Subject: [PATCH 1/6] MAINT: Distribute wheel --- .circleci/config.yml | 4 ++-- setup.cfg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4df43c2f..115902f4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -219,8 +219,8 @@ jobs: name: Deploy to PyPi command: | source /tmp/venv/bin/activate - pip install "setuptools>=42.0" "setuptools_scm[toml] >= 3.4" twine - python setup.py sdist + pip install "setuptools>=42.0" "setuptools_scm[toml] >= 3.4" wheel twine + python setup.py sdist bdist_wheel twine check dist/* twine upload dist/* diff --git a/setup.cfg b/setup.cfg index 011b18f1..ecbc6816 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,7 +36,7 @@ test_requires = pytest-cov == 2.5.1 coverage packages = find: -include_package_data = True +zip_safe = true [options.packages.find] exclude = From 7678f5d271caaa22f21e1b5cfd35ff28ef3120bf Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 8 May 2020 19:13:07 -0700 Subject: [PATCH 2/6] chore: drop author metadata, maintainers is set --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ecbc6816..29df8235 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,4 @@ [metadata] -author = Oscar Esteban classifiers = Development Status :: 3 - Alpha Intended Audience :: Science/Research From ae2887e7b9cba19406ba722b7332f3e67803bda1 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 8 May 2020 22:46:07 -0700 Subject: [PATCH 3/6] chore: add a pip installation --- .github/workflows/pythonpackage.yml | 30 +++++++++++++++++++++++------ .travis.yml | 5 ++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 187cd3d2..6e610332 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -30,6 +30,7 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - name: Build in confined environment and interpolate version run: | python -m venv /tmp/buildenv @@ -39,6 +40,9 @@ jobs: python setup.py sdist bdist_wheel python -m twine check dist/templateflow* + mv dist /tmp/package + rm -rf templateflow.egg-info/ + # Interpolate version if [[ "$GITHUB_REF" == refs/tags/* ]]; then TAG=${GITHUB_REF##*/} @@ -47,6 +51,20 @@ jobs: THISVERSION=${TAG:-$THISVERSION} echo "Expected VERSION: \"${THISVERSION}\"" echo ::set-env name=THISVERSION::"${THISVERSION}" + + - name: Install in confined environment [pip] + env: + TEMPLATEFLOW_HOME: /tmp/home/pip + run: | + python -m venv /tmp/pip + source /tmp/pip/bin/activate + python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" + python -m pip install . + INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') + echo "VERSION: \"${THISVERSION}\"" + echo "INSTALLED: \"${INSTALLED_VERSION}\"" + test "${INSTALLED_VERSION}" = "${THISVERSION}" + - name: Install in confined environment [sdist] env: TEMPLATEFLOW_HOME: /tmp/home/sdist @@ -54,7 +72,7 @@ jobs: python -m venv /tmp/install_sdist source /tmp/install_sdist/bin/activate python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" - python -m pip install dist/templateflow*.tar.gz + python -m pip install /tmp/package/templateflow*.tar.gz INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "VERSION: \"${THISVERSION}\"" echo "INSTALLED: \"${INSTALLED_VERSION}\"" @@ -65,7 +83,7 @@ jobs: TEMPLATEFLOW_HOME: /tmp/home/sdist run: | source /tmp/install_sdist/bin/activate - python -m pip install dist/templateflow*.tar.gz + python -m pip install /tmp/package/templateflow*.tar.gz find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install.txt - name: Re-install in confined environment [sdist - missing template] env: @@ -73,7 +91,7 @@ jobs: run: | rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym source /tmp/install_sdist/bin/activate - python -m pip install dist/templateflow*.tar.gz + python -m pip install /tmp/package/templateflow*.tar.gz python -c "import templateflow; templateflow.update(overwrite=False)" find ${TEMPLATEFLOW_HOME} >> /tmp/.sdist-install-2.txt diff /tmp/.sdist-install.txt /tmp/.sdist-install-2.txt @@ -86,7 +104,7 @@ jobs: python -m venv /tmp/install_wheel source /tmp/install_wheel/bin/activate python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" - python -m pip install dist/templateflow*.whl + python -m pip install /tmp/package/templateflow*.whl INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" test "${INSTALLED_VERSION}" = "${THISVERSION}" @@ -96,7 +114,7 @@ jobs: TEMPLATEFLOW_HOME: /tmp/home/wheel run: | source /tmp/install_wheel/bin/activate - python -m pip install dist/templateflow*.whl + python -m pip install /tmp/package/templateflow*.whl find ${TEMPLATEFLOW_HOME} >> /tmp/.wheel-install.txt - name: Re-install in confined environment [wheel - missing template] env: @@ -104,7 +122,7 @@ jobs: run: | rm -rf ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym source /tmp/install_wheel/bin/activate - python -m pip install dist/templateflow*.whl + python -m pip install /tmp/package/templateflow*.whl # Wheels do not run post-install hooks: test ! -d ${TEMPLATEFLOW_HOME}/tpl-MNI152NLin2009cAsym python -c "import templateflow; templateflow.update(overwrite=False)" diff --git a/.travis.yml b/.travis.yml index 4da3ee4b..7c892631 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ matrix: before_install: - python -m pip install -U $PIP - - python -m pip install -U "setuptools>=42.0" "setuptools_scm[toml]>=3.4" + - python -m pip install -U "setuptools>=42.0" "setuptools_scm[toml]>=3.4" wheel - pip install -U flake8 install: @@ -66,8 +66,7 @@ script: INTENDED_VERSION="$(python setup.py --version)" mkdir for_testing cd for_testing - INSTALLED_VERSION="$(python -c 'import templateflow; print(templateflow.__version__)')" - python -c 'import templateflow; print(templateflow.__file__)' + INSTALLED_VERSION=$( python -c "import templateflow; print(templateflow.__version__, end='')" ) echo "Intended: $INTENDED_VERSION" echo "Installed: $INSTALLED_VERSION" test "$INTENDED_VERSION" == "$INSTALLED_VERSION" From a85bc9e5acaf85350895f4d6048e1b6a80b7bced Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sat, 9 May 2020 00:22:05 -0700 Subject: [PATCH 4/6] fix: add package data --- .github/workflows/pythonpackage.yml | 19 ++++++++++--------- MANIFEST.in | 13 +++++-------- setup.cfg | 8 ++++++++ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 6e610332..f2556df8 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -17,6 +17,7 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8] + pip: ["pip", "pip~=10.0.1"] steps: - uses: actions/checkout@v2 @@ -35,8 +36,8 @@ jobs: run: | python -m venv /tmp/buildenv source /tmp/buildenv/bin/activate - python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ - setuptools_scm_git_archive "pip>=10.0.1" twine docutils + python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ + setuptools_scm_git_archive pip twine docutils python setup.py sdist bdist_wheel python -m twine check dist/templateflow* @@ -58,7 +59,7 @@ jobs: run: | python -m venv /tmp/pip source /tmp/pip/bin/activate - python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" + python -m pip install -U "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "${{ matrix.pip }}" python -m pip install . INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "VERSION: \"${THISVERSION}\"" @@ -71,7 +72,7 @@ jobs: run: | python -m venv /tmp/install_sdist source /tmp/install_sdist/bin/activate - python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" + python -m pip install -U "setuptools ~= 42.0" "${{ matrix.pip }}" python -m pip install /tmp/package/templateflow*.tar.gz INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "VERSION: \"${THISVERSION}\"" @@ -103,7 +104,7 @@ jobs: run: | python -m venv /tmp/install_wheel source /tmp/install_wheel/bin/activate - python -m pip install "setuptools ~= 42.0" "pip>=10.0.1" + python -m pip install -U "setuptools ~= 42.0" "${{ matrix.pip }}" python -m pip install /tmp/package/templateflow*.whl INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" @@ -136,8 +137,8 @@ jobs: run: | python -m venv /tmp/setup_install source /tmp/setup_install/bin/activate - python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ - setuptools_scm_git_archive "pip>=10.0.1" + python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ + setuptools_scm_git_archive "${{ matrix.pip }}" python setup.py install INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" @@ -168,8 +169,8 @@ jobs: run: | python -m venv /tmp/setup_develop source /tmp/setup_develop/bin/activate - python -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ - setuptools_scm_git_archive "pip>=10.0.1" + python -m pip install -U "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \ + setuptools_scm_git_archive "${{ matrix.pip }}" python setup.py develop INSTALLED_VERSION=$(python -c 'import templateflow as tf; print(tf.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" diff --git a/MANIFEST.in b/MANIFEST.in index 26f71b64..a4dce165 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,11 +1,8 @@ -# data -include templateflow/conf/config.json -include templateflow/conf/templateflow-skel.zip -include templateflow/conf/templateflow-skel.md5 +recursive-exclude templateflow/tests * +recursive-exclude templateflow/conf/tests * +recursive-exclude docs/ * recursive-exclude .circleci/ * recursive-exclude .github/ * -recursive-exclude docker/ * -recursive-exclude docs/ * -recursive-exclude joss/ * -exclude .codecov.yml .coveragerc .gitignore .gitattributes .pep8speaks.yml .travis.yml .zenodo.json codecov.yml Dockerfile update_changes.sh + +exclude .gitignore .gitattributes .git_archival.txt .travis.yml .zenodo.json codecov.yml update_changes.sh diff --git a/setup.cfg b/setup.cfg index 29df8235..2b212e12 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,9 +37,17 @@ test_requires = packages = find: zip_safe = true +[options.package_data] +templateflow = + conf/config.json + conf/templateflow-skel.zip + conf/templateflow-skel.md5 + [options.packages.find] exclude = *.tests + tests.* + *.tests.* [options.extras_require] citations = From 5c7bab47ecb194f28985dfafaf2f71d2ebd10fec Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sat, 9 May 2020 00:48:24 -0700 Subject: [PATCH 5/6] enh: cache pip downloaded packages --- .github/workflows/pythonpackage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index f2556df8..8c248a76 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -31,6 +31,12 @@ jobs: uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} + - uses: actions/cache@v1 + with: + path: $HOME/.cache/pip + key: pip-cache-v1 + restore-keys: | + pip-cache- - name: Build in confined environment and interpolate version run: | From d27f263d8617ec4e3a3fe1a52ef4678ac4fffe82 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sat, 9 May 2020 00:58:05 -0700 Subject: [PATCH 6/6] fix: remove travis config file after migrating to gh-actions [skip ci] --- .travis.yml | 75 ----------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c892631..00000000 --- a/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -# vim ft=yaml -dist: xenial -sudo: true -language: python - -cache: - directories: - - $HOME/.cache/pip - -python: - - 3.6 - - 3.7 - - 3.8 - -env: - global: - - CHECK_TYPE="install" - - INSTALL_TYPE="pip" - - PIP="pip" - matrix: - - CHECK_TYPE="style" - - INSTALL_TYPE="install" - - INSTALL_TYPE="develop" - - INSTALL_TYPE="sdist" - - INSTALL_TYPE="wheel" - - PIP="pip==18.1" - - PIP="pip==10.0.1" - -matrix: - exclude: - - python: 3.7 - env: CHECK_TYPE="style" - - python: 3.8 - env: CHECK_TYPE="style" - -before_install: - - python -m pip install -U $PIP - - python -m pip install -U "setuptools>=42.0" "setuptools_scm[toml]>=3.4" wheel - - pip install -U flake8 - -install: - - | - if [ "$INSTALL_TYPE" == "install" ]; then - python setup.py install - elif [ "$INSTALL_TYPE" == "develop" ]; then - python setup.py develop - elif [ "$INSTALL_TYPE" == "pip" ]; then - pip install . - elif [ "$INSTALL_TYPE" == "sdist" ]; then - python setup.py sdist - pip install dist/*.tar.gz - elif [ "$INSTALL_TYPE" == "wheel" ]; then - python setup.py bdist_wheel - pip install dist/*.whl - fi - - | - if [ "$CHECK_TYPE" == "style" ]; then - travis_retry pip install -U flake8 - fi - -script: - - | - if [ "$CHECK_TYPE" == "style" ]; then - flake8 templateflow - elif [ "$CHECK_TYPE" == "install" ]; then - INTENDED_VERSION="$(python setup.py --version)" - mkdir for_testing - cd for_testing - INSTALLED_VERSION=$( python -c "import templateflow; print(templateflow.__version__, end='')" ) - echo "Intended: $INTENDED_VERSION" - echo "Installed: $INSTALLED_VERSION" - test "$INTENDED_VERSION" == "$INSTALLED_VERSION" - else - false - fi