From 00092f6cfaf42a11bf478c946db53f75fcba659e Mon Sep 17 00:00:00 2001 From: Julian Gilbey Date: Mon, 24 Feb 2025 20:24:22 +0000 Subject: [PATCH] Replace deprecated distutils --- pydev_ipython/inputhook.py | 6 +++--- setup.py | 3 +-- setup_pydevd_cython.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pydev_ipython/inputhook.py b/pydev_ipython/inputhook.py index db606e33..3c30f356 100644 --- a/pydev_ipython/inputhook.py +++ b/pydev_ipython/inputhook.py @@ -147,11 +147,11 @@ def enable_wx(self, app=None): app = wx.App(redirect=False, clearSigInt=False) """ import wx - from distutils.version import LooseVersion as V + from packaging.version import Version as V - wx_version = V(wx.__version__).version # @UndefinedVariable + wx_version = V(wx.__version__) # @UndefinedVariable - if wx_version < [2, 8]: + if wx_version < V("2.8"): raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__) # @UndefinedVariable from pydev_ipython.inputhookwx import inputhook_wx diff --git a/setup.py b/setup.py index f4ab050b..e860bcf8 100644 --- a/setup.py +++ b/setup.py @@ -21,9 +21,8 @@ for release process. """ -from setuptools import setup +from setuptools import Extension, setup from setuptools.dist import Distribution -from distutils.extension import Extension import os diff --git a/setup_pydevd_cython.py b/setup_pydevd_cython.py index 01b2e6cc..0e67eed5 100644 --- a/setup_pydevd_cython.py +++ b/setup_pydevd_cython.py @@ -181,7 +181,7 @@ def build_extension(dir_name, extension_name, target_pydevd_name, force_cython, stream.write(c_file_contents) # Always compile the .c (and not the .pyx) file (which we should keep up-to-date by running build_tools/build.py). - from distutils.extension import Extension + from setuptools import Extension extra_compile_args = [] extra_link_args = []