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

Run Python 3.13 CI tests #12620

Merged
merged 7 commits into from
Apr 30, 2024
Merged

Conversation

notatallshaw
Copy link
Member

Run Python 3.13 in CI tests.

Running locally I found two issues:

  1. Waiting on a freezegun release to fix this issue: Only call uuid._load_system_functions() if it exists. spulec/freezegun#534
  2. Waiting on a CFFI release for cryptography to test/work: Does cryptography support Python 3.13 currently? pyca/cryptography#10806

May be further issues trying to run on GitHub runners, only one way to find out!

@notatallshaw
Copy link
Member Author

notatallshaw commented Apr 13, 2024

Weirdly the Windows runner gave the error:

  Version 3.13 was not found in the local cache
  Error: The version '3.13' with architecture 'x64' was not found for Windows 2022.
  The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Maybe I somehow have to force clear cache, as when I go to the manifest I do see Python 3.13 available for Windows x64. I will try and figure it out.

Good news though is "tests / 3.13 / Ubuntu" completed it's unit tests: https://github.com/pypa/pip/actions/runs/8669773996/job/23776982113?pr=12620#logs and produced no new errors that I don't see locally.

@notatallshaw
Copy link
Member Author

cffi doesn't plan on doing a prerelease until at least 3.13 beta: python-cffi/cffi#23 (comment)

I might take a look to see if it's possible to do some kind of workaround, but seems unlikely.

@hugovk
Copy link
Contributor

hugovk commented Apr 13, 2024

Weirdly the Windows runner gave the error:

  Version 3.13 was not found in the local cache
  Error: The version '3.13' with architecture 'x64' was not found for Windows 2022.
  The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Maybe I somehow have to force clear cache, as when I go to the manifest I do see Python 3.13 available for Windows x64. I will try and figure it out.

Remember to add allow-prereleases: true for Windows. It's already there for Ubuntu and macOS.

@notatallshaw
Copy link
Member Author

Remember to add allow-prereleases: true for Windows. It's already there for Ubuntu and macOS.

Thanks! Not sure I would have found that config option.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@notatallshaw
Copy link
Member Author

I've successfully passed the Python 3.13 tests locally on Linux by sourcing cffi and freezefun from their github source for Python 3.13 only. Fortunately they are both only runtime dependencies, I was worried cffi was going to be a build time dependency for cryptography and this workaround would be much more difficult.

I'm going to mark this ready for review, I'm not sure if pip maintainers will want to wait for cffi and freezegun to do releases or not, I feel this isn't a big issue as it's only for Python 3.13 tests, but otherwise I can just keep rebasing this PR until they release.

@notatallshaw notatallshaw marked this pull request as ready for review April 14, 2024 18:34
@notatallshaw
Copy link
Member Author

Looks like 1 actual test failure for Windows, I will investigate once I get a chance

@notatallshaw
Copy link
Member Author

notatallshaw commented Apr 17, 2024

Found the issue with "test_subdirectory_fragment" fail on Windows in Python 3.13 there is a change in behavior for os.path.isabs when it's a Unix style directory.

Python 3.12:

>>> os.path.isabs('/tmp/.foo/')
True

Python 3.13:

>>> os.path.isabs('/tmp/.foo/')
False

This change in behavior is intentional: python/cpython#44626

The failing test hard codes the temporary directory, causing this assert to trigger https://github.com/pypa/pip/blob/24.0/src/pip/_internal/cache.py#L40. So the fix is easy, don't hard code the temporary directory in this test.

@notatallshaw
Copy link
Member Author

This has revealed "test_install_package_with_target" is failing on Windows, I will try and take a look at that soon.

@notatallshaw
Copy link
Member Author

notatallshaw commented Apr 19, 2024

I couldn't reproduce "test_install_package_with_target" test failure locally so I tried rebasing and pushing and now all tests have passed, not sure what to make of that, but Python 3.13 is now ready for CI runs.

tests/unit/test_cache.py Outdated Show resolved Hide resolved
@notatallshaw
Copy link
Member Author

notatallshaw commented Apr 25, 2024

Freezegun released, so removed sourcing it from github.

macOS tests are failing because of github's move to macOS 14, I have two alternative PRs to fix that: #12617 and #12593

@notatallshaw
Copy link
Member Author

Merged with main, now macOS is no longer failing

@uranusjr uranusjr merged commit 9ef0fdf into pypa:main Apr 30, 2024
28 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants