Uh oh!
There was an error while loading. Please reload this page.
Add python3.10 and fix test failures on python3.10 - #1628
Conversation
MVrachev
commented
Oct 20, 2021
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| # (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.
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 <mvrachev@vmware.com>
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 <mvrachev@vmware.com>
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.ymlhttps://github.com/python-pillow/Pillow/blob/main/.github/workflows/test-windows.ymlhttps://github.com/PyGithub/PyGithub/blob/master/.github/workflows/ci.yml Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
MVrachev
commented
Oct 21, 2021
@jku addressed your comments. |
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: