diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py index c32946c4ebd07a6da135c5de40738f49f06bed6f..9f4a81ca01996c06e814fe3a095d26c631773e16 100644 --- a/python/mozboot/mozboot/base.py +++ b/python/mozboot/mozboot/base.py @@ -170,13 +170,6 @@ class BaseBootstrapper(object): to the user, if necessary. """ - def suggest_install_distutils(self): - """Called if distutils.{sysconfig,spawn} can't be imported.""" - print( - "Does your distro require installing another package for distutils?", - file=sys.stderr, - ) - def suggest_install_pip3(self): """Called if pip3 can't be found.""" print( diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py index e57f496f29a4b049954c0f7aa5957772f16276e8..c2b7480b8e6f171cf1c690fd8af0b656d34adb9a 100644 --- a/python/mozboot/mozboot/bootstrap.py +++ b/python/mozboot/mozboot/bootstrap.py @@ -491,22 +491,6 @@ class Bootstrapper(object): def _validate_python_environment(self, topsrcdir): valid = True - try: - # distutils is singled out here because some distros (namely Ubuntu) - # include it in a separate package outside of the main Python - # installation. - import distutils.spawn - import distutils.sysconfig - - assert distutils.sysconfig is not None and distutils.spawn is not None - except ImportError as e: - print("ERROR: Could not import package %s" % e.name, file=sys.stderr) - self.instance.suggest_install_distutils() - valid = False - except AssertionError: - print("ERROR: distutils is not behaving as expected.", file=sys.stderr) - self.instance.suggest_install_distutils() - valid = False pip3 = to_optional_path(which("pip3")) if not pip3: print("ERROR: Could not find pip3.", file=sys.stderr) diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py index 34e328586ea0e31ab2acce3fa62a15c5dcf50987..63b47a2f03ab8e1dc3d8b50c317597c01e925386 100644 --- a/python/mozboot/mozboot/debian.py +++ b/python/mozboot/mozboot/debian.py @@ -17,13 +17,6 @@ class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper): self.dist_id = dist_id self.codename = codename - def suggest_install_distutils(self): - print( - "HINT: Try installing distutils with " - "`apt-get install python3-distutils`.", - file=sys.stderr, - ) - def suggest_install_pip3(self): print( "HINT: Try installing pip3 with `apt-get install python3-pip`.", diff --git a/python/mozboot/setup.py b/python/mozboot/setup.py index 234650dc8a51a79d131a108279fff0881ac26bfa..7b12c1c0c5d8ac151b7faa0036f1250de5cc720f 100644 --- a/python/mozboot/setup.py +++ b/python/mozboot/setup.py @@ -2,7 +2,10 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. -from distutils.core import setup +try: + from setuptools import setup +except ImportError: + from distutils.core import setup VERSION = "0.1"