From ad598ee913bc4504fb1ec39a4143681123514a5e Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 26 May 2022 23:54:26 +0100 Subject: [PATCH 01/28] The wheels on the bus go? --- .github/workflows/deploy.yaml | 110 ++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000000..d2806e09dcc --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,110 @@ +name: Build and upload to PyPI + +on: + pull_request: + branches: + - develop + push: + branches: + - develop + tags: + - "*" + release: + types: + - published + + +concurrency: + group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" + cancel-in-progress: true + + +defaults: + run: + shell: bash -l {0} + + +jobs: + build_wheels: + if: "github.repository == 'MDAnalysis/mdanalysis'" + name: Build wheels + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.6.0 + + - name: upload artifacts + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'published') + uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + if: "github.repository == 'MDAnalysis/mdanalysis'" + name: build source distribution + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build sdist + run: pipx run build --sdist + + - name: upload artifacts + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'published') + uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_testpypi: + if: | + github.repository == 'MDAnalysis/mdanalysis' && + github.event_name == 'push' && startsWith(github.ref, 'refs/tags/' + name: testpypi upload + environment: deploy + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + upload_pypi: + if: | + github.repository == 'MDAnalysis/mdanalysis' && + github.event_name == 'release' && github.event.action == 'published' + name: pypi upload + environment: deploy + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From a9aba49382b4f92e2d34da133df310a9b796c39c Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:02:50 +0100 Subject: [PATCH 02/28] fix typo --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d2806e09dcc..11ea4ae3ec6 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -73,7 +73,7 @@ jobs: upload_testpypi: if: | github.repository == 'MDAnalysis/mdanalysis' && - github.event_name == 'push' && startsWith(github.ref, 'refs/tags/' + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) name: testpypi upload environment: deploy runs-on: ubuntu-latest From 7dfb58d5b1526bd3c1b04892e4491b70965b789b Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:17:42 +0100 Subject: [PATCH 03/28] Set working-directory --- .github/workflows/deploy.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 11ea4ae3ec6..d1d797ae460 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -28,10 +28,14 @@ jobs: build_wheels: if: "github.repository == 'MDAnalysis/mdanalysis'" name: Build wheels + fail-fast: false runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + defaults: + run: + working-directory: ./package steps: - uses: actions/checkout@v3 @@ -53,6 +57,9 @@ jobs: if: "github.repository == 'MDAnalysis/mdanalysis'" name: build source distribution runs-on: ubuntu-latest + defaults: + run: + working-directory: ./package steps: - uses: actions/checkout@v3 @@ -82,7 +89,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: artifact - path: dist + path: package/dist - uses: pypa/gh-action-pypi-publish@v1.5 with: @@ -102,7 +109,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: artifact - path: dist + path: package/dist - uses: pypa/gh-action-pypi-publish@v1.5 with: From 9b27fac94faaf45cb028290660803501c88cbd41 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:20:34 +0100 Subject: [PATCH 04/28] Fix more typos --- .github/workflows/deploy.yaml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d1d797ae460..0d6a427e741 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -28,9 +28,9 @@ jobs: build_wheels: if: "github.repository == 'MDAnalysis/mdanalysis'" name: Build wheels - fail-fast: false runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] defaults: @@ -77,6 +77,30 @@ jobs: with: path: dist/*.tar.gz + build_sdist_tests: + if: "github.repository == 'MDAnalysis/mdanalysis'" + name: build source distribution + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./testsuite + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build sdist + run: pipx run build --sdist + + - name: upload artifacts + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'published') + uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + upload_testpypi: if: | github.repository == 'MDAnalysis/mdanalysis' && @@ -89,7 +113,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: artifact - path: package/dist + path: dist - uses: pypa/gh-action-pypi-publish@v1.5 with: @@ -109,7 +133,7 @@ jobs: - uses: actions/download-artifact@v2 with: name: artifact - path: package/dist + path: dist - uses: pypa/gh-action-pypi-publish@v1.5 with: From 53dd6043cd14586309ba3b1c0d346bebe6944c8a Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:34:28 +0100 Subject: [PATCH 05/28] try passing the package-dir input directly --- .github/workflows/deploy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0d6a427e741..ed180076ac4 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -44,6 +44,8 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.6.0 + with: + package-dir: package - name: upload artifacts if: | @@ -51,7 +53,7 @@ jobs: (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: - path: ./wheelhouse/*.whl + path: ./package/wheelhouse/*.whl build_sdist: if: "github.repository == 'MDAnalysis/mdanalysis'" From cdf29fc17c7974489c92223cfefaa86d3912cbf6 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:46:40 +0100 Subject: [PATCH 06/28] specify python and platforms --- .github/workflows/deploy.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ed180076ac4..2841942cc6b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -28,11 +28,17 @@ jobs: build_wheels: if: "github.repository == 'MDAnalysis/mdanalysis'" name: Build wheels - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.buildplat[0] }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] + buildplat: + - [ubuntu-latest, manylinux_x86_64] + - [macos-10.15, macosx_*] + - [windows-2019, win_amd64] + - [windows-2019, win32] + python: ["cp38", "cp39", "cp310"] defaults: run: working-directory: ./package @@ -46,6 +52,8 @@ jobs: uses: pypa/cibuildwheel@v2.6.0 with: package-dir: package + env: + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - name: upload artifacts if: | From dcc48d9773f8a65e2a85c5b9248d51ce8e4e961a Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 27 May 2022 00:56:37 +0100 Subject: [PATCH 07/28] Don't need os in the matrix --- .github/workflows/deploy.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2841942cc6b..552a0a50a0d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -32,7 +32,6 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] buildplat: - [ubuntu-latest, manylinux_x86_64] - [macos-10.15, macosx_*] From 14eb0968f03d2d2fb0c6ab6520e1479e95fcd8ee Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 14:01:15 +0100 Subject: [PATCH 08/28] Add testpypi testing and make 310 matrix full --- .github/workflows/deploy.yaml | 63 ++++++++++++++++++++++++++++++----- .github/workflows/gh-ci.yaml | 8 +---- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 552a0a50a0d..e775b004f1f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,9 +6,9 @@ on: - develop push: branches: - - develop + - "package-*" tags: - - "*" + - "package-*" release: types: - published @@ -33,15 +33,13 @@ jobs: fail-fast: false matrix: buildplat: - - [ubuntu-latest, manylinux_x86_64] + - [ubuntu-18.04, manylinux_x86_64] - [macos-10.15, macosx_*] - [windows-2019, win_amd64] - - [windows-2019, win32] python: ["cp38", "cp39", "cp310"] defaults: run: working-directory: ./package - steps: - uses: actions/checkout@v3 with: @@ -69,7 +67,6 @@ jobs: defaults: run: working-directory: ./package - steps: - uses: actions/checkout@v3 with: @@ -84,7 +81,7 @@ jobs: (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: - path: dist/*.tar.gz + path: package/dist/*.tar.gz build_sdist_tests: if: "github.repository == 'MDAnalysis/mdanalysis'" @@ -93,7 +90,6 @@ jobs: defaults: run: working-directory: ./testsuite - steps: - uses: actions/checkout@v3 with: @@ -108,7 +104,7 @@ jobs: (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: - path: dist/*.tar.gz + path: testsuite/dist/*.tar.gz upload_testpypi: if: | @@ -148,3 +144,52 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} + + check_testpypi: + # if: | + # github.repository == 'MDAnalysis/mdanalysis' && + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + name: testpypi check + runs-on: ${{ matrix.os }} + # needs: upload_testpypi + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10"] + type: ["FULL", "MIN"] + env: + MPLBACKEND: agg + + steps: + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python-version }} + auto-update-conda: true + channel-priority: flexible + channels: conda-forge, bioconda + add-pip-as-python-dependency: true + mamba-version: "*" + architecture: x64 + + - name: install_full_deps + uses: ./.github/actions/setup-deps + if: "matrix.type == 'FULL'" + with: + mamba: true + full-deps: true + + - name: install_min_deps + if: "matrix.type == 'MIN'" + run: | + pip install pytest pytest-xdist + + - name: pip_install_mda + run: | + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests + + - name: run_tests + run: | + pytest -n2 --pyargs MDAnalysisTests diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index c58d06d0929..f13de379cad 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -28,17 +28,11 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, ] - python-version: [3.8, 3.9] + python-version: [3.8, 3.9, 3.10] full-deps: [true, ] install_hole: [true, ] codecov: [true, ] include: - - name: linux_mindeps_py3_10 - os: ubuntu-latest - python-version: "3.10" - full-deps: false - install_hole: true - codecov: true - name: macOS_bigsur_py39 os: macOS-11 python-version: 3.9 From f4927300a9913e3fde18bc058f85dc61592e46de Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 14:04:55 +0100 Subject: [PATCH 09/28] Need checkout to use custom actions --- .github/workflows/deploy.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e775b004f1f..b4c86050102 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -62,7 +62,7 @@ jobs: build_sdist: if: "github.repository == 'MDAnalysis/mdanalysis'" - name: build source distribution + name: build package source distribution runs-on: ubuntu-latest defaults: run: @@ -85,7 +85,7 @@ jobs: build_sdist_tests: if: "github.repository == 'MDAnalysis/mdanalysis'" - name: build source distribution + name: build test source distribution runs-on: ubuntu-latest defaults: run: @@ -162,6 +162,8 @@ jobs: MPLBACKEND: agg steps: + - uses: actions/checkout@v3 + - name: setup_miniconda uses: conda-incubator/setup-miniconda@v2 with: From 623a3bc093f78cc93f966dbf4e2fa0eca653a5d7 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 14:25:25 +0100 Subject: [PATCH 10/28] fix py310 for various OS version --- .github/workflows/deploy.yaml | 9 +++++++++ .github/workflows/gh-ci.yaml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b4c86050102..b2ba768d574 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -158,6 +158,15 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.8", "3.9", "3.10"] type: ["FULL", "MIN"] + exclude: + # Multiple deps don't like windows + - os: windows-latest + python-version: ['3.8', '3.9', '3.10'] + type: "FULL" + # OpenMM isn't available for this yet + - os: macos-latest + python-version: "3.10" + type: "FULL" env: MPLBACKEND: agg diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index f13de379cad..fa1564f91b0 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, ] - python-version: [3.8, 3.9, 3.10] + python-version: [3.8, 3.9, "3.10"] full-deps: [true, ] install_hole: [true, ] codecov: [true, ] From 2042e75735cf2475b0b151e539df20a61d274a74 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 14:37:42 +0100 Subject: [PATCH 11/28] fix exclude matrix --- .github/workflows/deploy.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b2ba768d574..86120b0f283 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -161,7 +161,13 @@ jobs: exclude: # Multiple deps don't like windows - os: windows-latest - python-version: ['3.8', '3.9', '3.10'] + python-version: "3.8" + type: "FULL" + - os: windows-latest + python-version: "3.9" + type: "FULL" + - os: windows-latest + python-version: "3.10" type: "FULL" # OpenMM isn't available for this yet - os: macos-latest From ecac5a9886d7018020dfc02f14f0f7154d42a83c Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 15:32:35 +0100 Subject: [PATCH 12/28] test purely on version --- .github/workflows/deploy.yaml | 40 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 86120b0f283..d0038e95586 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -120,11 +120,23 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.5 + - name: move_test_dist + run: | + mkdir -p dist-test/dist + mv dist/MDAnalysisTests-* dist-test/dist + + - name: upload_source + uses: pypa/gh-action-pypi-publish@v1.5 + with: + user: __token__ + password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }} + + - name: upload_tests + uses: pypa/gh-action-pypi-publish@v1.5 with: user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} + packages_dir: dist-test/ upload_pypi: if: | @@ -140,10 +152,23 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.5 + - name: move_test_dist + run: | + mkdir -p dist-test/dist + mv dist/MDAnalysisTests-* dist-test/dist + + - name: upload_source + uses: pypa/gh-action-pypi-publish@v1.5 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN_SRC }} + + - name: upload_tests + uses: pypa/gh-action-pypi-publish@v1.5 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: ${{ secrets.PYPI_API_TOKEN_TEST }} + packages_dir: dist-test/ check_testpypi: # if: | @@ -204,8 +229,9 @@ jobs: - name: pip_install_mda run: | - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests + ver=$(grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}') + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis==$ver + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests==$ver - name: run_tests run: | From 07dc4b1b79c2b69519d4183e62a7394554c41145 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 15:45:25 +0100 Subject: [PATCH 13/28] Add guards, allow artifact loading for checking --- .github/workflows/deploy.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d0038e95586..ff10e713a94 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -53,9 +53,9 @@ jobs: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - name: upload artifacts - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - (github.event_name == 'release' && github.event.action == 'published') + #if: | + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + # (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: ./package/wheelhouse/*.whl @@ -76,9 +76,9 @@ jobs: run: pipx run build --sdist - name: upload artifacts - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - (github.event_name == 'release' && github.event.action == 'published') + #if: | + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + # (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: package/dist/*.tar.gz @@ -99,9 +99,9 @@ jobs: run: pipx run build --sdist - name: upload artifacts - if: | - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - (github.event_name == 'release' && github.event.action == 'published') + #if: | + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + # (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: testsuite/dist/*.tar.gz @@ -171,12 +171,12 @@ jobs: packages_dir: dist-test/ check_testpypi: - # if: | - # github.repository == 'MDAnalysis/mdanalysis' && - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + if: | + github.repository == 'MDAnalysis/mdanalysis' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) name: testpypi check runs-on: ${{ matrix.os }} - # needs: upload_testpypi + needs: upload_testpypi strategy: fail-fast: false matrix: From 4662f1746933033068caeb0534b7bfc428c8b635 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 15:55:13 +0100 Subject: [PATCH 14/28] add retention limit, fix workflow hiearchy --- .github/workflows/deploy.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ff10e713a94..9a2b3174059 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -58,7 +58,8 @@ jobs: # (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: - path: ./package/wheelhouse/*.whl + path: wheelhouse/*.whl + retention-days: 7 build_sdist: if: "github.repository == 'MDAnalysis/mdanalysis'" @@ -82,6 +83,7 @@ jobs: uses: actions/upload-artifact@v2 with: path: package/dist/*.tar.gz + retention-days: 7 build_sdist_tests: if: "github.repository == 'MDAnalysis/mdanalysis'" @@ -105,6 +107,7 @@ jobs: uses: actions/upload-artifact@v2 with: path: testsuite/dist/*.tar.gz + retention-days: 7 upload_testpypi: if: | @@ -113,7 +116,7 @@ jobs: name: testpypi upload environment: deploy runs-on: ubuntu-latest - needs: [build_wheels, build_sdist] + needs: [build_wheels, build_sdist, build_sdist_tests] steps: - uses: actions/download-artifact@v2 with: @@ -145,7 +148,7 @@ jobs: name: pypi upload environment: deploy runs-on: ubuntu-latest - needs: [build_wheels, build_sdist] + needs: [build_wheels, build_sdist, build_sdist_tests] steps: - uses: actions/download-artifact@v2 with: From db0cee1f966c491e76dd6d2fe260b858654834a1 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 16:30:55 +0100 Subject: [PATCH 15/28] full testpypi deployment run --- .github/workflows/deploy.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9a2b3174059..2fcd181fc2f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -110,9 +110,9 @@ jobs: retention-days: 7 upload_testpypi: - if: | - github.repository == 'MDAnalysis/mdanalysis' && - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + #if: | + # github.repository == 'MDAnalysis/mdanalysis' && + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) name: testpypi upload environment: deploy runs-on: ubuntu-latest @@ -174,9 +174,9 @@ jobs: packages_dir: dist-test/ check_testpypi: - if: | - github.repository == 'MDAnalysis/mdanalysis' && - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + #if: | + # github.repository == 'MDAnalysis/mdanalysis' && + # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) name: testpypi check runs-on: ${{ matrix.os }} needs: upload_testpypi From 2978f0de7bbc99ba1e440131dd6587313564c8bd Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 16:45:47 +0100 Subject: [PATCH 16/28] try to fix pypi upload action --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2fcd181fc2f..923bd0a98e8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -129,13 +129,13 @@ jobs: mv dist/MDAnalysisTests-* dist-test/dist - name: upload_source - uses: pypa/gh-action-pypi-publish@v1.5 + uses: pypa/gh-action-pypi-publish@release/v1.5.0 with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }} - name: upload_tests - uses: pypa/gh-action-pypi-publish@v1.5 + uses: pypa/gh-action-pypi-publish@release/v1.5.0 with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} @@ -161,13 +161,13 @@ jobs: mv dist/MDAnalysisTests-* dist-test/dist - name: upload_source - uses: pypa/gh-action-pypi-publish@v1.5 + uses: pypa/gh-action-pypi-publish@release/v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN_SRC }} - name: upload_tests - uses: pypa/gh-action-pypi-publish@v1.5 + uses: pypa/gh-action-pypi-publish@release/v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN_TEST }} From 8d4c317e33931c31ea32f46caa61a966c75f84b4 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 16:57:20 +0100 Subject: [PATCH 17/28] try to fix versioning on action again --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 923bd0a98e8..e62ec093417 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -129,13 +129,13 @@ jobs: mv dist/MDAnalysisTests-* dist-test/dist - name: upload_source - uses: pypa/gh-action-pypi-publish@release/v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }} - name: upload_tests - uses: pypa/gh-action-pypi-publish@release/v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} @@ -161,13 +161,13 @@ jobs: mv dist/MDAnalysisTests-* dist-test/dist - name: upload_source - uses: pypa/gh-action-pypi-publish@release/v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN_SRC }} - name: upload_tests - uses: pypa/gh-action-pypi-publish@release/v1.5.0 + uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN_TEST }} From abbf67cfdde58247a329b117ac02b0359c8ab9bc Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 17:09:26 +0100 Subject: [PATCH 18/28] corectly point to testpypi for upload --- .github/workflows/deploy.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e62ec093417..ed5eb1e4fb7 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -133,6 +133,8 @@ jobs: with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }} + skip_existing: true + repository_url: https://test.pypi.org/legacy/ - name: upload_tests uses: pypa/gh-action-pypi-publish@v1.5.0 @@ -140,6 +142,8 @@ jobs: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} packages_dir: dist-test/ + skip_existing: true + repository_url: https://test.pypi.org/legacy/ upload_pypi: if: | From 5c6596a15dcfb540b0bfb092e3308c6796fbdd08 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 17:20:41 +0100 Subject: [PATCH 19/28] try to fix testsuite upload --- .github/workflows/deploy.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ed5eb1e4fb7..824170e1246 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -125,8 +125,8 @@ jobs: - name: move_test_dist run: | - mkdir -p dist-test/dist - mv dist/MDAnalysisTests-* dist-test/dist + mkdir -p testsuite/dist + mv dist/MDAnalysisTests-* testsuite/dist - name: upload_source uses: pypa/gh-action-pypi-publish@v1.5.0 @@ -141,7 +141,7 @@ jobs: with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} - packages_dir: dist-test/ + packages_dir: testsuite/ skip_existing: true repository_url: https://test.pypi.org/legacy/ From cda7a185e51b7d6eb037f672b648ad60aee49050 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 17:30:43 +0100 Subject: [PATCH 20/28] try pointing to the right testsuite package dist --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 824170e1246..df998fc7343 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -141,7 +141,7 @@ jobs: with: user: __token__ password: ${{ secrets.TESTPYPI_API_TOKEN_TEST }} - packages_dir: testsuite/ + packages_dir: testsuite/dist skip_existing: true repository_url: https://test.pypi.org/legacy/ @@ -161,8 +161,8 @@ jobs: - name: move_test_dist run: | - mkdir -p dist-test/dist - mv dist/MDAnalysisTests-* dist-test/dist + mkdir -p testsuite/dist + mv dist/MDAnalysisTests-* testsuite/dist - name: upload_source uses: pypa/gh-action-pypi-publish@v1.5.0 @@ -175,7 +175,7 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN_TEST }} - packages_dir: dist-test/ + packages_dir: testsuite/dist check_testpypi: #if: | From ff2d0b4d45ba9dbf3f7a7ca9711207f6db192587 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 17:42:24 +0100 Subject: [PATCH 21/28] nomralise version on testpypicheck --- .github/workflows/deploy.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index df998fc7343..7ff37de31df 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -236,7 +236,9 @@ jobs: - name: pip_install_mda run: | - ver=$(grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}') + grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}' > version.dat + sed -i "s/-dev0/.dev0/g" version.dat + ver=$(cat version.dat) pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis==$ver pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests==$ver From 6272545cf7941de8407bd746ddeea82fbeac12c7 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 18:12:23 +0100 Subject: [PATCH 22/28] Normalise version numbers for testing --- .github/workflows/deploy.yaml | 5 ++--- maintainer/norm_version.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 maintainer/norm_version.py diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7ff37de31df..4cba2cdd002 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -236,9 +236,8 @@ jobs: - name: pip_install_mda run: | - grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}' > version.dat - sed -i "s/-dev0/.dev0/g" version.dat - ver=$(cat version.dat) + grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}' | tr -d \" > version.dat + ver=$(python maintainer/norm_version.py --file version.dat) pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis==$ver pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests==$ver diff --git a/maintainer/norm_version.py b/maintainer/norm_version.py new file mode 100644 index 00000000000..6bc8748ea04 --- /dev/null +++ b/maintainer/norm_version.py @@ -0,0 +1,32 @@ +from packaging.version import Version + + +def norm_version(version_str: str): + """ + Normalize an input version string in the same way that setuptools' dist + does. + + Parameters + ---------- + version_str : str + A version string to normalize. + + Returns + ------- + str + Normalised version string + """ + return str(Version(version_str)) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument('--file', type=str, help="file with version to parse") + args = parser.parse_args() + + with open(args.file) as filed: + ver = filed.readlines()[0].strip("\n") + + print(norm_version(version_str=ver)) From c5d9d55058498759175ac5d562393b0564b3b635 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 18:52:41 +0100 Subject: [PATCH 23/28] Add guards back, make workflow trigger on pr --- .github/workflows/deploy.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4cba2cdd002..705fc48101a 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,7 +3,7 @@ name: Build and upload to PyPI on: pull_request: branches: - - develop + - "package-*" push: branches: - "package-*" @@ -53,9 +53,9 @@ jobs: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} - name: upload artifacts - #if: | - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - # (github.event_name == 'release' && github.event.action == 'published') + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) || + (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: wheelhouse/*.whl @@ -77,9 +77,9 @@ jobs: run: pipx run build --sdist - name: upload artifacts - #if: | - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - # (github.event_name == 'release' && github.event.action == 'published') + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) || + (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: package/dist/*.tar.gz @@ -101,18 +101,18 @@ jobs: run: pipx run build --sdist - name: upload artifacts - #if: | - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || - # (github.event_name == 'release' && github.event.action == 'published') + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) || + (github.event_name == 'release' && github.event.action == 'published') uses: actions/upload-artifact@v2 with: path: testsuite/dist/*.tar.gz retention-days: 7 upload_testpypi: - #if: | - # github.repository == 'MDAnalysis/mdanalysis' && - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + if: | + github.repository == 'MDAnalysis/mdanalysis' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) name: testpypi upload environment: deploy runs-on: ubuntu-latest @@ -178,9 +178,9 @@ jobs: packages_dir: testsuite/dist check_testpypi: - #if: | - # github.repository == 'MDAnalysis/mdanalysis' && - # (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + if: | + github.repository == 'MDAnalysis/mdanalysis' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/package')) name: testpypi check runs-on: ${{ matrix.os }} needs: upload_testpypi From d800e945760317fe381895b749112f1052122bfa Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 18:55:36 +0100 Subject: [PATCH 24/28] Update changelog --- package/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/CHANGELOG b/package/CHANGELOG index 6891a6d57ba..f3c1bd02e63 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -58,6 +58,8 @@ Fixes * Fixed BAT method Cartesian modifies input data. (Issue #3501) Enhancements + * Wheels and dist now get automatically built and deployed on release + triggers (Issue #1300, PR #3680) * Added `frames` argument to AnalysisBase.run to allow analysis to run on arbitrary list of frames (Issue #1985) * LinearDensity now works with updating AtomGroups (Issue #2508, PR #3617) From 5e9e5cfce1739cd1d16e07aebdace462301b0b87 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 19:04:02 +0100 Subject: [PATCH 25/28] simplify version getter --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 705fc48101a..db7055b2637 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -236,7 +236,7 @@ jobs: - name: pip_install_mda run: | - grep "__version__ =" package/MDAnalysis/version.py | awk '{print $3}' | tr -d \" > version.dat + awk '/__version__ =/ {print $3; quit}' package/MDAnalysis/version.py | tr -d \" > version.dat ver=$(python maintainer/norm_version.py --file version.dat) pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysis==$ver pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple MDAnalysisTests==$ver From 92306a5ab7dcb121ba474d8b180b970e053a3873 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 20:05:49 +0100 Subject: [PATCH 26/28] clarify upload to pypi action names --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index db7055b2637..2b2f14e8b82 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -128,7 +128,7 @@ jobs: mkdir -p testsuite/dist mv dist/MDAnalysisTests-* testsuite/dist - - name: upload_source + - name: upload_source_and_wheels uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ @@ -164,7 +164,7 @@ jobs: mkdir -p testsuite/dist mv dist/MDAnalysisTests-* testsuite/dist - - name: upload_source + - name: upload_source_and_wheels uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ From 731a9ed1e1ad0161f04219432ad0626064090057 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 21:40:45 +0100 Subject: [PATCH 27/28] bump up verbosity --- .github/workflows/deploy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2b2f14e8b82..97a8ad9ac29 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,6 +3,7 @@ name: Build and upload to PyPI on: pull_request: branches: + - develop - "package-*" push: branches: @@ -51,6 +52,7 @@ jobs: package-dir: package env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BUILD_VERBOSITY: 1 - name: upload artifacts if: | From c03ac8d48c7887f9866af62e358dd54402676f4e Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 29 May 2022 21:51:34 +0100 Subject: [PATCH 28/28] disable action on develop, keep verbosity at 1 --- .github/workflows/deploy.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 97a8ad9ac29..adaee18d27e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -3,7 +3,6 @@ name: Build and upload to PyPI on: pull_request: branches: - - develop - "package-*" push: branches: