Skip to content

Add Python 3.10 support and tests#9077

Merged
bmw merged 15 commits intomasterfrom
py310
Nov 8, 2021
Merged

Add Python 3.10 support and tests#9077
bmw merged 15 commits intomasterfrom
py310

Conversation

@bmw
Copy link
Copy Markdown
Member

@bmw bmw commented Nov 2, 2021

Fixes #9058.

The changes to the CI config are equivalent to the ones made in #8460.

Other than ignoring some warnings raised by botocore, the main additional work that had to be done here was switching away from using distutils.version.LooseVersion since the entire distutils module was deprecated in Python 3.10. To do that, I took a few different approaches:

  • If the version strings being parsed are from Python packages such as Certbot or setuptools, I switched to using pkg_resources.parse_version from setuptools. This functionality has been available since setuptools 8.0 from 2014.
  • If the version strings being parsed are not from Python packages, I added code equivalent to distutils.version.LooseVersion in certbot.util.parse_loose_version.
  • The code for CERTBOT_PIP_NO_BINARY can be completely removed since that variable isn't used or referenced anywhere in this repo.

You can see the full test suite passing on these changes at https://dev.azure.com/certbot/certbot/_build/results?buildId=4645&view=results.

Unless this happens to land in the next few hours which I do not at all expect, the changelog will need to be updated after the release tomorrow.

alexzorin
alexzorin previously approved these changes Nov 2, 2021
Copy link
Copy Markdown
Collaborator

@alexzorin alexzorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gather that PEP440 parsing would be unsuitable for our other purposes (OpenSSL and Fedora version parsing)?

LGTM if so.

@bmw
Copy link
Copy Markdown
Member Author

bmw commented Nov 4, 2021

PEP440 parsing is definitely not suitable for things like OpenSSL. OpenSSL's versioning scheme is described here and strings like 1.0.2l which is a minimum OpenSSL version we check for isn't a valid PEP440 version according to https://www.python.org/dev/peps/pep-0440/#public-version-identifiers.

We could maybe use PEP440 parsing for things like Apache and Fedora depending on the details of their versioning scheme, but since the previous approach was working, we need something like parse_loose_version for OpenSSL anyway, and PEP440 is specifically designed for Python package versioning, I'd personally rather just use parse_loose_version on non-Python version strings.

Copy link
Copy Markdown
Collaborator

@adferrand adferrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two commits that dismissed @alexzorin's review represent just a technical merge from master, so I assume it is still good to go!

@bmw bmw merged commit e8265db into master Nov 8, 2021
@bmw bmw deleted the py310 branch November 8, 2021 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests against Python 3.10 and claim support for it in our packages

3 participants