Skip to content

MNT: Enable wheels for Python 3.12 #26582

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

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 23, 2023

PR summary

We should probably figure out tests #24711, but that shouldn't stop us from making the wheels at least.

Fixes #26557

PR checklist

@QuLogic QuLogic added Maintenance CI: Run cibuildwheel Run wheel building tests on a PR labels Aug 23, 2023
@QuLogic QuLogic added this to the v3.7.3 milestone Aug 23, 2023
@QuLogic QuLogic force-pushed the py312-wheel branch 2 times, most recently from 699182c to c7d91b0 Compare August 23, 2023 20:33
@effigies
Copy link

FWIW, I have had some success using the requires table to pin specific versions for building:

[build-system]
requires = [
  "setuptools",
  "setuptools_scm[toml]>=6.2",
  "cython",
  # Newer than NEP29-minimum: compile against oldest numpy available
  "numpy==1.26b1; python_version >= '3.12rc1'",
  "numpy==1.24; python_version >= '3.11' and python_version < '3.12.dev0'",
  # NEP29-minimum as of Aug 17, 2023
  "numpy==1.22; python_version >= '3.8' and python_version < '3.11'",
]
build-backend = "setuptools.build_meta"

@QuLogic QuLogic force-pushed the py312-wheel branch 2 times, most recently from f6cf7ad to c7b62da Compare August 23, 2023 20:48
@QuLogic
Copy link
Member Author

QuLogic commented Aug 23, 2023

FWIW, I have had some success using the requires table to pin specific versions for building:

Yes, I did see that elsewhere, though I was hoping to avoid it since it's mostly a wheel-building issue.

  # Newer than NEP29-minimum: compile against oldest numpy available
  "numpy==1.26b1; python_version >= '3.12rc1'",
  "numpy==1.24; python_version >= '3.11' and python_version < '3.12.dev0'",
  # NEP29-minimum as of Aug 17, 2023
  "numpy==1.22; python_version >= '3.8' and python_version < '3.11'",

Note though that since NumPy 1.25, we no longer use NEP29 as the basis for the build requirement.

@effigies
Copy link

Note though that since NumPy 1.25, we no longer use NEP29 as the basis for the build requirement.

I just saw that (via #26443), and look forward to removing the extra lines from my projects.

@QuLogic
Copy link
Member Author

QuLogic commented Aug 23, 2023

Ah, no wheels for contourpy; I really don't want to have to figure out how to get full Meson support in there too; so waiting on contourpy/contourpy#262

CIBW_ARCHS: ${{ matrix.cibw_archs }}
# Remove this once NumPy with Python 3.12 wheels is not pre-release.
CIBW_BEFORE_BUILD: >-
pip install certifi "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&

Choose a reason for hiding this comment

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

Would you be willing to try adding contourpy's build-requires? They're not likely to put out a wheel until numpy puts out a final 1.26.0 release, which is not going to happen until 3.12 final.

Suggested change
pip install certifi "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" &&
pip install certifi "setuptools>=42" "setuptools_scm>=7" "meson >= 1.2.0" "meson-python >= 0.13.1" "pybind11 >= 2.10.4"

Copy link
Contributor

@neutrinoceros neutrinoceros Aug 26, 2023

Choose a reason for hiding this comment

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

Where are you getting this from ? CPython 3.12.0 is scheduled for early October while numpy 1.26 's milestone is currently aimed at September 1st.

Choose a reason for hiding this comment

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

Possibly a faulty memory. Apologies.

Copy link
Contributor

Choose a reason for hiding this comment

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

no problem, just asking :)

@QuLogic QuLogic force-pushed the py312-wheel branch 3 times, most recently from 8899da7 to 17ed86b Compare August 26, 2023 08:59
@QuLogic QuLogic marked this pull request as ready for review August 26, 2023 20:36
@ksunden ksunden merged commit 9dfa263 into matplotlib:main Aug 30, 2023
@lumberbot-app
Copy link

lumberbot-app bot commented Aug 30, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.7.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 9dfa263cfcd0ed46208c56aca16f3bc460bb9294
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #26582: MNT: Enable wheels for Python 3.12'
  1. Push to a named branch:
git push YOURFORK v3.7.x:auto-backport-of-pr-26582-on-v3.7.x
  1. Create a PR against branch v3.7.x, I would have named this PR:

"Backport PR #26582 on branch v3.7.x (MNT: Enable wheels for Python 3.12)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

QuLogic added a commit that referenced this pull request Aug 30, 2023
…582-on-v3.8.x

Backport PR #26582 on branch v3.8.x (MNT: Enable wheels for Python 3.12)
@ksunden
Copy link
Member

ksunden commented Sep 13, 2023

The backport was included in #26672

@ksunden ksunden mentioned this pull request Sep 15, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Run cibuildwheel Run wheel building tests on a PR Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: Nightly Python 3.12 builds
5 participants