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/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 187cd3d2..8c248a76 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 @@ -30,15 +31,25 @@ 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: | 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* + mv dist /tmp/package + rm -rf templateflow.egg-info/ + # Interpolate version if [[ "$GITHUB_REF" == refs/tags/* ]]; then TAG=${GITHUB_REF##*/} @@ -47,14 +58,28 @@ 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 -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}\"" + echo "INSTALLED: \"${INSTALLED_VERSION}\"" + test "${INSTALLED_VERSION}" = "${THISVERSION}" + - name: Install in confined environment [sdist] env: TEMPLATEFLOW_HOME: /tmp/home/sdist 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 dist/templateflow*.tar.gz + 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}\"" echo "INSTALLED: \"${INSTALLED_VERSION}\"" @@ -65,7 +90,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 +98,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 @@ -85,8 +110,8 @@ 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 dist/templateflow*.whl + 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}\"" test "${INSTALLED_VERSION}" = "${THISVERSION}" @@ -96,7 +121,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 +129,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)" @@ -118,8 +143,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}\"" @@ -150,8 +175,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/.travis.yml b/.travis.yml deleted file mode 100644 index 4da3ee4b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +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" - - 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__)')" - python -c 'import templateflow; print(templateflow.__file__)' - echo "Intended: $INTENDED_VERSION" - echo "Installed: $INSTALLED_VERSION" - test "$INTENDED_VERSION" == "$INSTALLED_VERSION" - else - false - fi 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 011b18f1..2b212e12 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,4 @@ [metadata] -author = Oscar Esteban classifiers = Development Status :: 3 - Alpha Intended Audience :: Science/Research @@ -36,11 +35,19 @@ test_requires = pytest-cov == 2.5.1 coverage packages = find: -include_package_data = True +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 =