Skip to content
Snippets Groups Projects
Commit 12ed43db authored by serge-sans-paille's avatar serge-sans-paille
Browse files

Bug 1858062 - Remove reference to distutils in mozboot a=pascalc

distutils is no longer available in Python 3.12, which means we cannot
require it on bootstrap, otherwise we cannot bootstrap from Py 3.12.

We already require setuptools as part of mach's requirements, so it's
fine to depend on setuptools elsewhere.

Original Revision: https://phabricator.services.mozilla.com/D190537

Differential Revision: https://phabricator.services.mozilla.com/D200113
parent f52d4267
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
......@@ -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)
......
......@@ -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`.",
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment