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

Build Python 3.13 wheels (not free-threaded) #711

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

edgarrmondragon
Copy link

@edgarrmondragon edgarrmondragon commented Jul 13, 2024

I can close this if #703 gets more attention, but I've confirmed changes here allow the wheels to be built in 3.8-3.13, and all tests are passing.

This warning is currently raised, but fixing it might be beyond the scope of this PR:

PytestUnraisableExceptionWarning: Exception ignored in PyDict_GetItem(); consider using PyDict_GetItemRef() or PyDict_GetItemWithError(): None

python/cpython#106004

Copy link
Author

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

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

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@@ -127,6 +127,7 @@ def get_class_annotations(obj):
value = type(None)
elif isinstance(value, str):
value = _forward_ref(value)
# TODO: Pass `type_params` to `_eval_type` to fix deprecation warning
Copy link
Author

@edgarrmondragon edgarrmondragon Jul 13, 2024

Choose a reason for hiding this comment

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

This missing parameter is causing a ton of warnings like this:

msgspec/_utils.py:130: DeprecationWarning: Failing to pass a value to the 'type_params' parameter of 'typing._eval_type' is deprecated, as it leads to incorrect behaviour when calling typing._eval_type on a stringified annotation that references a PEP 695 type parameter. It will be disallowed in Python 3.15.

python/cpython#118418

@edgarrmondragon edgarrmondragon marked this pull request as ready for review July 13, 2024 07:08
@edgarrmondragon
Copy link
Author

edgarrmondragon commented Jul 13, 2024

This warning is currently raised but fixing it might be beyond the scope of this PR to fix it:

PytestUnraisableExceptionWarning: Exception ignored in PyDict_GetItem(); consider using PyDict_GetItemRef() or PyDict_GetItemWithError(): None

FWIW I think this is hiding an actual error:

PytestUnraisableExceptionWarning: Exception ignored in PyDict_GetItem(); consider using PyDict_GetItemRef() or PyDict_GetItemWithError(): None
    
    Traceback (most recent call last):
      File "/opt/_internal/cpython-3.13.0b3/lib/python3.13/typing.py", line 2251, in __hash__
        return hash((self.__origin__, self.__metadata__))
    TypeError: unhashable type: 'set'
    
      warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

in

def test_inspect_with_unhashable_metadata():
typ = Annotated[int, {"unhashable"}]
assert mi.type_info(typ) == mi.IntType()

@@ -99,10 +100,11 @@ jobs:
- name: Set up Environment
if: github.event_name != 'release'
run: |
echo "CIBW_SKIP=${CIBW_SKIP} *-musllinux_* cp38-*_aarch64 cp39-*_aarch64 cp311-*_aarch64 cp312-*_aarch64" >> $GITHUB_ENV
echo "CIBW_BUILD=${CIBW_BUILD} cp313-*" >> $GITHUB_ENV
Copy link
Author

Choose a reason for hiding this comment

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

For the moment 3.13 wheels will only be built for non-release workflows.

Copy link
Author

Choose a reason for hiding this comment

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

☝️ Outdated with the release of Python 3.13.0rc1 since we want to start publishing cp313-* wheels now.

@edgarrmondragon
Copy link
Author

macos-11 runners aren't available anymore, so I updated it to macos-14 in 748f4bb.

https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/#macos-11-deprecation-and-removal

@edgarrmondragon
Copy link
Author

macos-11 runners aren't available anymore, so I updated it to macos-14 in 748f4bb.

https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/#macos-11-deprecation-and-removal

With that change, the wheels are finally built instead of the workflow getting stuck forever:

 12 wheels produced in 5 minutes:
  msgspec-0+untagged.1.g766a8f7-cp310-cp310-macosx_10_9_x86_64.whl    186 kB
  msgspec-0+untagged.1.g766a8f7-cp310-cp310-macosx_11_0_arm64.whl     180 kB
  msgspec-0+untagged.1.g766a8f7-cp311-cp311-macosx_10_9_x86_64.whl    184 kB
  msgspec-0+untagged.1.g766a8f7-cp311-cp311-macosx_11_0_arm64.whl     178 kB
  msgspec-0+untagged.1.g766a8f7-cp312-cp312-macosx_10_9_x86_64.whl    186 kB
  msgspec-0+untagged.1.g766a8f7-cp312-cp312-macosx_11_0_arm64.whl     180 kB
  msgspec-0+untagged.1.g766a8f7-cp313-cp313-macosx_10_13_x86_64.whl   186 kB
  msgspec-0+untagged.1.g766a8f7-cp313-cp313-macosx_11_0_arm64.whl     180 kB
  msgspec-0+untagged.1.g766a8f7-cp38-cp38-macosx_10_9_x86_64.whl      186 kB
  msgspec-0+untagged.1.g766a8f7-cp38-cp38-macosx_11_0_arm64.whl       180 kB
  msgspec-0+untagged.1.g766a8f7-cp39-cp39-macosx_10_9_x86_64.whl      186 kB
  msgspec-0+untagged.1.g766a8f7-cp39-cp39-macosx_11_0_arm64.whl       180 kB

https://github.com/edgarrmondragon/msgspec/actions/runs/10030128227/job/27719084757

@tacaswell
Copy link

I can also get msgspec to build with py313 with this branch, but not the branch in #703

@edgarrmondragon
Copy link
Author

@jcrist This is ready for review at your convenience :)

@edgarrmondragon edgarrmondragon mentioned this pull request Aug 6, 2024
@edgarrmondragon
Copy link
Author

Updated to use Python 3.13.0rc1

@edgarrmondragon
Copy link
Author

Updated to use Python 3.13.0rc2

@ofek
Copy link

ofek commented Sep 18, 2024

@jcrist Can you please run the CI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants