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
68 changes: 24 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
schedule:
- cron: '30 2 * * 1,4' # Every Monday and Thursday @ 2h30am UTC

env:
POETRY_VERSION: 2.1.3

jobs:
check_skip:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -40,27 +37,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: Test poetry run
run: poetry --version

- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Setup a virtual environment appropriate to the python version
run: poetry env use python${{ matrix.python-version }}

- name: Install xarray-fits
run: poetry install --extras "testing"
run: pip install .[testing]

- name: Test xarray-fits
run: poetry run py.test -s -vvv tests/
run: py.test -s -vvv tests

# - name: Debug with tmate on failure
# if: ${{ failure() }}
Expand All @@ -75,25 +61,22 @@ jobs:
permissions:
id-token: write
steps:
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: Checkout source
uses: actions/checkout@v6
with:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Build distributions
run: poetry build
- name: Build distributions
run: |
pip install -U pip build
python -m build --sdist --wheel

- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
continue-on-error: true
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
continue-on-error: true

upload-to-pypi:
name: Upload release to PyPI
Expand All @@ -105,18 +88,15 @@ jobs:
permissions:
id-token: write
steps:
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ env.POETRY_VERSION }}

- name: Checkout source
uses: actions/checkout@v6
with:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Build distributions
run: poetry build
- name: Build distributions
run: |
pip install -U pip build
python -m build --sdist --wheel

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

X.Y.Z (YYYY-MM-DD)
------------------
* Migrate to PEP 621 compliant pyproject.toml (:pr:`47`)

0.2.5 (2025-05-20)
------------------
* Include full range of 2024 calver dependencies (:pr:`42`)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

with open("../../pyproject.toml", "rb") as f:
toml = tomli.load(f)
pyproject = toml["tool"]["poetry"]
pyproject = toml["project"]

project = pyproject["name"]
copyright = f"{datetime.now().year}, South African Radio Astronomy Observatory (SARAO)"
Expand Down
45 changes: 24 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
[tool.poetry]
[project]
name = "xarray-fits"
version = "0.2.5"
description = "xarray Datasets for FITS-like data"
authors = ["Simon Perkins <simon.perkins@gmail.com>"]
packages = [{include = "xarrayfits"}]
authors = [{name = "Simon Perkins", email = "simon.perkins@gmail.com"}]
readme = "README.rst"
requires-python = ">=3.9"
dependencies = [
"astropy>=6.0.0,<7",
"dask[array]>=2024.1.0,<2025",
"xarray>=2024,<2025",
"fsspec>=2024,<2025",
]

[tool.poetry.dependencies]
python = "^3.9"
astropy = "^6.0.0"
dask = {extras = ["array"], version = ">= 2024.1.0, < 2025"}
xarray = "^2024"
pytest = {version = "^8.1.1", optional = true, extras = ["testing"]}
distributed = {version = ">= 2024.1.0, < 2025", optional = true, extras = ["testing"]}
fsspec = "^2024"
[project.optional-dependencies]
testing = [
"pytest>=8.1.1,<9",
"distributed>=2024.1.0,<2025",
]
dev = [
"tbump>=6.9.0,<7",
"pre-commit>=2.20.0,<3",
"ruff>=0.1.3,<0.2",
]

[tool.poetry.extras]
testing = ["distributed", "pytest"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.group.dev.dependencies]
tbump = "^6.9.0"
pre-commit = "^2.20.0"
ruff = "^0.1.3"
[tool.hatch.build.targets.wheel]
packages = ["xarrayfits"]

[tool.ruff]
line-length = 88
Expand All @@ -40,7 +47,3 @@ select = [
]

extend-select = ["I"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"