-
Notifications
You must be signed in to change notification settings - Fork 275
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 python3.10 and fix test failures on python3.10 #1628
Conversation
I test locally and found that when you have Python 3.10 installed locally, then both 310 and 3.10 work when defining the new Python version in the |
Pull Request Test Coverage Report for Build 1367701446Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
8e81baf
to
15b276d
Compare
@@ -15,7 +15,7 @@ jobs: | |||
# Run regular TUF tests on each OS/Python combination, plus special tests | |||
# (sslib master) and linters on Linux/Python3.x only. | |||
matrix: | |||
python-version: [3.6, 3.7, 3.8, 3.9] | |||
python-version: ["3.6", "3.7", "3.8", "3.9", "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.
Format with untyped values bites developer, part 9000 😭
I wonder how many people will independently fix this exact issue in the next year
When I tried adding support for Python3.10 we had CI errors due to test failures: https://github.com/theupdateframework/python-tuf/pull/1610/checks?check_run_id=3861875325 The problem comes from the fact that we start a subprocess executing simple_https_server.py, but then we fail to communicate the message we expect from the server process to the main process actually running the test. We expect our custom message to be the first line printed from the server process, but instead, a deprecation warning is printed first about the usage of ssl.wrap_socket(). Our custom message is printed second. As of Python 3.7 this function has been deprecated: https://docs.python.org/3/library/ssl.html#ssl.wrap_socket and for whatever the reason we didn't get a warning when using it before. My fix does what is suggested in the warning and replaces the usage of ssl.wrap_socket() by instantiating a ssl.SSLContext object and then calling SSLContext.wrap_socket(). This removes the warning. Signed-off-by: Martin Vrachev <[email protected]>
15b276d
to
e5005f3
Compare
Python 3.10 is released on October 4-th 2021 and it seems logical to add support for it as it doesn't require any major effort from the project. For reference read: https://www.python.org/downloads/release/python-3100/ Signed-off-by: Martin Vrachev <[email protected]>
Fix GitHub workflow failures by using quotes for python versions. It seems that adding `3.10` as a number is transformed then to `3.1` which as a result is translated to Python version 3.1 instead of Python version 3.10. This seems to work for other projects as well: https://github.com/MasoniteFramework/masonite4/blob/master/.github/workflows/pythontest.yml https://github.com/python-pillow/Pillow/blob/main/.github/workflows/test-windows.yml https://github.com/PyGithub/PyGithub/blob/master/.github/workflows/ci.yml Signed-off-by: Martin Vrachev <[email protected]>
e5005f3
to
2e94e39
Compare
@jku addressed your comments. |
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.
Thank you
Fixes #1614
Description of the changes being introduced by the pull request:
Python 3.10 is released on October 4-th 2021 and it seems
logical to add support for it as it doesn't require any major effort
from the project.
For reference read:
https://www.python.org/downloads/release/python-3100/
I tried adding support for Python3.10 in #1610.
Then, we had CI errors due to test failures: https://github.com/theupdateframework/python-tuf/pull/1610/checks?check_run_id=3861875325
The problem comes from the fact that we start a subprocess
executing simple_https_server.py, but then we fail to communicate the
message we expect from the server process to the main process actually
running the test. We expect our custom message to be the first line
printed from the server process, but instead, a deprecation warning is
printed first about the usage of ssl.wrap_socket(). Our custom message
is printed second.
As of Python 3.7 this function has been deprecated:
https://docs.python.org/3/library/ssl.html#ssl.wrap_socket and for
whatever the reason we didn't get a warning when using it before.
My fix does what is suggested in the warning and replaces the usage of
ssl.wrap_socket() by instantiating a ssl.SSLContext object and then
calling SSLContext.wrap_socket().
This removes the warning.
Please verify and check that the pull request fulfills the following
requirements: