fixup 38 references

This commit is contained in:
Brad Warren 2024-11-25 11:24:11 -08:00
parent a6cfe00c2c
commit 661df681c8
10 changed files with 20 additions and 47 deletions

View file

@ -20,14 +20,11 @@ jobs:
linux-isolated:
TOXENV: 'isolated-acme,isolated-certbot,isolated-apache,isolated-cloudflare,isolated-digitalocean,isolated-dnsimple,isolated-dnsmadeeasy,isolated-gehirn,isolated-google,isolated-linode,isolated-luadns,isolated-nsone,isolated-ovh,isolated-rfc2136,isolated-route53,isolated-sakuracloud,isolated-nginx'
linux-integration-certbot-oldest:
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.9
TOXENV: integration-certbot-oldest
linux-integration-nginx-oldest:
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.9
TOXENV: integration-nginx-oldest
linux-py38-integration:
PYTHON_VERSION: 3.8
TOXENV: integration
linux-py39-integration:
PYTHON_VERSION: 3.9
TOXENV: integration

View file

@ -12,13 +12,13 @@ jobs:
PIP_USE_PEP517: "true"
linux-oldest:
IMAGE_NAME: ubuntu-22.04
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.9
TOXENV: oldest
linux-py38:
linux-py39:
# linux unit tests with the oldest python we support
IMAGE_NAME: ubuntu-22.04
PYTHON_VERSION: 3.8
TOXENV: py38
PYTHON_VERSION: 3.9
TOXENV: py39
linux-cover:
# linux unit+cover tests with the newest python we support
IMAGE_NAME: ubuntu-22.04

View file

@ -1,4 +1,4 @@
FROM docker.io/python:3.8-buster
FROM docker.io/python:3.11-buster
LABEL maintainer="Brad Warren <bmw@eff.org>"
# This does not include the dependencies needed to build cryptography. See

View file

@ -631,10 +631,6 @@ class ReadlinkTest(unittest.TestCase):
@unittest.skipIf(POSIX_MODE, reason='Tests specific to Windows')
@mock.patch("certbot.compat.filesystem.os.readlink")
def test_normal_path_windows(self, mock_readlink):
# Python <3.8
mock_readlink.return_value = "C:\\short\\path"
assert filesystem.readlink("dummy") == "C:\\short\\path"
# Python >=3.8 (os.readlink always returns the extended form)
mock_readlink.return_value = "\\\\?\\C:\\short\\path"
assert filesystem.readlink("dummy") == "C:\\short\\path"

View file

@ -218,7 +218,6 @@ class PostHookTest(HookTest):
assert not self._call_with_mock_execute(self.config, []).called
assert not self._get_eventually()
@unittest.skipIf(pyver_lt(3, 8), "Python 3.8+ required for this test.")
def test_renew_env(self):
self.config.verb = "certonly"
args = self._call_with_mock_execute(self.config, ["success.org"]).call_args
@ -308,7 +307,6 @@ class RunSavedPostHooksTest(HookTest):
mock_execute = self._call_with_mock_execute_and_eventually([], [])
mock_execute.assert_called_once_with("post-hook", self.eventually[0], env=mock.ANY)
@unittest.skipIf(pyver_lt(3, 8), "Python 3.8+ required for this test.")
def test_env(self):
self.eventually = ["foo"]
mock_execute = self._call_with_mock_execute_and_eventually(["success.org"], ["failed.org"])

View file

@ -5,11 +5,9 @@ from contextlib import contextmanager
import errno
import os # pylint: disable=os-module-forbidden
import stat
import sys
from typing import Any
from typing import Dict
from typing import Generator
from typing import List
from typing import Optional
try:
@ -370,27 +368,14 @@ def realpath(file_path: str) -> str:
"""
original_path = file_path
# Since Python 3.8, os.path.realpath also resolves symlinks on Windows.
if POSIX_MODE or sys.version_info >= (3, 8):
path = os.path.realpath(file_path)
if os.path.islink(path):
# If path returned by realpath is still a link, it means that it failed to
# resolve the symlink because of a loop.
# See realpath code: https://github.com/python/cpython/blob/master/Lib/posixpath.py
raise RuntimeError('Error, link {0} is a loop!'.format(original_path))
return path
inspected_paths: List[str] = []
while os.path.islink(file_path):
link_path = file_path
file_path = os.readlink(file_path)
if not os.path.isabs(file_path):
file_path = os.path.join(os.path.dirname(link_path), file_path)
if file_path in inspected_paths:
raise RuntimeError('Error, link {0} is a loop!'.format(original_path))
inspected_paths.append(file_path)
return os.path.abspath(file_path)
# os.path.realpath also resolves symlinks
path = os.path.realpath(file_path)
if os.path.islink(path):
# If path returned by realpath is still a link, it means that it failed to
# resolve the symlink because of a loop.
# See realpath code: https://github.com/python/cpython/blob/master/Lib/posixpath.py
raise RuntimeError('Error, link {0} is a loop!'.format(original_path))
return path
def readlink(link_path: str) -> str:
@ -404,12 +389,9 @@ def readlink(link_path: str) -> str:
"""
path = os.readlink(link_path)
if POSIX_MODE or not path.startswith('\\\\?\\'):
if POSIX_MODE:
return path
# At this point, we know we are on Windows and that the path returned uses
# the extended form which is done for all paths in Python 3.8+
# Max length of a normal path is 260 characters on Windows, including the non printable
# termination character "<NUL>". The termination character is not included in Python
# strings, giving a max length of 259 characters, + 4 characters for the extended form

View file

@ -6,7 +6,7 @@ authors = ["Certbot Project"]
license = "Apache License 2.0"
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
# workaround for: https://github.com/python-poetry/poetry-plugin-export/issues/183
urllib3 = ">=1.25.4,<1.27"

View file

@ -10,7 +10,7 @@ license = "Apache License 2.0"
[tool.poetry.dependencies]
# The Python version here should be kept in sync with the one used in our
# oldest tests in tox.ini.
python = "<3.9 >= 3.8"
python = "<3.10 >= 3.9"
# Local dependencies
# Any local packages that have dependencies on other local packages must be

View file

@ -117,7 +117,7 @@ def _check_version(version_str):
version = (int(search.group(1)), int(search.group(2)))
if version >= (3, 8):
if version >= (3, 9):
return True
print('Incompatible python version for Certbot found: {0}'.format(version_str))

View file

@ -63,7 +63,7 @@ commands = {[testenv:py]commands}
#
# This version should be kept in sync with the one declared in
# tools/pinning/oldest/pyproject.toml.
basepython = python3.8
basepython = python3.9
setenv = CERTBOT_OLDEST=1
commands = {[testenv:py]commands}