From 384f6f2574a083551f42eae88fb2d2cf64ca6f97 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Feb 2024 12:52:26 -0500 Subject: [PATCH 1/3] Create compat module. --- setuptools/compat/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 setuptools/compat/__init__.py diff --git a/setuptools/compat/__init__.py b/setuptools/compat/__init__.py new file mode 100644 index 0000000000..e69de29bb2 From c4156a94667220d1e3dc0b3a2b3763fb03cbad9f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Feb 2024 12:46:33 -0500 Subject: [PATCH 2/3] Move Python 3.10 compatibility into compat module. --- setuptools/{py311compat.py => compat/py310.py} | 0 setuptools/config/pyprojecttoml.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename setuptools/{py311compat.py => compat/py310.py} (100%) diff --git a/setuptools/py311compat.py b/setuptools/compat/py310.py similarity index 100% rename from setuptools/py311compat.py rename to setuptools/compat/py310.py diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index 321e106e40..9b9788eff4 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -29,7 +29,7 @@ def load_file(filepath: _Path) -> dict: - from ..py311compat import tomllib + from ..compat.py310 import tomllib with open(filepath, "rb") as file: return tomllib.load(file) From 5d6120a339a587dbfb4181288d28a7d477b4ed02 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 8 Feb 2024 12:48:52 -0500 Subject: [PATCH 3/3] Move Python 3.11 compatibility into compat module. --- setuptools/command/easy_install.py | 4 ++-- setuptools/{py312compat.py => compat/py311.py} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename setuptools/{py312compat.py => compat/py311.py} (100%) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 76b3adfb34..cc0c409123 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -74,7 +74,7 @@ DEVELOP_DIST, ) import pkg_resources -from .. import py312compat +from ..compat import py311 from .._path import ensure_directory from ..extern.jaraco.text import yield_lines @@ -2329,7 +2329,7 @@ def load_launcher_manifest(name): def _rmtree(path, ignore_errors=False, onexc=auto_chmod): - return py312compat.shutil_rmtree(path, ignore_errors, onexc) + return py311.shutil_rmtree(path, ignore_errors, onexc) def current_umask(): diff --git a/setuptools/py312compat.py b/setuptools/compat/py311.py similarity index 100% rename from setuptools/py312compat.py rename to setuptools/compat/py311.py