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 support for Python 3.12 #877

Merged
merged 2 commits into from
Dec 27, 2023
Merged

Add support for Python 3.12 #877

merged 2 commits into from
Dec 27, 2023

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Aug 30, 2023

What do these changes do?

The Python 3.12 release candidate is out! 🚀

Call to action

We strongly encourage maintainers of third-party Python projects to prepare their projects for 3.12 compatibilities during this phase, and where necessary publish Python 3.12 wheels on PyPI to be ready for the final release of 3.12.0.

See also https://dev.to/hugovk/help-test-python-312-beta-1508/

Are there changes in behavior for the user?

No.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 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 Aug 30, 2023
@hugovk
Copy link
Contributor Author

hugovk commented Aug 30, 2023

This will fail with a segmentation fault (https://github.com/hugovk/multidict/actions/runs/6028022143), already reported at #862.

And it will be fixed by #864.

To demonstrate, here's a branch (https://github.com/hugovk/multidict/tree/add-3.12b) with both this PR and that PR's commits which passes (https://github.com/hugovk/multidict/actions/runs/6029781394).

@h-vetinari
Copy link

Compiling 6.0.4 + #864 with clang >=15 errors due to using NULL (which has type void *) to initialize an integer.

  multidict/_multidict.c:458:37: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
      static _PyArg_Parser _parser = {NULL, _keywords, "getall", 0};
                                      ^~~~
  /Users/runner/miniforge3/conda-bld/multidict_1696714043821/_build_env/lib/clang/15.0.7/include/stddef.h:89:16: note: expanded from macro 'NULL'
  #  define NULL ((void*)0)
                 ^~~~~~~~~~

@guidopetri
Copy link

@asvetlov @webknjaz any ETA on this being merged in + released?

@davepeck
Copy link

davepeck commented Nov 15, 2023

@h-vetinari

Compiling 6.0.4 + #864 with clang >=15 errors due to using NULL (which has type void *) to initialize an integer.

I run into this too on my Mac with clang version 17.0.4 and when using python 3.12.

Since so many packages transitively depend on multidict under the hood (openai and litestar, to name just two examples), I've taken to temporarily invoking pip install with:

CFLAGS="-Wno-error=int-conversion" pip install ...

It ain't pretty; I have no intention of doing this in production; I'll probably regret it even for my local dev projects. But there you have it.

@robd003
Copy link

robd003 commented Dec 7, 2023

@asvetlov can we get some 👀 on this?

Python 3.12 has been available for over 2 months now

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (780a1e1) 93.65% compared to head (b3c777f) 93.65%.

❗ Current head b3c777f differs from pull request most recent head 92c7881. Consider uploading reports for the commit 92c7881 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #877   +/-   ##
=======================================
  Coverage   93.65%   93.65%           
=======================================
  Files           5        5           
  Lines         504      504           
=======================================
  Hits          472      472           
  Misses         32       32           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This patch also adds a Python 3.12 Trove classifier to the
distribution package metadata.
@webknjaz webknjaz merged commit e40d3b3 into aio-libs:master Dec 27, 2023
35 of 37 checks passed
@hugovk hugovk deleted the add-3.12 branch December 27, 2023 05:09
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.

6 participants