Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 161 additions & 29 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,180 @@ on:
types:
- published

concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: false

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.14"

- 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-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.14"

- 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/

pypi_push:
- 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: 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-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.13.0
with:
repository-url: https://test.pypi.org/legacy/

deploy-pypi:
name: Deploy to PyPI
runs-on: ubuntu-latest
needs: [build, 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.13.0

test-deployed-testpypi:
name: Test deployed package (TestPyPI)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-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.14"

- 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: pypi_deploy
uses: MDAnalysis/pypi-deployment@main
if: github.event_name == 'release' && github.event.action == 'published'
- 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: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-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.14"

- 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
6 changes: 4 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include README.rst INSTALL CHANGELOG COPYING COPYING.LESSER AUTHORS
include setup.py


10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
]
Expand All @@ -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",
Expand Down Expand Up @@ -60,18 +60,18 @@ 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 = [
"tests/datafiles/*.dx",
"tests/datafiles/*.dx.gz",
"tests/datafiles/*.ccp4",
"tests/datafiles/*.mrc",
"tests/datafiles/*.plt",
"tests/datafiles/*.bz2",
]
Expand Down
Loading