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

Add support for Python 3.10 #5927

Merged
merged 10 commits into from
Oct 8, 2021
Merged

Conversation

Hanaasagi
Copy link
Member

@Hanaasagi Hanaasagi commented Aug 2, 2021

What do these changes do?

Add Python 3.10 matrix in Github Action and fix something.

Are there changes in behavior for the user?

Related issue number

Related to #5905

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@Hanaasagi Hanaasagi requested a review from webknjaz as a code owner August 2, 2021 16:48
@codecov

This comment has been minimized.

@Hanaasagi Hanaasagi force-pushed the feat-Python3.10 branch 2 times, most recently from 350ae84 to 5d9a210 Compare August 2, 2021 17:28
@Hanaasagi Hanaasagi requested a review from asvetlov as a code owner August 2, 2021 17:28
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 2, 2021
@Hanaasagi
Copy link
Member Author

pycares is not ready for Python 3.10. See the action log https://github.com/aio-libs/aiohttp/pull/5927/checks?check_run_id=3223285551 and upstream issue saghul/pycares#134

@Dreamsorcerer
Copy link
Member

Indeed, we can fix the deprecation warnings in another PR in the meantime though.

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

webknjaz commented Oct 6, 2021

Hey @Hanaasagi,
@asvetlov and I want to produce a new release soon. Mind updating this PR?

@webknjaz webknjaz added this to the 3.8 milestone Oct 6, 2021
@Hanaasagi
Copy link
Member Author

I rebased the master branch. But I don't figure out why there are two failed test.

  • FAILED tests/test_proxy_functional.py::test_secure_https_proxy_absolute_path[pyloop-http]
  • FAILED tests/test_proxy_functional.py::test_secure_https_proxy_absolute_path[pyloop-https]
  • FAILED tests/test_proxy_functional.py::test_https_proxy_unsupported_tls_in_tls[pyloop-https]

Looks like they were introduced in PR #5992 .

About the changes

Dependency update

  1. pytest is supporting Python 3.10 since 6.2.5, see https://docs.pytest.org/en/6.2.x/changelog.html#pytest-6-2-5-2021-08-29 .
  2. six should be updated to 1.16.0, see https://github.com/benjaminp/six/blob/master/CHANGES
  3. setuptools should be updated to 56.0.0 or above, see https://setuptools.pypa.io/en/latest/history.html.

Fixing warnings

  1. ssl.PROTOCOL_SSLv23 is deprecated since 3.6, and ssl.PROTOCOL_TLS is deprecated since 3.10. See https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLS.
  2. asyncio.get_event_loop() will emit deprecation warning, if there is no running event loop, See: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop

@webknjaz
Copy link
Member

webknjaz commented Oct 6, 2021

I rebased the master branch. But I don't figure out why there are two failed test.

  • FAILED tests/test_proxy_functional.py::test_secure_https_proxy_absolute_path[pyloop-http]
  • FAILED tests/test_proxy_functional.py::test_secure_https_proxy_absolute_path[pyloop-https]
  • FAILED tests/test_proxy_functional.py::test_https_proxy_unsupported_tls_in_tls[pyloop-https]

Looks like they were introduced in PR #5992 .

Yep. And they weren't tested against Python 3.10. Here's what's happening in the CI:

E           ConnectionAbortedError: SSL handshake is taking longer than 60.0 seconds: aborting the connection

I wonder if this is caused by proxy.py not supporting Python 3.10 or something on our side... Any ideas? I think it may be okay to temporarily mark the specific test cases with xfail under the affected envs if it helps get this PR green.

CHANGES/5927.feature Outdated Show resolved Hide resolved
@Hanaasagi
Copy link
Member Author

The secure proxy related test will be passed in 3.10, macos, but failed in other os platform. I marked them with xfail.

@Hanaasagi Hanaasagi changed the title [WIP] Add support for Python 3.10 experimental builds Add support for Python 3.10 Oct 7, 2021
@webknjaz webknjaz merged commit 84babeb into aio-libs:master Oct 8, 2021
@patchback
Copy link
Contributor

patchback bot commented Oct 8, 2021

Backport to 3.8: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 84babeb on top of patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927

Backporting merged PR #5927 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927 upstream/3.8
  4. Now, cherry-pick PR Add support for Python 3.10 #5927 contents into that branch:
    $ git cherry-pick -x 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4
    If it'll yell at you with something like fatal: Commit 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add support for Python 3.10 #5927 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@aio-libs-github-bot
Copy link
Contributor

💔 Backport was not successful

The PR was attempted backported to the following branches:

  • ❌ 3.8: Commit could not be cherrypicked due to conflicts

@patchback
Copy link
Contributor

patchback bot commented Oct 12, 2021

Backport to 3.8: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 84babeb on top of patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927

Backporting merged PR #5927 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927 upstream/3.8
  4. Now, cherry-pick PR Add support for Python 3.10 #5927 contents into that branch:
    $ git cherry-pick -x 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4
    If it'll yell at you with something like fatal: Commit 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add support for Python 3.10 #5927 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.8/84babebc96e08f1ea2b7c31406eb5a1ed20cd5c4/pr-5927
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

webknjaz pushed a commit to webknjaz/aiohttp that referenced this pull request Oct 12, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit 84babeb)
asvetlov pushed a commit that referenced this pull request Oct 16, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit 84babeb)

Co-authored-by: 秋葉 <[email protected]>
@Dreamsorcerer
Copy link
Member

@Hanaasagi Do you think it's worth readding the experimental matrix back in for 3.11? I see there is already an alpha release available, so would be good to have an early warning of any issues this time. https://github.com/actions/python-versions/releases

@asvetlov
Copy link
Member

asvetlov commented Oct 26, 2021

IFAIK cython for py3.11 is broken; we just cannot compile aiohttp extensions.

@Dreamsorcerer
Copy link
Member

If it's just cython though, then we would still get something useful from the no_extensions tests. We can also just leave the cython tests in, so they should start running successfully at some point in the future.

@webknjaz
Copy link
Member

@Dreamsorcerer feel free to add a limited matrix extension to cover this but we probably don't need it for the v3.8 release so it can wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR bug infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants