-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Test Python 3.10 support #10164
Test Python 3.10 support #10164
Conversation
/cc @hugovk, since they had looked into this earlier? |
Ok, cool. So, our tests can be run like this. Now, who wants to actually fix the two failures? :) |
test_pip_works_with_warnings_as_errors just seems to be assertion errors on the distutils deprecation from within I'm not sure what's going on in test_correct_pip_version, obviously the regex didn't match, but it didn't capture what |
Oh duh, the regex at Line 48 in 3301426
[\d]+ )
|
I guess in the past python only got to 1.6 and 2.7, so 3.10 it's the first time that's ever happened in the major or minor :-) |
Okay, those seem easy and my Internet provider has restored the connection now. |
Pinning And the beta should be pretty stable, and if not, we probably want to know about it sooner to report upstream. |
Tip: run https://github.com/asottile/flake8-2020 to find other possible problems introduced by the first-ever two-digit minor version. I think pip is good, worth a quick check again. |
IIRC someone already did that on the main code base a while ago, back when 3.10 was first confirmed to going to happen. |
IIRC Anthony did that for pip when he wrote flake8-2020. |
x-ref #8273 since that is still the main annoying part. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleted (meant to comment on the relevant line)
Maybe we could do |
The problem isn't virtualenv -- there's only one failure |
Hmm, how is ensurepip in cpython core passing the 3.10 test suite in that case? That test was, I believe, specifically added because the CPython test suite runs with warnings as errors... |
🤷 Well, I think I wanna skip it for this initial round of adding 3.10 testing -- if this is indeed a problem for CPython, we'd catch it there. If not, well, the users who see this on 3.10 can adapt -- they're doing a migration/upgrade already. |
a86e819
to
64ae61c
Compare
This is necessary since Python 3.10 has two digits in the minor version.
There is no clean way, that we know of so far, for fixing this on 3.10+.
I don’t know why, but apparently $ virtualenv --python python3.10 --no-pip ./x
...
$ ./x/bin/python -c 'import distutils' # Triggers a warning as expected
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
$ ./x/bin/python -m ensurepip # No warnings!
Looking in links: /tmp/tmpymqbilj5
Requirement already satisfied: setuptools in ./x/lib/python3.10/site-packages (57.0.0)
Processing /tmp/tmpymqbilj5/pip-21.1.3-py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-21.1.3
$ ./x/bin/python -m pip install -U pip # Also no warnings!
Requirement already satisfied: pip in ./x/lib/python3.10/site-packages (21.1.3)
Collecting pip
Using cached pip-21.2.3-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.3
Uninstalling pip-21.1.3:
Successfully uninstalled pip-21.1.3
Successfully installed pip-21.2.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs to be fixed #10164 (comment)
https://github.com/python/cpython/blob/main/Lib/ensurepip/__init__.py#L92 |
Co-authored-by: Kevin Puetz <[email protected]>
@pytest.mark.skipif( | ||
sys.version_info >= (3, 10), | ||
reason="distutils is deprecated in 3.10+" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was only added because the CPython test suite failed when packaging raised a deprecation warning (for legacy versions, IIRC). As ensurepip now forcibly silences deprecation warnings as part of the distutils removal, we could probably just drop this (after all, I don't think we should guarantee that pip runs warning-free as a general matter).
But it's no big deal either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna remove in a follow up. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version regex looks good to me now.
We're still gonna be on the legacy branch of virtualenv, but hopefully this helps us move forward soon.