Skip to content

Commit b37f1ab

Browse files
committed
Modernized infrastructure
1 parent fdb09a3 commit b37f1ab

File tree

5 files changed

+86
-69
lines changed

5 files changed

+86
-69
lines changed

.github/dependabot.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "github-actions" # See documentation for possible values
9-
directory: ".github/workflows" # Location of package manifests
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
105
schedule:
116
interval: "monthly"
127
groups:

.github/workflows/ci.yml

+38-57
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,47 @@
11
name: CI
22

33
on:
4+
schedule:
5+
# run every day at 4am UTC
6+
- cron: '0 4 * * *'
47
push:
5-
branches:
6-
- main
78
pull_request:
89
workflow_dispatch:
9-
schedule:
10-
# Monthly, 1st of the month, 6am
11-
- cron: "0 6 1 * *"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1214

1315
jobs:
14-
build:
15-
runs-on: ${{ matrix.os }}
16-
strategy:
17-
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
19-
os: [ubuntu-latest, macos-latest, windows-latest]
20-
steps:
21-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
22-
with:
23-
fetch-depth: 0
24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install build twine
32-
- name: Build sdist/wheel and check metadata
33-
run: |
34-
python -m build
35-
python -m twine check --strict dist/*
3616

37-
test:
38-
runs-on: ${{ matrix.os }}
39-
strategy:
40-
matrix:
41-
python-version: ["3.8", "3.9", "3.10", "3.11"]
42-
os: [ubuntu-latest, macos-latest, windows-latest]
43-
include:
44-
- python-version: "3.7"
45-
os: ubuntu-latest
46-
name: oldest-dependencies
47-
steps:
48-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
49-
with:
50-
fetch-depth: 0
51-
- name: Set up Python ${{ matrix.python-version }}
52-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
53-
with:
54-
python-version: ${{ matrix.python-version }}
55-
- name: Install oldest dependencies
56-
if: ${{ contains(matrix.name,'oldest') }}
57-
run: |
58-
python -m pip install --upgrade pip
59-
pip install astropy~=4.0.0 numpy~=1.16.0 pyparsing~=2.0.0
60-
- name: Install dependencies
61-
run: |
62-
python -m pip install --upgrade pip
63-
pip install .[test]
64-
- name: Test with pytest
65-
run: |
66-
pytest --import-mode=importlib --pyargs pyregion
17+
tests:
18+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
19+
with:
20+
envs: |
21+
- macos: py310-test-oldestdeps
22+
- macos: py311-test
23+
- macos: py312-test
24+
- linux: py310-test-oldestdeps
25+
- linux: py311-test
26+
- linux: py312-test
27+
- linux: py312-test-devdeps
28+
- windows: py310-test-oldestdeps
29+
- windows: py311-test
30+
- windows: py312-test
31+
coverage: 'codecov'
32+
33+
publish:
34+
needs: tests
35+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0
36+
with:
37+
test_extras: test
38+
test_command: pytest -p no:warnings --pyargs pyregion
39+
targets: |
40+
- cp*-manylinux_x86_64
41+
- cp*-manylinux_aarch64
42+
- cp*-macosx_x86_64
43+
- cp*-macosx_arm64
44+
- cp*-win_amd64
45+
46+
secrets:
47+
pypi_token: ${{ secrets.pypi_token }}

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[build-system]
2-
requires = ["setuptools>=43.0.0", "setuptools_scm[toml]>=6.2", "wheel",
3-
"oldest-supported-numpy", "cython"]
2+
requires = ["setuptools",
3+
"setuptools_scm>=6.2",
4+
"cython>=3.0.0, <4",
5+
"numpy>=2.0.0, <3",
6+
"extension-helpers>=1,<2"]
47
build-backend = "setuptools.build_meta"
58

69
[tool.setuptools_scm]

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ classifiers =
2323
Topic :: Scientific/Engineering :: Astronomy
2424

2525
[options]
26-
python_requires = >=3.7
26+
python_requires = >=3.10
2727
install_requires =
2828
pyparsing>=2.0
29-
numpy>=1.16
30-
astropy>=4.0
29+
numpy>=1.23
30+
astropy>=5.0
3131
packages =
3232
pyregion
3333
pyregion.tests

tox.ini

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[tox]
2+
envlist =
3+
py{310,311,312}-{test}{,-oldestdeps}
4+
build_docs
5+
isolated_build = True
6+
7+
[testenv]
8+
setenv =
9+
HOME = {envtmpdir}
10+
MPLBACKEND = Agg
11+
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
12+
changedir =
13+
.tmp/{envname}
14+
deps =
15+
16+
oldestdeps: pyparsing==2.0.*
17+
oldestdeps: numpy==1.23.*
18+
oldestdeps: astropy==5.0.*
19+
20+
devdeps: numpy>=0.0.dev0
21+
devdeps: pyerfa>=0.0.dev0
22+
devdeps: astropy>=0.0.dev0
23+
24+
extras =
25+
test
26+
pip_pre =
27+
devdeps: true
28+
commands =
29+
{list_dependencies_command}
30+
!oldestdeps: pytest --pyargs pyregion {posargs}
31+
32+
[testenv:build_docs]
33+
changedir = docs
34+
description = invoke sphinx-build to build the HTML docs
35+
extras = docs
36+
commands =
37+
{list_dependencies_command}
38+
sphinx-build -W -b html . _build/html

0 commit comments

Comments
 (0)