Skip to content

add some tests

add some tests #24

Workflow file for this run

name: Wheel building
on:
schedule:
# run every day at 4am UTC
- cron: '0 4 * * *'
workflow_dispatch:
push:
pull_request:
# We also want this workflow triggered if the 'Build all wheels' label is added
# or present when PR is updated
types:
- synchronize
- labeled
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_publish:
# This does the actual wheel building and publishing as part of the cron job
# or if triggered manually via the workflow dispatch, or for a tag.
permissions:
contents: none
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@d9b81a07e789d1b1921ab5fe33de2ddcbbd02c3f # v2.3.0
if: |
github.repository == 'astropy/astropy' && (
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
contains(github.event.pull_request.labels.*.name, 'Build all wheels')
)
with:
# We upload to PyPI for all tags starting with v but not ones ending in .dev
upload_to_pypi: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '.dev') && (github.event_name == 'push') }}
upload_to_anaconda: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
anaconda_user: astropy
anaconda_package: astropy
anaconda_keep_n_latest: 10
# For nightly wheels as well as when building with the 'Build all wheels' label, we disable
# the build isolation and explicitly install the latest developer version of numpy as well as
# the latest stable versions of all other build-time dependencies.
# KEEP IN SYNC WITH [build-system] from pyproject.toml
env: |
CIBW_BEFORE_BUILD: '${{ ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Build all wheels')) && 'pip install -U --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple setuptools>=77.0.0 setuptools_scm cython numpy>=0.0.dev0 extension-helpers pyerfa') || '' }}'
CIBW_BUILD_FRONTEND: '${{ ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Build all wheels')) && 'build; args: --no-isolation') || 'build' }}'
EXTENSION_HELPERS_PY_LIMITED_API: 'cp311'
test_extras: test
# FIXME: we exclude the test_data_out_of_range test since it
# currently fails, see https://github.com/astropy/astropy/issues/10409
# We also exclude test_set_locale as it sometimes relies on the correct locale
# packages being installed, which it isn't always.
test_command: pytest -Wdefault --astropy-header -m "not hypothesis" -k "not test_data_out_of_range and not test_set_locale and not TestQuantityTyping" --strict-markers --pyargs astropy
targets: |
# Linux wheels
- cp3*-manylinux_x86_64
- target: cp3*-manylinux_aarch64
runs-on: ubuntu-24.04-arm
# Note that following wheels are not currently tested:
- cp3*-musllinux_x86_64
# MacOS X wheels - as noted in https://github.com/astropy/astropy/pull/12379 we deliberately
# do not build universal2 wheels.
- cp3*-macosx_x86_64
- cp3*-macosx_arm64
# Windows wheels
- cp3*-win32
- cp3*-win_amd64
- cp3*-win_arm64
secrets:
pypi_token: ${{ secrets.pypi_token }}
anaconda_token: ${{ secrets.anaconda_token }}