From 7a34047999ffcc40fd791add66b3b571314da413 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 1 Oct 2023 15:12:51 -0400 Subject: [PATCH 1/6] Re-export `distutils.dep_util` in `setuptools.dep_util` --- docs/deprecated/distutils-legacy.rst | 2 ++ setuptools/dep_util.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/deprecated/distutils-legacy.rst b/docs/deprecated/distutils-legacy.rst index 8112f12eae..85bda3d88a 100644 --- a/docs/deprecated/distutils-legacy.rst +++ b/docs/deprecated/distutils-legacy.rst @@ -28,6 +28,8 @@ As Distutils is deprecated, any usage of functions or objects from distutils is ``distutils.command.{build_clib,build_ext,build_py,sdist}`` → ``setuptools.command.*`` +``distutils.dep_util`` → ``setuptools.dep_util`` + ``distutils.log`` → :mod:`logging` (standard library) ``distutils.version.*`` → :doc:`packaging.version.* ` diff --git a/setuptools/dep_util.py b/setuptools/dep_util.py index dc9ccf62c2..79597c75f0 100644 --- a/setuptools/dep_util.py +++ b/setuptools/dep_util.py @@ -1,4 +1,8 @@ -from distutils.dep_util import newer_group +from distutils.dep_util import ( + newer as newer, + newer_pairwise as newer_pairwise, + newer_group as newer_group, +) # yes, this is was almost entirely copy-pasted from From 9a8a0b271260ec06a76b57e22f1da0d088310390 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 1 Oct 2023 15:33:11 -0400 Subject: [PATCH 2/6] Added towncrier file --- newsfragments/4069.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4069.feature.rst diff --git a/newsfragments/4069.feature.rst b/newsfragments/4069.feature.rst new file mode 100644 index 0000000000..786861e5c6 --- /dev/null +++ b/newsfragments/4069.feature.rst @@ -0,0 +1 @@ +Exported `distutils.dep_util` through `setuptools.dep_util` -- by :user:`github-username` From 3a3413ec3defb035b503f87a5139bd3775f1ffd7 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 1 Oct 2023 15:33:11 -0400 Subject: [PATCH 3/6] Added towncrier file --- newsfragments/4069.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/4069.feature.rst diff --git a/newsfragments/4069.feature.rst b/newsfragments/4069.feature.rst new file mode 100644 index 0000000000..831e2c0df4 --- /dev/null +++ b/newsfragments/4069.feature.rst @@ -0,0 +1 @@ +Exported `distutils.dep_util` through `setuptools.dep_util` -- by :user:`Avasam` From 9e4a18f1eb0a1518635c8bf99e898250ea33992c Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 13 Oct 2023 14:04:24 -0400 Subject: [PATCH 4/6] Update newsfragments/4069.feature.rst --- newsfragments/4069.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newsfragments/4069.feature.rst b/newsfragments/4069.feature.rst index 831e2c0df4..d2b79a0c85 100644 --- a/newsfragments/4069.feature.rst +++ b/newsfragments/4069.feature.rst @@ -1 +1 @@ -Exported `distutils.dep_util` through `setuptools.dep_util` -- by :user:`Avasam` +Exported `distutils.dep_util` through ``setuptools.dep_util`` -- by :user:`Avasam` From 8d47bb44c6a217507c0ae037713e1536efbbc4d0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 8 Nov 2023 09:21:35 -0500 Subject: [PATCH 5/6] Use 'setuptools.modified' as the consolidated module for modified file functions. --- docs/deprecated/distutils-legacy.rst | 2 +- newsfragments/4069.feature.rst | 2 +- setuptools/modified.py | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 setuptools/modified.py diff --git a/docs/deprecated/distutils-legacy.rst b/docs/deprecated/distutils-legacy.rst index 85bda3d88a..166fcd584a 100644 --- a/docs/deprecated/distutils-legacy.rst +++ b/docs/deprecated/distutils-legacy.rst @@ -28,7 +28,7 @@ As Distutils is deprecated, any usage of functions or objects from distutils is ``distutils.command.{build_clib,build_ext,build_py,sdist}`` → ``setuptools.command.*`` -``distutils.dep_util`` → ``setuptools.dep_util`` +``distutils.dep_util`` → ``setuptools.modified`` ``distutils.log`` → :mod:`logging` (standard library) diff --git a/newsfragments/4069.feature.rst b/newsfragments/4069.feature.rst index d2b79a0c85..64a0af5d41 100644 --- a/newsfragments/4069.feature.rst +++ b/newsfragments/4069.feature.rst @@ -1 +1 @@ -Exported `distutils.dep_util` through ``setuptools.dep_util`` -- by :user:`Avasam` +Exported ``distutils.dep_util`` and ``setuptools.dep_util`` through ``setuptools.modified`` -- by :user:`Avasam` diff --git a/setuptools/modified.py b/setuptools/modified.py new file mode 100644 index 0000000000..af6ceeac89 --- /dev/null +++ b/setuptools/modified.py @@ -0,0 +1,8 @@ +from ._distutils._modified import ( + newer, + newer_pairwise, + newer_group, + newer_pairwise_group, +) + +__all__ = ['newer', 'newer_pairwise', 'newer_group', 'newer_pairwise_group'] From 546e5b838a3972c3ad0671522f29f792e9278fe1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 19 Nov 2023 11:26:41 -0500 Subject: [PATCH 6/6] Exclude setuptools.modified from test collection to avoid early import. --- conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conftest.py b/conftest.py index 94d5cdd8b5..8dcf7e6805 100644 --- a/conftest.py +++ b/conftest.py @@ -37,6 +37,7 @@ def pytest_configure(config): 'setuptools/_vendor', 'pkg_resources/_vendor', 'setuptools/config/_validate_pyproject', + 'setuptools/modified.py', ]