diff --git a/.github/workflows/contrib.yml b/.github/workflows/contrib.yml index 100c332440..d723e6aa48 100644 --- a/.github/workflows/contrib.yml +++ b/.github/workflows/contrib.yml @@ -18,6 +18,10 @@ defaults: run: shell: bash +concurrency: + group: contrib-${{ github.ref }} + cancel-in-progress: true + jobs: stable: # Check each OS, all supported Python, minimum versions and latest releases diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml deleted file mode 100644 index 2d4d665448..0000000000 --- a/.github/workflows/package.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Packaging - -on: - push: - branches: - - master - - maint/* - - rel/* - tags: - - '*' - schedule: - # 8am EST / 9am EDT Mondays - - cron: '0 13 * * 1' - -defaults: - run: - shell: bash - -jobs: - package: - # Build packages and upload - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-latest - python-version: 3.8 - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - name: Create virtual environment - run: tools/ci/create_venv.sh - - name: Build sdist - run: tools/ci/build_archive.sh - env: - INSTALL_TYPE: sdist - - name: Build wheel - run: tools/ci/build_archive.sh - env: - INSTALL_TYPE: wheel - ### Temporary - - name: Check packages with twine - run: | - pip install twine - twine check dist/* - ### Switch back to this if we figure out who has permissions on test.pypi.org - # - name: Test PyPI upload - # uses: pypa/gh-action-pypi-publish@master - # with: - # user: __token__ - # password: ${{ secrets.TEST_PYPI_API_TOKEN }} - # repository_url: https://test.pypi.org/legacy/ - # skip_existing: true - - name: Upload to PyPI (on tags) - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65aba65687..d729cb277a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,59 @@ defaults: run: shell: bash +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: 3 + - run: pip install --upgrade build twine + - name: Build sdist and wheel + run: python -m build + - run: twine check dist/* + - uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ + + test-package: + runs-on: ubuntu-latest + needs: [build] + strategy: + matrix: + package: ['wheel', 'sdist'] + steps: + - uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + - uses: actions/setup-python@v4 + with: + python-version: 3 + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Update pip + run: pip install --upgrade pip + - name: Install wheel + run: pip install dist/nipype-*.whl + if: matrix.package == 'wheel' + - name: Install sdist + run: pip install dist/nipype-*.tar.gz + if: matrix.package == 'sdist' + - run: python -c 'import nipype; print(nipype.__version__)' + - name: Install test extras + run: pip install nipype[tests] + - name: Run tests + run: pytest --doctest-modules -v --pyargs nipype + stable: # Check each OS, all supported Python, minimum versions and latest releases runs-on: ${{ matrix.os }} @@ -55,9 +107,6 @@ jobs: steps: - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -72,7 +121,7 @@ jobs: echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV - name: Install Debian dependencies run: tools/ci/install_deb_dependencies.sh - if: ${{ matrix.os == 'ubuntu-18.04' }} + if: ${{ matrix.os == 'ubuntu-latest' }} - name: Install dependencies run: tools/ci/install_dependencies.sh - name: Install Nipype @@ -90,3 +139,18 @@ jobs: name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} path: test-results.xml if: ${{ always() && matrix.check == 'test' }} + + publish: + runs-on: ubuntu-latest + environment: "Package deployment" + needs: [stable, test-package] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml index 0d04e0548f..43dea8540e 100644 --- a/.github/workflows/tutorials.yml +++ b/.github/workflows/tutorials.yml @@ -5,6 +5,10 @@ on: branches: - 'rel/*' +concurrency: + group: tutorials-${{ github.ref }} + cancel-in-progress: true + jobs: tutorial: runs-on: ubuntu-latest diff --git a/nipype/info.py b/nipype/info.py index eb60e4c22b..72c4590e6c 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -157,6 +157,8 @@ def get_nipype_gitversion(): "pytest-cov", "pytest-env", "pytest-timeout", + "pytest-doctestplus", + "sphinx", ] EXTRA_REQUIRES = { diff --git a/tools/ci/install_deb_dependencies.sh b/tools/ci/install_deb_dependencies.sh index ff1e67732b..3dcf7ae9e4 100755 --- a/tools/ci/install_deb_dependencies.sh +++ b/tools/ci/install_deb_dependencies.sh @@ -6,8 +6,18 @@ set -eu echo "INSTALL_DEB_DEPENDENCIES = $INSTALL_DEB_DEPENDENCIES" +DEPS=( + fsl + # afni + # elastix + fsl-atlases + xvfb + fusefat + graphviz +) + if $INSTALL_DEB_DEPENDENCIES; then bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) sudo apt update - sudo apt install -y -qq fsl afni elastix fsl-atlases xvfb fusefat graphviz + sudo apt install -y -qq ${DEPS[@]} fi