Skip to content

Commit

Permalink
Merge pull request astropy#283 from astropy/actions
Browse files Browse the repository at this point in the history
Use OpenAstronomy GitHub actions workflows
  • Loading branch information
Cadair committed May 10, 2022
2 parents ea8a388 + 070520e commit 3b5bb62
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 109 deletions.
94 changes: 24 additions & 70 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,32 @@
name: CI

on:
pull_request:
push:
branches: [ main ]
tags:
workflow_dispatch:
schedule:
# Run every Monday at 05:53 UTC
- cron: 53 5 * * 1
pull_request:

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
testenv: [{python: 3.7, toxenv: py37-test-oldestdeps-cov}, {python: 3.8, toxenv: py38-test-cov}, {python: 3.9, toxenv: py39-test-cov}]
include:
- os: ubuntu-latest
testenv: {python: 3.9, toxenv: codestyle}
- os: ubuntu-latest
testenv: {python: 3.8, toxenv: build_docs}
- os: ubuntu-latest
testenv: {python: '3.10', toxenv: py310-test-devdeps-cov}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.testenv.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.testenv.python }}
- name: Install dependencies on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install libgeos-dev libfreetype-dev libpng-dev
- name: Install tox
run: python -m pip install tox
- name: Install codecov
if: ${{ contains(matrix.testenv.toxenv,'-cov') }}
run: python -m pip install codecov
- name: Run tox
run: tox -v -e ${{ matrix.testenv.toxenv }}
- name: Upload coverage to codecov
if: ${{ contains(matrix.testenv.toxenv,'-cov') }}
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
tests:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- linux: codestyle
- macos: py37-test-oldestdeps-cov
- macos: py38-test-cov
- macos: py39-test-cov
- linux: py37-test-oldestdeps-cov
- linux: py38-test-cov
- linux: py39-test-cov
- windows: py37-test-oldestdeps-cov
- windows: py38-test-cov
- windows: py39-test-cov
coverage: 'codecov'

linux32:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_24_i686
steps:
# TODO: Use newer checkout actions when https://github.com/actions/checkout/issues/334 fixed
- name: Checkout code
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install dependencies for Python 3.7
run: |
apt-get update
apt-get -y install libgeos-dev libfreetype6-dev libpng-dev
/opt/python/cp37-cp37m/bin/pip install tox
- name: Run tests for Python 3.7
run: /opt/python/cp37-cp37m/bin/python -m tox -e py37-test-oldestdeps-cov
- name: Install dependencies for Python 3.8
run: |
apt-get update
apt-get -y install libgeos-dev libfreetype6-dev libpng-dev
/opt/python/cp38-cp38/bin/pip install tox
- name: Run tests for Python 3.8
run: /opt/python/cp38-cp38/bin/python -m tox -e py38-test-numpy121-cov
publish:
needs: tests
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
with:
test_extras: test
test_command: pytest -p no:warnings --pyargs reproject
secrets:
pypi_token: ${{ secrets.pypi_token }}
33 changes: 0 additions & 33 deletions azure-pipelines.yml

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ requires = ["setuptools",
"oldest-supported-numpy",
"cython==0.29.21"]
build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
skip = "cp36-* pp* *-musllinux* cp310-win32"
2 changes: 1 addition & 1 deletion reproject/adaptive/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from .deforest import map_coordinates
from ..wcs_utils import (efficient_pixel_to_pixel_with_roundtrip,
efficient_pixel_to_pixel)
efficient_pixel_to_pixel)


__all__ = ['_reproject_adaptive_2d']
Expand Down
4 changes: 2 additions & 2 deletions reproject/adaptive/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_reproject_adaptive_roundtrip(file_format):
data, wcs, target_wcs = prepare_test_data(file_format)

output, footprint = reproject_adaptive((data, wcs), target_wcs, (128, 128),
center_jacobian=True)
center_jacobian=True)

header_out = target_wcs.to_header()

Expand All @@ -250,7 +250,7 @@ def test_reproject_adaptive_uncentered_jacobian():
data, wcs, target_wcs = prepare_test_data('fits')

output, footprint = reproject_adaptive((data, wcs), target_wcs, (128, 128),
center_jacobian=False)
center_jacobian=False)

header_out = target_wcs.to_header()

Expand Down
2 changes: 1 addition & 1 deletion reproject/interpolation/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ..array_utils import map_coordinates
from ..wcs_utils import (efficient_pixel_to_pixel_with_roundtrip,
efficient_pixel_to_pixel, has_celestial)
efficient_pixel_to_pixel, has_celestial)


def _validate_wcs(wcs_in, wcs_out, shape_out):
Expand Down
4 changes: 2 additions & 2 deletions reproject/interpolation/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ def reproject_interp(input_data, output_projection, shape_out=None, hdu_in=0,
order = ORDER[order]

return _reproject_full(array_in, wcs_in, wcs_out, shape_out=shape_out,
order=order, array_out=output_array,
return_footprint=return_footprint, roundtrip_coords=roundtrip_coords)
order=order, array_out=output_array,
return_footprint=return_footprint, roundtrip_coords=roundtrip_coords)

0 comments on commit 3b5bb62

Please sign in to comment.