Skip to content

Commit

Permalink
Merge pull request astropy#267 from pllim/last-actions-hero-2
Browse files Browse the repository at this point in the history
TST: Fix and update CI
  • Loading branch information
pllim committed Jan 13, 2022
2 parents 891be7d + 66ab9fb commit e8cb2dc
Show file tree
Hide file tree
Showing 11 changed files with 219 additions and 173 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run unit tests
name: CI

on:
pull_request:
Expand All @@ -20,9 +20,11 @@ jobs:
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}]
testenv: {python: 3.9, toxenv: codestyle}
- os: ubuntu-latest
testenv: [{python: 3.8, build_docs}]
testenv: {python: 3.8, toxenv: build_docs}
- os: ubuntu-latest
testenv: {python: '3.10', toxenv: py310-test-devdeps-cov}

steps:
- uses: actions/checkout@v2
Expand All @@ -36,9 +38,9 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install geos-devel
sudo apt-get install freetype-devel
sudo apt-get install libpng-devel
sudo apt-get install libgeos-dev
sudo apt-get install libfreetype-dev
sudo apt-get install libpng-dev
- name: Install tox
run: python -m pip install tox
- name: Install codecov
Expand All @@ -55,18 +57,24 @@ jobs:
linux32:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_i686
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: /opt/python/cp37-cp37/bin/pip install tox
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-cp37/bin/python -m tox -e py37-test-oldestdeps-cov
run: /opt/python/cp37-cp37m/bin/python -m tox -e py37-test-oldestdeps-cov
- name: Install dependencies for Python 3.8
run: /opt/python/cp38-cp38/bin/pip install tox
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-cov
run: /opt/python/cp38-cp38/bin/python -m tox -e py38-test-numpy121-cov
11 changes: 7 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
|Build Status| |Coverage Status| |Powered by Astropy Badge|
|Docs| |Build Status| |CI Status| |Coverage Status| |Powered by Astropy Badge|

About
=====

The 'reproject' package is a Python package to reproject astronomical
The `reproject` package is a Python package to reproject astronomical
images using various techniques via a uniform interface. By
*reprojection*, we mean the re-gridding of images from one world
coordinate system to another (for example changing the pixel resolution,
Expand All @@ -22,10 +22,13 @@ https://reproject.readthedocs.io
.. figure:: https://github.com/astrofrog/reproject/raw/master/docs/images/index-4.png
:alt: screenshot

.. |Docs| image:: https://readthedocs.org/projects/reproject/badge/?version=latest
:target: https://reproject.readthedocs.io/en/latest/?badge=latest
.. |Build Status| image:: https://dev.azure.com/astropy-project/reproject/_apis/build/status/astropy.reproject?branchName=main
:target: https://dev.azure.com/astropy-project/reproject/_build/latest?definitionId=3&branchName=main
.. |Build status| image:: https://ci.appveyor.com/api/projects/status/0ifg4xonlyrc6eu4/branch/main?svg=true
:target: https://ci.appveyor.com/project/Astropy/reproject/branch/main
.. |CI Status| image:: https://github.com/astropy/reproject/workflows/CI/badge.svg
:target: https://github.com/astropy/reproject/actions
.. |Coverage Status| image:: https://codecov.io/gh/astropy/reproject/branch/main/graph/badge.svg
:target: https://codecov.io/gh/astropy/reproject
.. |Powered by Astropy Badge| image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
:target: https://astropy.org
5 changes: 2 additions & 3 deletions reproject/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ def pytest_configure(config):
PYTEST_HEADER_MODULES['astropy-healpix'] = 'astropy_healpix'
PYTEST_HEADER_MODULES['Cython'] = 'cython'

from . import __version__
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = __version__
from reproject import __version__
TESTED_VERSIONS['reproject'] = __version__
3 changes: 2 additions & 1 deletion reproject/healpix/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from astropy.coordinates import FK5, Galactic
from astropy.io import fits

from ..utils import parse_coord_system, parse_input_healpix_data
from reproject.healpix.utils import parse_coord_system, parse_input_healpix_data


def test_parse_coord_system():
Expand All @@ -26,6 +26,7 @@ def test_parse_coord_system():
assert exc.value.args[0] == "Could not determine frame for system=spam"


@pytest.mark.filterwarnings('ignore:unclosed file:ResourceWarning')
def test_parse_input_healpix_data(tmpdir):

data = np.arange(3072)
Expand Down
1 change: 1 addition & 0 deletions reproject/healpix/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def parse_input_healpix_data(input_data, field=0, hdu_in=None, nested=None):
if 'ORDERING' in header:
nested = header['ORDERING'].lower() == 'nested'
elif isinstance(input_data, str):
# NOTE: hdu is not closed here.
hdu = fits.open(input_data)[hdu_in or 1]
return parse_input_healpix_data(hdu, field=field)
elif isinstance(input_data, tuple) and isinstance(input_data[0], np.ndarray):
Expand Down
Loading

0 comments on commit e8cb2dc

Please sign in to comment.