Skip to content

distutils is deprecated and removed in Python 3.12 #1659

Open

Description

setup.py currently falls back to distutils if versioneer does not provide the required "build" command:

debugpy/setup.py

Lines 62 to 65 in fb6158a

try:
build = cmds["build"]
except KeyError:
from distutils.command.build import build

But distutils no longer exists in Python 3.12, so this code needs to be updated: either versioneer always provides this, in which case the try/except is unnecessary, or it doesn't, in which case the distutils call needs to be replaced.

There are also calls to distutils in several places in the vendored pydevd, some of which may be important to fix; an rgrep gives these occurrences:

src/debugpy/_vendored/pydevd/setup.py:from distutils.extension import Extension
src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.c:    "distutils": {
src/debugpy/_vendored/pydevd/pydev_ipython/inputhook.py:        from distutils.version import LooseVersion as V
src/debugpy/_vendored/pydevd/pydev_ipython/version.py:from distutils.version import LooseVersion
src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.c:    "distutils": {
src/debugpy/_vendored/pydevd/setup_pydevd_cython.py:        from distutils.extension import Extension
src/debugpy/_vendored/pydevd/build_tools/build.py:                    from distutils import msvc9compiler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    needs reproIssue has not been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions