Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 job and wheels #111

Merged
merged 13 commits into from
Sep 7, 2023
38 changes: 35 additions & 3 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [3.9]
python: ['3.11']
toxenv: [test]
toxargs: [-v]

Expand All @@ -38,7 +38,7 @@ jobs:

- name: Test with development versions of our dependencies
os: ubuntu-latest
python: '3.11'
python: '3.12-dev'
toxenv: test-devdeps
toxargs: -v

Expand Down Expand Up @@ -74,7 +74,9 @@ jobs:
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
run: |
pip freeze
tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}

tests_external_liberfa:
name: ${{ matrix.name }}
Expand Down Expand Up @@ -151,3 +153,33 @@ jobs:
- cp311*win_amd64
secrets:
pypi_token: ${{ secrets.pypi_token }}

# TEMPORARY WORKAROUND: Have to separate this out to use unreleased NumPy for Python 3.12
# because shell command to conditionally set PIP_PRE is broken in OpenAstronomy/github-actions-workflows
# /~https://github.com/OpenAstronomy/github-actions-workflows/issues/152
build_and_publish_py312:

uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
with:
upload_to_pypi: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '.dev') }}
test_extras: test
test_command: pytest --pyargs erfa
targets: |
# Linux wheels
- cp312-manylinux_x86_64
- cp312-musllinux_x86_64
- cp312-manylinux_aarch64
# MacOS X wheels - we deliberately do not build universal2 wheels.
# Note that the arm64 wheels are not actually tested so we
# rely on local manual testing of these to make sure they are ok.
- cp312*macosx_x86_64
- cp312*macosx_arm64
# No NumPy wheel for win32
#- cp312*win32
- cp312*win_amd64
# Required so that cp312 can grab a pre-release numpy.
# Can remove when cp312 is released.
env: |
CIBW_ENVIRONMENT: PIP_PRE=1
secrets:
pypi_token: ${{ secrets.pypi_token }}
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ sphinx:
fail_on_warning: false

python:
system_packages: false
install:
- method: pip
path: .
Expand Down
13 changes: 11 additions & 2 deletions pyproject.toml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhvk , turns out at the very least, I need the changes in this file for astropy/astropy#14784

Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[build-system]
requires = ["setuptools", "setuptools_scm[toml]>=6.2",
"packaging", "jinja2>=2.10.3", "numpy>=1.25,<2"]
requires = [
"setuptools",
"setuptools_scm>=6.2",
"jinja2>=2.10.3",
"numpy>=1.25,<2; python_version<'3.12'",

# For Python versions which aren't yet officially supported, we specify an
# unpinned NumPy which allows source distributions to be used and allows
# wheels to be used as soon as they become available.
"numpy>=1.26.0b1; python_version>='3.12'"
]
build-backend = 'setuptools.build_meta'