Skip to content

Commit

Permalink
Remove use of deprecated distutils (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyeaw authored Jan 23, 2025
1 parent 89593d1 commit 4e81dab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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,
Expand All @@ -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

Expand Down
6 changes: 4 additions & 2 deletions setupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,6 +29,8 @@
def list2cmdline(cmd_list):
return ' '.join(map(shlex.quote, cmd_list))

log = logging.getLogger(__name__)

#-------------------------------------------------------------------------------
# Useful globals and utility functions
#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 4e81dab

Please sign in to comment.