From 4e81dab121a84699c14a43c3292721883495fc91 Mon Sep 17 00:00:00 2001 From: Dan Yeaw Date: Thu, 23 Jan 2025 02:35:25 -0500 Subject: [PATCH] Remove use of deprecated distutils (#310) --- setup.py | 9 ++++----- setupbase.py | 6 ++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 95b385ffb..ef9cb7e3e 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ # At least we're on the python version we need, move on. -# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly +# BEFORE importing setuptools, remove MANIFEST. Setuptools doesn't properly # update it when the contents of directories change. if os.path.exists('MANIFEST'): os.remove('MANIFEST') @@ -50,7 +50,6 @@ sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) from setupbase import ( - version, find_packages, find_package_data, check_package_data_first, @@ -68,9 +67,9 @@ package_data = find_package_data(), ) -# Custom distutils/setuptools commands ---------- -from distutils.command.build_py import build_py -from distutils.command.sdist import sdist +# Custom setuptools commands --------------------- +from setuptools.command.build_py import build_py +from setuptools.command.sdist import sdist from setuptools.command.bdist_egg import bdist_egg from setuptools.command.develop import develop diff --git a/setupbase.py b/setupbase.py index 4e7a4feec..2ee325728 100644 --- a/setupbase.py +++ b/setupbase.py @@ -10,14 +10,14 @@ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. +import logging import os import re import shlex import shutil import sys -from distutils import log -from distutils.cmd import Command +from setuptools import Command from fnmatch import fnmatch from glob import glob from multiprocessing.pool import ThreadPool @@ -29,6 +29,8 @@ def list2cmdline(cmd_list): return ' '.join(map(shlex.quote, cmd_list)) +log = logging.getLogger(__name__) + #------------------------------------------------------------------------------- # Useful globals and utility functions #-------------------------------------------------------------------------------