diff options
author | Brad Warren <bmw@users.noreply.github.com> | 2021-11-09 02:55:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 02:55:32 +0300 |
commit | e8265dbf9c3aad879d2bcae0e95e71ba9facd8ce (patch) | |
tree | ef7c5e5527fdb50454a048ca3fd87b49105c2736 /certbot-apache | |
parent | b1edda8a65cc9d9d143ec67f4d79aafc04670793 (diff) |
Add Python 3.10 support and tests (#9077)
Fixes https://github.com/certbot/certbot/issues/9058.
The changes to the CI config are equivalent to the ones made in https://github.com/certbot/certbot/pull/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](https://setuptools.pypa.io/en/latest/pkg_resources.html#parsing-utilities) from `setuptools`. This functionality has been available since [setuptools 8.0 from 2014](https://setuptools.pypa.io/en/latest/history.html#id865).
* 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.
* add python 3.10 support
* make some version changes
* don't use looseversion in setup.py
* switch to pkg_resources
* deprecate get_strict_version
* fix route53 tests
* remove unused CERTBOT_PIP_NO_BINARY code
* stop using distutils in letstest
* add unit tests
* more changelog entries
Diffstat (limited to 'certbot-apache')
-rw-r--r-- | certbot-apache/certbot_apache/_internal/configurator.py | 4 | ||||
-rw-r--r-- | certbot-apache/certbot_apache/_internal/entrypoint.py | 5 | ||||
-rw-r--r-- | certbot-apache/setup.py | 1 |
3 files changed, 5 insertions, 5 deletions
diff --git a/certbot-apache/certbot_apache/_internal/configurator.py b/certbot-apache/certbot_apache/_internal/configurator.py index c54afb4d9..cf4019ef3 100644 --- a/certbot-apache/certbot_apache/_internal/configurator.py +++ b/certbot-apache/certbot_apache/_internal/configurator.py @@ -2,7 +2,6 @@ # pylint: disable=too-many-lines from collections import defaultdict import copy -from distutils.version import LooseVersion import fnmatch import logging import re @@ -154,9 +153,10 @@ class ApacheConfigurator(common.Installer, interfaces.Authenticator): """ # Disabling TLS session tickets is supported by Apache 2.4.11+ and OpenSSL 1.0.2l+. # So for old versions of Apache we pick a configuration without this option. + min_openssl_version = util.parse_loose_version('1.0.2l') openssl_version = self.openssl_version(warn_on_no_mod_ssl) if self.version < (2, 4, 11) or not openssl_version or\ - LooseVersion(openssl_version) < LooseVersion('1.0.2l'): + util.parse_loose_version(openssl_version) < min_openssl_version: return apache_util.find_ssl_apache_conf("old") return apache_util.find_ssl_apache_conf("current") diff --git a/certbot-apache/certbot_apache/_internal/entrypoint.py b/certbot-apache/certbot_apache/_internal/entrypoint.py index 96bef030c..4311b11c6 100644 --- a/certbot-apache/certbot_apache/_internal/entrypoint.py +++ b/certbot-apache/certbot_apache/_internal/entrypoint.py @@ -1,6 +1,4 @@ """ Entry point for Apache Plugin """ -from distutils.version import LooseVersion - from certbot import util from certbot_apache._internal import configurator from certbot_apache._internal import override_arch @@ -47,7 +45,8 @@ def get_configurator(): override_class = None # Special case for older Fedora versions - if os_name == 'fedora' and LooseVersion(os_version) < LooseVersion('29'): + min_version = util.parse_loose_version('29') + if os_name == 'fedora' and util.parse_loose_version(os_version) < min_version: os_name = 'fedora_old' try: diff --git a/certbot-apache/setup.py b/certbot-apache/setup.py index 5386cecf6..caaa0e2ea 100644 --- a/certbot-apache/setup.py +++ b/certbot-apache/setup.py @@ -38,6 +38,7 @@ setup( 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Security', 'Topic :: System :: Installation/Setup', |