Skip to content

Commit 029f675

Browse files
authored
Merge branch 'main' into circle_sector_pix_region
2 parents 4b253c3 + 15550d6 commit 029f675

File tree

109 files changed

+2282
-1357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2282
-1357
lines changed

.bandit.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
exclude = extern

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Keep dependencies updated with Dependabot version updates
2+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
4+
version: 2
5+
updates:
6+
# Maintain dependencies for GitHub Actions
7+
- package-ecosystem: "github-actions"
8+
directory: ".github/workflows/"
9+
schedule:
10+
interval: "monthly"
11+
groups:
12+
actions:
13+
patterns:
14+
- "*"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Daily Cron Tests
2+
3+
on:
4+
schedule:
5+
# run at 6am UTC on Tue-Fri (complete tests are run every Monday)
6+
- cron: '0 6 * * 2-5'
7+
pull_request:
8+
# We also want this workflow triggered if the 'Daily CI' label is added
9+
# or present when PR is updated
10+
types:
11+
- synchronize
12+
- labeled
13+
push:
14+
tags:
15+
- '*'
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
env:
23+
TOXARGS: '-v'
24+
25+
permissions:
26+
contents: read
27+
28+
jobs:
29+
tests:
30+
if: (github.repository == 'astropy/regions' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Daily CI')))
31+
name: ${{ matrix.prefix }} ${{ matrix.os }}, ${{ matrix.tox_env }}
32+
runs-on: ${{ matrix.os }}
33+
continue-on-error: ${{ matrix.allow_failure }}
34+
strategy:
35+
matrix:
36+
include:
37+
- os: ubuntu-latest
38+
python: '3.12'
39+
tox_env: 'linkcheck'
40+
allow_failure: false
41+
prefix: ''
42+
43+
- os: ubuntu-latest
44+
python: '3.13'
45+
tox_env: 'py313-test-devdeps'
46+
toxposargs: --remote-data=any
47+
allow_failure: true
48+
prefix: '(Allowed failure)'
49+
50+
steps:
51+
- name: Check out repository
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
with:
54+
fetch-depth: 0
55+
- name: Set up Python ${{ matrix.python }}
56+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
57+
with:
58+
python-version: ${{ matrix.python }}
59+
allow-prereleases: true
60+
- name: Install base dependencies
61+
run: python -m pip install --upgrade pip setuptools tox
62+
- name: Print Python, pip, setuptools, and tox versions
63+
run: |
64+
python -c "import sys; print(f'Python {sys.version}')"
65+
python -c "import pip; print(f'pip {pip.__version__}')"
66+
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')"
67+
python -c "import tox; print(f'tox {tox.__version__}')"
68+
- name: Run tests
69+
run: python -m tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
70+
- name: Upload coverage to codecov
71+
if: ${{ contains(matrix.tox_env, '-cov') }}
72+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
73+
with:
74+
files: ./coverage.xml
75+
verbose: true
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Weekly Cron Tests
2+
3+
on:
4+
schedule:
5+
# run every Monday at 5am UTC
6+
- cron: '0 5 * * 1'
7+
pull_request:
8+
# We also want this workflow triggered if the 'Weekly CI' label is added
9+
# or present when PR is updated
10+
types:
11+
- synchronize
12+
- labeled
13+
push:
14+
tags:
15+
- '*'
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
env:
23+
TOXARGS: '-v'
24+
IS_CRON: 'true'
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
tests:
31+
if: (github.repository == 'astropy/regions' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Weekly CI')))
32+
name: ${{ matrix.os }}, ${{ matrix.tox_env }}
33+
runs-on: ${{ matrix.os }}
34+
continue-on-error: ${{ matrix.allow_failure }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
- os: ubuntu-latest
40+
python: '3.12'
41+
tox_env: 'py312-test-alldeps-devinfra'
42+
allow_failure: false
43+
44+
steps:
45+
- name: Check out repository
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
fetch-depth: 0
49+
- name: Set up Python ${{ matrix.python }}
50+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
51+
with:
52+
python-version: ${{ matrix.python }}
53+
- name: Install base dependencies
54+
run: python -m pip install --upgrade pip setuptools tox
55+
- name: Print Python, pip, setuptools, and tox versions
56+
run: |
57+
python -c "import sys; print(f'Python {sys.version}')"
58+
python -c "import pip; print(f'pip {pip.__version__}')"
59+
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')"
60+
python -c "import tox; print(f'tox {tox.__version__}')"
61+
- name: Run tests
62+
run: python -m tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
63+
64+
65+
test_more_architectures:
66+
# The following architectures are emulated and are therefore slow, so
67+
# we include them just in the weekly cron. These also serve as a test
68+
# of using system libraries and using pytest directly.
69+
70+
runs-on: ubuntu-latest
71+
name: More architectures
72+
if: (github.repository == 'astropy/regions' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Arch CI')))
73+
env:
74+
ARCH_ON_CI: ${{ matrix.arch }}
75+
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
include:
80+
- arch: s390x
81+
- arch: ppc64le
82+
- arch: armv7
83+
84+
steps:
85+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
86+
with:
87+
fetch-depth: 0
88+
- uses: uraimo/run-on-arch-action@4141da824ffb5eda88d221d9cf835f6a61ed98d9 # v3.0.0
89+
name: Run tests
90+
id: build
91+
with:
92+
arch: ${{ matrix.arch }}
93+
distro: ubuntu_rolling
94+
95+
shell: /bin/bash
96+
env: |
97+
ARCH_ON_CI: ${{ env.ARCH_ON_CI }}
98+
IS_CRON: ${{ env.IS_CRON }}
99+
100+
install: |
101+
apt-get update -q -y
102+
apt-get install -q -y --no-install-recommends \
103+
git \
104+
g++ \
105+
pkg-config \
106+
python3 \
107+
python3-astropy \
108+
python3-erfa \
109+
python3-extension-helpers \
110+
python3-numpy \
111+
python3-pytest-astropy \
112+
python3-setuptools-scm \
113+
python3-scipy \
114+
python3-venv \
115+
python3-wheel \
116+
wcslib-dev
117+
118+
run: |
119+
uname -a
120+
echo "LONG_BIT="$(getconf LONG_BIT)
121+
python3 -m venv --system-site-packages tests
122+
source tests/bin/activate
123+
# cython and pyerfa versions in ubuntu repos are too old currently
124+
pip install -U cython
125+
pip install -U --no-build-isolation pyerfa
126+
ASTROPY_USE_SYSTEM_ALL=1 pip3 install -v --no-build-isolation -e .[test]
127+
pip3 list
128+
python3 -m pytest

.github/workflows/ci_tests.yml

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: CI Tests
22

33
on:
44
push:
@@ -10,6 +10,7 @@ on:
1010
schedule:
1111
# run every Monday at 6am UTC
1212
- cron: '0 6 * * 1'
13+
workflow_dispatch:
1314

1415
concurrency:
1516
group: ${{ github.workflow }}-${{ github.ref }}
@@ -22,29 +23,22 @@ permissions:
2223
contents: read
2324

2425
jobs:
25-
ci-tests:
26+
tests:
2627
name: ${{ matrix.prefix }} ${{ matrix.os }}, ${{ matrix.tox_env }}
2728
runs-on: ${{ matrix.os }}
2829
continue-on-error: ${{ matrix.allow_failure }}
2930
strategy:
3031
matrix:
3132
include:
3233
- os: ubuntu-latest
33-
python: '3.8'
34-
tox_env: 'py38-test-alldeps'
35-
allow_failure: false
36-
prefix: ''
37-
38-
- os: ubuntu-latest
39-
python: '3.9'
40-
tox_env: 'py39-test-alldeps'
34+
python: '3.10'
35+
tox_env: 'py310-test-oldestdeps'
4136
allow_failure: false
4237
prefix: ''
4338

4439
- os: ubuntu-latest
4540
python: '3.10'
46-
tox_env: 'py310-test-alldeps-cov'
47-
toxposargs: --remote-data=any
41+
tox_env: 'py310-test-alldeps'
4842
allow_failure: false
4943
prefix: ''
5044

@@ -55,78 +49,98 @@ jobs:
5549
prefix: ''
5650

5751
- os: macos-latest
58-
python: '3.10'
59-
tox_env: 'py310-test-alldeps'
52+
python: '3.12'
53+
tox_env: 'py312-test-alldeps'
6054
allow_failure: false
6155
prefix: ''
6256

57+
- os: macos-14
58+
python: '3.12'
59+
tox_env: 'py312-test-alldeps'
60+
allow_failure: false
61+
prefix: 'M1'
62+
6363
- os: windows-latest
64-
python: '3.10'
65-
tox_env: 'py310-test-alldeps'
64+
python: '3.12'
65+
tox_env: 'py312-test-alldeps'
6666
allow_failure: false
6767
prefix: ''
6868

6969
- os: ubuntu-latest
70-
python: '3.10'
71-
tox_env: 'py310-test'
70+
python: '3.12'
71+
tox_env: 'py312-test'
72+
toxposargs: --remote-data=any
7273
allow_failure: false
7374
prefix: ''
7475

7576
- os: ubuntu-latest
76-
python: '3.10'
77+
python: '3.12'
78+
tox_env: 'py312-test-alldeps-cov'
79+
toxposargs: --remote-data=any
80+
allow_failure: false
81+
prefix: ''
82+
83+
- os: ubuntu-24.04-arm
84+
python: '3.12'
85+
tox_env: 'py312-test-alldeps'
86+
toxposargs: --remote-data=any
87+
allow_failure: false
88+
prefix: ''
89+
90+
- os: ubuntu-latest
91+
python: '3.12'
7792
tox_env: 'codestyle'
7893
allow_failure: false
7994
prefix: ''
8095

8196
- os: ubuntu-latest
82-
python: '3.10'
97+
python: '3.12'
8398
tox_env: 'pep517'
8499
allow_failure: false
85100
prefix: ''
86101

87102
- os: ubuntu-latest
88-
python: '3.10'
103+
python: '3.12'
89104
tox_env: 'bandit'
90105
allow_failure: false
91106
prefix: ''
92107

93108
- os: ubuntu-latest
94-
python: '3.8'
95-
tox_env: 'py38-test-alldeps-astropylts-numpy118'
109+
python: '3.13'
110+
tox_env: 'py313-test-alldeps'
96111
allow_failure: false
97112
prefix: ''
98113

99114
- os: ubuntu-latest
100-
python: '3.11.0'
101-
tox_env: 'py311-test-devdeps'
115+
python: '3.13'
116+
tox_env: 'py313-test-devdeps'
102117
toxposargs: --remote-data=any
103118
allow_failure: true
104119
prefix: '(Allowed failure)'
105120

106121
steps:
107122
- name: Check out repository
108-
uses: actions/checkout@v3
123+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
109124
with:
110125
fetch-depth: 0
111126
- name: Set up Python ${{ matrix.python }}
112-
uses: actions/setup-python@v4
127+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
113128
with:
114129
python-version: ${{ matrix.python }}
130+
allow-prereleases: true
115131
- name: Install base dependencies
116-
run: |
117-
python -m pip install --upgrade pip
118-
python -m pip install tox
132+
run: python -m pip install --upgrade pip setuptools tox
119133
- name: Print Python, pip, setuptools, and tox versions
120134
run: |
121135
python -c "import sys; print(f'Python {sys.version}')"
122136
python -c "import pip; print(f'pip {pip.__version__}')"
123137
python -c "import setuptools; print(f'setuptools {setuptools.__version__}')"
124138
python -c "import tox; print(f'tox {tox.__version__}')"
125139
- name: Run tests
126-
run: tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
140+
run: python -m tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }}
127141
- name: Upload coverage to codecov
128142
if: ${{ contains(matrix.tox_env, '-cov') }}
129-
uses: codecov/codecov-action@v3
143+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
130144
with:
131-
file: ./coverage.xml
145+
files: ./coverage.xml
132146
verbose: true

0 commit comments

Comments
 (0)