Skip to content

perf: release the GIL for reads #869

perf: release the GIL for reads

perf: release the GIL for reads #869

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: "", doslow: ""}
- { pyver: "3.11", npver: "1.26", ft: "python-gil", doslow: ""}
- { pyver: "3.12", npver: "1.26", ft: "python-gil", doslow: ""}
- { pyver: "3.11", npver: "2", ft: "python-gil", doslow: ""}
- { pyver: "3.12", npver: "2", ft: "python-gil", doslow: ""}
- { pyver: "3.13", npver: "2", ft: "python-gil", doslow: ""}
- { pyver: "3.14", npver: "2", ft: "python-gil", doslow: ""}
- { pyver: "3.14", npver: "2", ft: "python-freethreading", doslow: ""}
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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
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.ft }}" == "python-freethreading" ]]; 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 ${{ matrix.config.doslow }} ${PRP_FLAGS} fitsio
python -c "import fitsio; assert not fitsio.cfitsio_has_bzip2_support()"
python -c "import fitsio; assert not fitsio.cfitsio_has_curl_support()"
else
pytest -vv ${{ matrix.config.doslow }} ${PRP_FLAGS} fitsio
python -c "import fitsio; assert fitsio.cfitsio_has_bzip2_support()"
python -c "import fitsio; assert fitsio.cfitsio_has_curl_support()"
fi
- 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 ${{ matrix.config.doslow }} ${PRP_FLAGS} fitsio
python -c "import fitsio; assert fitsio.cfitsio_has_bzip2_support()"
python -c "import fitsio; assert fitsio.cfitsio_has_curl_support()"
popd
popd