Skip to content

test_peg_generator fails when using -Werror: dep_util is Deprecated #132921

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

Closed
vstinner opened this issue Apr 25, 2025 · 2 comments
Closed

test_peg_generator fails when using -Werror: dep_util is Deprecated #132921

vstinner opened this issue Apr 25, 2025 · 2 comments
Labels
tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

vstinner commented Apr 25, 2025

Example: https://buildbot.python.org/#/builders/146/builds/11260

ERROR: test_advanced_left_recursive (test.test_peg_generator.test_c_parser.TestCParser.test_advanced_left_recursive)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_peg_generator/test_c_parser.py", line 255, in test_advanced_left_recursive
    self.run_test(grammar_source, test_source)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/test/test_peg_generator/test_c_parser.py", line 134, in run_test
    self.build_extension(grammar_source)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Lib/test/test_peg_generator/test_c_parser.py", line 131, in build_extension
    generate_parser_c_extension(grammar, Path('.'), library_dir=self.library_dir)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vstinner/python/main/Tools/peg_generator/pegen/testutil.py", line 107, in generate_parser_c_extension
    compile_c_extension(
    ~~~~~~~~~~~~~~~~~~~^
        str(source),
        ^^^^^^^^^^^^
    ...<3 lines>...
        library_dir=library_dir,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/vstinner/python/main/Tools/peg_generator/pegen/build.py", line 98, in compile_c_extension
    from setuptools._distutils.dep_util import newer_group
  File "/home/vstinner/python/main/build/test_python_worker_615517æ/tempcwd/venv/lib/python3.14t/site-packages/setuptools/_distutils/dep_util.py", line 9, in __getattr__
    warnings.warn(
    ~~~~~~~~~~~~~^
        "dep_util is Deprecated. Use functions from setuptools instead.",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        DeprecationWarning,
        ^^^^^^^^^^^^^^^^^^^
        stacklevel=2,
        ^^^^^^^^^^^^^
    )
    ^
DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.

Linked PRs

@vstinner vstinner added the tests Tests in the Lib/test dir label Apr 25, 2025
@vstinner
Copy link
Member Author

setuptools changelog says:

Added missing estimated date for removing setuptools.dep_util (deprecated in v69.0.0). (#4131)
(...)
Remove deprecated setuptools.dep_util. The provided alternative is setuptools.modified. (#4360)

See discussion: pypa/setuptools#4128 (comment)

vstinner added a commit to vstinner/cpython that referenced this issue Apr 25, 2025
Replace setuptools._distutils.dep_util with setuptools.modified in
peg_generator compile_c_extension().
@vstinner
Copy link
Member Author

Regression introduced by a setuptools update: #132415.

vstinner added a commit that referenced this issue Apr 25, 2025
Replace setuptools._distutils.dep_util with setuptools.modified in
peg_generator compile_c_extension().
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 25, 2025
…onGH-132923)

Replace setuptools._distutils.dep_util with setuptools.modified in
peg_generator compile_c_extension().
(cherry picked from commit 1a70f66)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Apr 25, 2025
…132923) (#132926)

gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923)

Replace setuptools._distutils.dep_util with setuptools.modified in
peg_generator compile_c_extension().
(cherry picked from commit 1a70f66)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit to vstinner/cpython that referenced this issue Apr 26, 2025
…precation (pythonGH-132923) (python#132926)"

This reverts commit 3776ade.

setuptools.modified module is not available on old setuptools
versions.
vstinner added a commit that referenced this issue Apr 26, 2025
…eprecation (GH-132923) (#132926)" (#133004)

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

This reverts commit 3776ade.

setuptools.modified module is not available on old setuptools
versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

1 participant