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 support #7315

Closed
wants to merge 3 commits into from
Closed

Add Python 3.12 support #7315

wants to merge 3 commits into from

Conversation

pquentin
Copy link

@pquentin pquentin commented Jun 9, 2023

What do these changes do?

Add Python 3.12 support, as requested in #7229 and following aio-libs/frozenlist#436 as recommended by @webknjaz.

I don't think this will work because frozenlist needs to be released and updated, but that's a start.

Are there changes in behavior for the user?

No.

Related issue number

Closes #7229

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt (not needed, this only changes the CI)
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 9, 2023
@pquentin pquentin mentioned this pull request Jun 9, 2023
2 tasks
@pquentin
Copy link
Author

pquentin commented Jun 9, 2023

I've tried installing frozenlist from git for testing purposes but it does not work as cython is not called on pip install. I'm afraid we really need a release.

@Dreamsorcerer
Copy link
Member

Note that we won't publish wheels etc. for 3.12 until start of August at the earliest. The build system only builds wheels for stable releases (release candidate or later), due to potential ABI compatible changes (i.e. A release today might not work on the next beta release of 3.12).

This PR just ensures we are testing against 3.12.

@@ -152,15 +152,15 @@ jobs:
os: ubuntu
experimental: false
- os: macos
pyver: "3.11.0-alpha - 3.11.0"
pyver: "3.12-dev"
Copy link
Member

Choose a reason for hiding this comment

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

The CI is not even starting any tests. Maybe this is not a valid pyver value? Probably better to use a similar range to what we had before.

Copy link

Choose a reason for hiding this comment

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

This has recently changes in the setup-python action, we can now use the normal version indicator.

Suggested change
pyver: "3.12-dev"
pyver: "3.12"

Copy link

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Needs addition change / addition of allow-prereleases: true:

    - name: Setup Python ${{ matrix.pyver }}
      id: python-install
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.pyver }}
        allow-prereleases: true

@@ -152,15 +152,15 @@ jobs:
os: ubuntu
experimental: false
- os: macos
pyver: "3.11.0-alpha - 3.11.0"
pyver: "3.12-dev"
Copy link

Choose a reason for hiding this comment

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

This has recently changes in the setup-python action, we can now use the normal version indicator.

Suggested change
pyver: "3.12-dev"
pyver: "3.12"

experimental: true
no-extensions: 'Y'
- os: ubuntu
pyver: "3.11.0-alpha - 3.11.0"
pyver: "3.12-dev"
Copy link

Choose a reason for hiding this comment

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

Suggested change
pyver: "3.12-dev"
pyver: "3.12"

experimental: false
no-extensions: 'Y'
- os: windows
pyver: "3.11.0-alpha - 3.11.0"
pyver: "3.12-dev"
Copy link

Choose a reason for hiding this comment

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

Suggested change
pyver: "3.12-dev"
pyver: "3.12"

@@ -0,0 +1 @@
Use cython 3.0.0b2, fixing Python 3.12 compatibility.
Copy link

Choose a reason for hiding this comment

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

Suggested change
Use cython 3.0.0b2, fixing Python 3.12 compatibility.
Use cython 3.0.0, fixing Python 3.12 compatibility.

@@ -1,3 +1,3 @@
-r multidict.txt
-r typing-extensions.txt # required for parsing aiohttp/hdrs.py by tools/gen.py
cython==0.29.32
cython==3.0.0b3
Copy link

Choose a reason for hiding this comment

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

This one is now stable: https://github.com/cython/cython/releases/tag/3.0.0

Suggested change
cython==3.0.0b3
cython==3.0.0

@cdce8p cdce8p mentioned this pull request Jul 19, 2023
32 tasks
@pquentin
Copy link
Author

Thanks for the review. However this was more a proof of concept and I have a lost interest since then. Feel free to reuse my pull request, it has the same license as the code itself.

Also thanks for the 3.12 tip, I shared it on Mastodon where it was well received: https://fosstodon.org/@quentinpradet/110748145154814131

@pquentin pquentin closed this Jul 24, 2023
@Dreamsorcerer
Copy link
Member

Dreamsorcerer commented Jul 25, 2023

I've updated and merged tests for 3.12. There are still a few issues to get it working though. If anybody would like to help getting the tests passing for 3.12, then we'll be able to include support in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.12: ‘PyLongObject’ {aka ‘struct _longobject’} has no member named ‘ob_digit’
3 participants