From 83cec6277e47d5f0b7a3b64aa155463623e4955a Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Wed, 21 Jan 2026 18:20:04 -0700 Subject: [PATCH 1/6] update deployment workflow - fix #153 - replaced MDAnalysis/pypi-deployment action with explicit steps (see also MDAnalysis/pypi-deployment#11 for details on issues) - include full tests of installed packages --- .github/workflows/deploy.yaml | 203 +++++++++++++++++++++++++++++----- 1 file changed, 174 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e53330e..b91f6d8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -8,48 +8,193 @@ on: types: - published +concurrency: + group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" + cancel-in-progress: true + +defaults: + run: + shell: bash -l {0} + + jobs: - testpypi_push: - environment: - name: deploy - url: https://test.pypi.org/p/GridDataFormats - permissions: - id-token: write - if: | - github.repository == 'MDAnalysis/GridDataFormats' && - (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) - name: Build, upload and test pure Python wheels to TestPypi + build: + name: Build package + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build package (binary wheel and source distribution package) + run: | + python -m build + + - name: Check package + run: | + twine check dist/* + + - name: Upload dist files + uses: actions/upload-artifact@v4 + with: + name: dist-files + path: dist/ + retention-days: 1 + + test-install: + name: Test package installation runs-on: ubuntu-latest + needs: build + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Download dist files + uses: actions/download-artifact@v4 + with: + name: dist-files + path: dist/ + + - name: Install package + run: | + python -m pip install --upgrade pip + pip install dist/*.whl + + - name: Run tests + run: | + python -c "import gridData; print(f'Package {gridData.__version__} imported successfully')" + test-pytest: + name: Run tests + runs-on: ubuntu-latest + needs: build steps: - - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" - - name: testpypi_deploy - uses: MDAnalysis/pypi-deployment@main - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + - name: Download dist files + uses: actions/download-artifact@v4 with: - test_submission: true - package_name: GridDataFormats - module_name: 'gridData' + name: dist-files + path: dist/ + + - name: Install package with test dependencies and tests + run: | + python -m pip install --upgrade pip + WHEEL_FILE=$(ls dist/*.whl) + pip install "$WHEEL_FILE"[test] + + - name: Run tests + run: | + pytest --verbose --pyargs gridData - pypi_push: + deploy-testpypi: + name: Deploy to TestPyPI + runs-on: ubuntu-latest + needs: [build, test-install, test-pytest] + if: | + github.repository == 'MDAnalysis/GridDataFormats' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) environment: - name: deploy - url: https://pypi.org/p/GridDataFormats + name: testpypi + url: https://test.pypi.org/p/GridDataFormats permissions: - id-token: write + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download dist files + uses: actions/download-artifact@v4 + with: + name: dist-files + path: dist/ + + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@v1.12.4 + with: + repository-url: https://test.pypi.org/legacy/ + + deploy-pypi: + name: Deploy to PyPI + runs-on: ubuntu-latest + needs: [build, test-install, test-pytest] if: | github.repository == 'MDAnalysis/GridDataFormats' && (github.event_name == 'release' && github.event.action == 'published') - name: Build, upload and test pure Python wheels to PyPi - runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/GridDataFormats + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download dist files + uses: actions/download-artifact@v4 + with: + name: dist-files + path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.12.4 + + test-deployed-testpypi: + name: Test deployed package (TestPyPI) + runs-on: ubuntu-latest + needs: deploy-testpypi + if: | + github.repository == 'MDAnalysis/GridDataFormats' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) steps: - - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" - - name: pypi_deploy - uses: MDAnalysis/pypi-deployment@main - if: github.event_name == 'release' && github.event.action == 'published' + - name: Install from TestPyPI + run: | + python -m pip install --upgrade pip + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ GridDataFormats[test] + + - name: Test import + run: | + python -c "import gridData; print(f'Package {gridData.__version__} imported successfully from TestPyPi')" + + - name: Run basic tests + run: | + pytest --verbose --pyargs gridData + + test-deployed-pypi: + name: Test deployed package (PyPI) + runs-on: ubuntu-latest + needs: deploy-pypi + if: | + github.repository == 'MDAnalysis/GridDataFormats' && + (github.event_name == 'release' && github.event.action == 'published') + steps: + - name: Set up Python + uses: actions/setup-python@v5 with: - package_name: GridDataFormats - module_name: 'gridData' + python-version: "3.x" + + - name: Install from PyPI + run: | + python -m pip install --upgrade pip + pip install GridDataFormats[test] + + - name: Test import + run: | + python -c "import gridData; print(f'Package {gridData.__version__} imported successfully from PyPi')" + + - name: Run basic tests + run: | + pytest --verbose --pyargs gridData From 0e4be241a0dcccd3976a6f3d4bebf4b89c721f8d Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Wed, 21 Jan 2026 18:40:03 -0700 Subject: [PATCH 2/6] removed outdated license identifier - fix #155 - add license files explicitly - use LGPL 3.0+ identifier --- MANIFEST.in | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index f17a4a7..1ddb7ab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include README.rst INSTALL CHANGELOG COPYING COPYING.LESSER AUTHORS -include setup.py + diff --git a/pyproject.toml b/pyproject.toml index 60dbce0..7e7d044 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,8 @@ build-backend = "setuptools.build_meta" [project] name = "GridDataFormats" description = "Reading and writing of data on regular grids in Python" -license = {file = "COPYING.LESSER" } +license = "LGPL-3.0-or-later" +license-files = ["COPYING", "COPYING.LESSER", "AUTHORS"] authors = [ {name = "Oliver Beckstein", email = "orbeckst@gmail.com"}, ] @@ -19,7 +20,6 @@ classifiers = [ "Development Status :: 6 - Mature", "Environment :: Console", "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: POSIX", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", From ad6c44738f4d817df0f8714eb515993fa8885ca0 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Wed, 21 Jan 2026 18:55:54 -0700 Subject: [PATCH 3/6] fix missing tests in distribution - fix #156 - explicitly list tests and tests.datafiles to be included --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7e7d044..f1b9c7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,12 +60,11 @@ documentation = "https://www.mdanalysis.org/GridDataFormats/" [tool.setuptools] zip-safe = true -include-package-data = true [tool.setuptools.packages.find] namespaces = false -include=["gridData"] -exclude=["devtools", "doc", "ci", "examples"] +include = ["gridData", "gridData.tests", "gridData.tests.datafiles"] +exclude = ["devtools", "doc", "ci", "examples"] [tool.setuptools.package-data] gridData = [ From e94676d68942abe148f42ee14a0a5adf6eb58668 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 22 Jan 2026 09:01:16 -0700 Subject: [PATCH 4/6] include mrc test files in distribution MRC files were left out from the distribution in PR #149. This commit adds them via explicit inclusion pattern in the pyproject.toml file --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f1b9c7b..4f9bcf0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,7 @@ gridData = [ "tests/datafiles/*.dx", "tests/datafiles/*.dx.gz", "tests/datafiles/*.ccp4", + "tests/datafiles/*.mrc", "tests/datafiles/*.plt", "tests/datafiles/*.bz2", ] From d38bbd860ffa35c072e4d08e5f69f1bfe811a209 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 22 Jan 2026 09:28:50 -0700 Subject: [PATCH 5/6] updated and finalized CHANGELOG --- CHANGELOG | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d193c8f..f3b2700 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -13,7 +13,7 @@ The rules for this file: * accompany each entry with github issue/PR number (Issue #xyz) ------------------------------------------------------------------------------- -01/16/2026 IAlibay, ollyfutur, conradolandia, orbeckst, PlethoraChutney, +01/22/2026 IAlibay, ollyfutur, conradolandia, orbeckst, PlethoraChutney, Pradyumn-cloud * 1.1.0 @@ -24,10 +24,11 @@ The rules for this file: (issue #143) * Python 3.13 and 3.14 are now supported (PR #140) * Support for Python 3.9 and 3.10 is now dropped as per SPEC0 (PR #140) + * all tests and data files are now included in the distribution (#156) Enhancements - * `Grid` now accepts binary operations with any operand that can be + * `Grid` now accepts binary operations with any operand that can be broadcasted to the grid's shape according to `numpy` broadcasting rules (PR #142) * `Grid` now allows forcing MRC/CCP4 maps to be read as volumes even when @@ -38,6 +39,7 @@ The rules for this file: * Attempting binary operations on grids with different edges now raises an exception (PR #142) + * updated metadata license identifier (#155) 10/21/2023 IAlibay, orbeckst, lilyminium From 80afbd21a26bb637629e623d8c663a5d21b67185 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 22 Jan 2026 12:00:30 -0700 Subject: [PATCH 6/6] update deployment workflow - run on Python 3.14 - test deployed packages on ubuntu and macos latest fail-fast: false to allow others to run so that we can see tests on different OSs succeeding/failing - concurrency: allow push/tag and release runs to both complete Co-authored-by: Irfan Alibay --- .github/workflows/deploy.yaml | 61 ++++++++++++++--------------------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b91f6d8..e1cca34 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,7 +10,7 @@ on: concurrency: group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" - cancel-in-progress: true + cancel-in-progress: false defaults: run: @@ -28,7 +28,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: "3.14" - name: Install build dependencies run: | @@ -50,31 +50,6 @@ jobs: path: dist/ retention-days: 1 - test-install: - name: Test package installation - runs-on: ubuntu-latest - needs: build - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - name: Download dist files - uses: actions/download-artifact@v4 - with: - name: dist-files - path: dist/ - - - name: Install package - run: | - python -m pip install --upgrade pip - pip install dist/*.whl - - - name: Run tests - run: | - python -c "import gridData; print(f'Package {gridData.__version__} imported successfully')" - test-pytest: name: Run tests runs-on: ubuntu-latest @@ -83,7 +58,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: "3.14" - name: Download dist files uses: actions/download-artifact@v4 @@ -97,14 +72,18 @@ jobs: WHEEL_FILE=$(ls dist/*.whl) pip install "$WHEEL_FILE"[test] - - name: Run tests + - name: Test import + run: | + python -c "import gridData; print(f'Package {gridData.__version__} imported successfully')" + + - name: Run basic tests run: | pytest --verbose --pyargs gridData deploy-testpypi: name: Deploy to TestPyPI runs-on: ubuntu-latest - needs: [build, test-install, test-pytest] + needs: [build, test-pytest] if: | github.repository == 'MDAnalysis/GridDataFormats' && (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) @@ -121,14 +100,14 @@ jobs: path: dist/ - name: Publish to TestPyPI - uses: pypa/gh-action-pypi-publish@v1.12.4 + uses: pypa/gh-action-pypi-publish@v1.13.0 with: repository-url: https://test.pypi.org/legacy/ deploy-pypi: name: Deploy to PyPI runs-on: ubuntu-latest - needs: [build, test-install, test-pytest] + needs: [build, test-pytest] if: | github.repository == 'MDAnalysis/GridDataFormats' && (github.event_name == 'release' && github.event.action == 'published') @@ -145,11 +124,15 @@ jobs: path: dist/ - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.12.4 + uses: pypa/gh-action-pypi-publish@v1.13.0 test-deployed-testpypi: name: Test deployed package (TestPyPI) - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] needs: deploy-testpypi if: | github.repository == 'MDAnalysis/GridDataFormats' && @@ -158,7 +141,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: "3.14" - name: Install from TestPyPI run: | @@ -175,7 +158,11 @@ jobs: test-deployed-pypi: name: Test deployed package (PyPI) - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] needs: deploy-pypi if: | github.repository == 'MDAnalysis/GridDataFormats' && @@ -184,7 +171,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: "3.14" - name: Install from PyPI run: |