Skip to content

[BUG] setuptools' distutils override no longer shows DeprecationWarning #3533

@tiran

Description

@tiran

setuptools version

setuptools==65.0.1

Python version

any

OS

any

Additional environment information

No response

Description

Recent versions of setuptools override Python stdlib's distutils with setuptools._distutils via _distutils_hack. This version does not contain code to issue deprecation warnings. It's a deviation from upstream code. setuptools should keep the deprecation warning to inform users that they should move from distutils to setuptools.

See also #3532

Expected behavior

$ venv/bin/pip install "setuptools==59.6.0"
$ venv/bin/python -Werror -c "import distutils"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.10/distutils/__init__.py", line 19, in <module>
    warnings.warn(_DEPRECATION_MESSAGE,
DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

How to Reproduce

  1. python3 -m venv venv
  2. Install recent setuptools, e,g. venv/bin/pip install "setuptools==65.0.1"
  3. Run venv/bin/python -Werror -c "import distutils"

Output

no output, command does not raise a deprecation warning

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions