mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Stop using distutils (#30638)
This is removed from Python 3.12 so we can no longer rely on it. All of this functionality is either in `setuptools` or `shutil`.
This commit is contained in:
parent
6dd359193f
commit
463c61f34d
3 changed files with 4 additions and 8 deletions
|
@ -3,10 +3,8 @@
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
try:
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
except ImportError:
|
|
||||||
from distutils.core import setup
|
|
||||||
|
|
||||||
|
|
||||||
VERSION = '1.0.0'
|
VERSION = '1.0.0'
|
||||||
|
|
|
@ -9,7 +9,6 @@ import platform
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from distutils.spawn import find_executable
|
|
||||||
from subprocess import Popen
|
from subprocess import Popen
|
||||||
from tempfile import TemporaryFile
|
from tempfile import TemporaryFile
|
||||||
|
|
||||||
|
@ -90,7 +89,7 @@ PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"]
|
||||||
|
|
||||||
def _get_exec_path(names, is_valid_path=lambda _path: True):
|
def _get_exec_path(names, is_valid_path=lambda _path: True):
|
||||||
for name in names:
|
for name in names:
|
||||||
path = find_executable(name)
|
path = shutil.which(name)
|
||||||
if path and is_valid_path(path):
|
if path and is_valid_path(path):
|
||||||
return path
|
return path
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -37,7 +37,6 @@ import tidy
|
||||||
|
|
||||||
from servo.command_base import BuildType, CommandBase, call, check_call
|
from servo.command_base import BuildType, CommandBase, call, check_call
|
||||||
from servo.util import delete
|
from servo.util import delete
|
||||||
from distutils.dir_util import copy_tree
|
|
||||||
|
|
||||||
SCRIPT_PATH = os.path.split(__file__)[0]
|
SCRIPT_PATH = os.path.split(__file__)[0]
|
||||||
PROJECT_TOPLEVEL_PATH = os.path.abspath(os.path.join(SCRIPT_PATH, "..", ".."))
|
PROJECT_TOPLEVEL_PATH = os.path.abspath(os.path.join(SCRIPT_PATH, "..", ".."))
|
||||||
|
@ -793,7 +792,7 @@ tests/wpt/mozilla/tests for Servo-only tests""" % reference_path)
|
||||||
file.write(filedata)
|
file.write(filedata)
|
||||||
# copy
|
# copy
|
||||||
delete(path.join(tdir, "webgpu"))
|
delete(path.join(tdir, "webgpu"))
|
||||||
copy_tree(path.join(clone_dir, "out-wpt"), path.join(tdir, "webgpu"))
|
shutil.copytree(path.join(clone_dir, "out-wpt"), path.join(tdir, "webgpu"))
|
||||||
# update commit
|
# update commit
|
||||||
commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=clone_dir).decode()
|
commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=clone_dir).decode()
|
||||||
with open(path.join(tdir, "checkout_commit.txt"), 'w') as file:
|
with open(path.join(tdir, "checkout_commit.txt"), 'w') as file:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue