Skip to content

feat: add support for rsfitsio as backend #1142

feat: add support for rsfitsio as backend

feat: add support for rsfitsio as backend #1142

Workflow file for this run

name: tests
on:
push:
branches:
- master
pull_request: null
env:
PY_COLORS: "1"
# These compiler flags force the tests to fail if arrays are
# accessed at the C level from an unaligned location.
TEST_CFLAGS: "-fsanitize=alignment -fno-sanitize-recover=alignment"
defaults:
run:
shell: bash -leo pipefail {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: tests
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
config:
- { pyver: "3.10", npver: "1", ft: ""}
- { pyver: "3.11", npver: "1.26", ft: "python-gil"}
# - { pyver: "3.12", npver: "1.26", ft: "python-gil"}
# - { pyver: "3.11", npver: "2", ft: "python-gil"}
# - { pyver: "3.12", npver: "2", ft: "python-gil"}
# - { pyver: "3.13", npver: "2", ft: "python-gil"}
- { pyver: "3.14", npver: "2", ft: "python-gil"}
- { pyver: "3.14", npver: "2", ft: "python-freethreading"}
runs-on: ${{ matrix.os }}
env:
PIP_OPTIONS: "--no-cache-dir --no-deps --no-build-isolation -v"
steps:
- name: free disk space
if: matrix.os == 'ubuntu-latest'
uses: endersonmenezes/free-disk-space@v3
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
rm_cmd: "rmz"
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
fetch-tags: true
- uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 #v3.0.0
with:
environment-name: fitsio-dev
environment-file: environment.yml
condarc: |
channels:
- conda-forge
show_channel_urls: true
channel_priority: strict
always_yes: true
create-args: >-
python=${{ matrix.config.pyver }}
numpy=${{ matrix.config.npver }}
${{ matrix.config.ft }}
- name: set parallel testing flags
run: |
if [[ "${{ matrix.config.pyver }}" == "3.14" ]]; then
echo "PRP_FLAGS=--parallel-threads 4 --iterations 4" >> ${GITHUB_ENV}
fi
- name: test bundled build
run: |
export CFLAGS="${CFLAGS} ${TEST_CFLAGS}"
pip cache purge
rm -rf build*
rm -rf $HOME/cfitsio-static-install
find . -name "*.so" -type f -delete
pip install ${PIP_OPTIONS} -e .
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
pytest -vv --durations=20 ${PRP_FLAGS} fitsio
python -c "import fitsio; assert not fitsio.backend_has_bzip2_support()"
python -c "import fitsio; assert not fitsio.backend_has_curl_support()"
else
pytest -vv --durations=20 ${PRP_FLAGS} fitsio
python -c "import fitsio; assert fitsio.backend_has_bzip2_support()"
python -c "import fitsio; assert fitsio.backend_has_curl_support()"
fi
python -c "import fitsio; assert fitsio.backend_is_reentrant()"
- name: install bzip2 and curl on linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libbz2-dev curl libcurl4-openssl-dev
- name: test install sdist .gz with no unit tests
run: |
export CFLAGS="${CFLAGS} ${TEST_CFLAGS}"
pip cache purge
rm -rf build*
rm -rf $HOME/cfitsio-static-install
find . -name "*.so" -type f -delete
rm -rf dist
python setup.py sdist
pip install ${PIP_OPTIONS} dist/*.tar.gz
cd ..
python -c "import fitsio; assert not fitsio.__version__.startswith('0')"
cd -
pip uninstall fitsio --yes
- name: test sdist
run: |
export CFLAGS="${CFLAGS} ${TEST_CFLAGS}"
pip cache purge
rm -rf build*
rm -rf $HOME/cfitsio-static-install
find . -name "*.so" -type f -delete
rm -rf dist
python setup.py sdist
pushd dist/
fname=$(ls fitsio*.gz)
tar xvfz "$fname"
dname=$(echo "$fname" | sed 's/\.tar\.gz//')
pushd $dname
pip install ${PIP_OPTIONS} -e .
pytest -vv --durations=20 ${PRP_FLAGS} fitsio
python -c "import fitsio; assert fitsio.backend_has_bzip2_support()"
python -c "import fitsio; assert fitsio.backend_has_curl_support()"
python -c "import fitsio; assert fitsio.backend_is_reentrant()"
popd
popd