summaryrefslogtreecommitdiffstats
path: root/python/mozboot
diff options
context:
space:
mode:
Diffstat (limited to 'python/mozboot')
-rw-r--r--python/mozboot/mozboot/base.py7
-rw-r--r--python/mozboot/mozboot/bootstrap.py16
-rw-r--r--python/mozboot/mozboot/debian.py7
-rw-r--r--python/mozboot/setup.py5
4 files changed, 4 insertions, 31 deletions
diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py
index c32946c4eb..9f4a81ca01 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 e57f496f29..c2b7480b8e 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 34e328586e..63b47a2f03 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 234650dc8a..7b12c1c0c5 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"