Skip to content

[3.13] Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) (#132926)" #133004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 26, 2025

This reverts commit 3776ade.

setuptools.modified module is not available on old setuptools versions.

…precation (pythonGH-132923) (python#132926)"

This reverts commit 3776ade.

setuptools.modified module is not available on old setuptools
versions.
@vstinner
Copy link
Member Author

Python 3.13 uses setuptools-67.6.1 which doesn't have setuptools.modified module yet :-(

@vstinner vstinner changed the title Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) (#132926)" [3.13] Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) (#132926)" Apr 26, 2025
@vstinner vstinner enabled auto-merge (squash) April 26, 2025 12:31
@vstinner vstinner merged commit 994529d into python:3.13 Apr 26, 2025
46 checks passed
@vstinner vstinner deleted the revert branch April 26, 2025 12:53
@kulikjak
Copy link
Contributor

kulikjak commented May 6, 2025

Hi @vstinner, do you plan to backport this change in a different way? Because while setuptools.modified is not available in setuptools delivered with Python 3.13, the deprecation warning reappears when newer setuptools is available :(.

Internally, I went with the following; it should work with both old and new:

--- Python-3.13.3/Tools/peg_generator/pegen/build.py
+++ Python-3.13.3/Tools/peg_generator/pegen/build.py
@@ -95,7 +95,10 @@ def compile_c_extension(
     import setuptools.logging
 
     from setuptools import Extension, Distribution
-    from setuptools._distutils.dep_util import newer_group
+    try:
+        from setuptools.modified import newer_group
+    except ImportError:
+        from setuptools._distutils.dep_util import newer_group
     from setuptools._distutils.ccompiler import new_compiler
     from setuptools._distutils.sysconfig import customize_compiler

@vstinner
Copy link
Member Author

vstinner commented May 6, 2025

@kulikjak: I created a PR from your comment: #133522

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.

2 participants