aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2024-12-16 14:50:37 +0530
committerGitHub <noreply@github.com>2024-12-16 09:20:37 +0000
commit88a35b3cc99b6bf47099f1551b6a2349bba76c15 (patch)
tree67ad14a3a325e09c614b2ad53da50b846d023661 /python/servo
parentf757fa46acc865f42205d152dd06e381a674f788 (diff)
downloadservo-88a35b3cc99b6bf47099f1551b6a2349bba76c15.tar.gz
servo-88a35b3cc99b6bf47099f1551b6a2349bba76c15.zip
mach: adopt `uv` and avoid system python (#34632)
This allows us to use `uv` for: 1. Installing a pinned Python version 2. Installing the dependency packages using `uv`'s pip compatible interface. 4. Bootstrapping `mach` without a Python installion on the host, using `uv run` This change also introduces a new 'composite' GitHub action to setup python in the different CI workflows. There is no support for externally managed python installations and virtual environments. These could be added in the future. Fixes #34095, #34547 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py5
-rw-r--r--python/servo/post_build_commands.py3
-rw-r--r--python/servo/testing_commands.py2
3 files changed, 4 insertions, 6 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index c48999f99f9..b21f89980c0 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -175,7 +175,7 @@ class MachCommands(CommandBase):
return status
@Command('clean',
- description='Clean the target/ and python/_venv[version]/ directories',
+ description='Clean the target/ and Python virtual environment directories',
category='build')
@CommandArgument('--manifest-path',
default=None,
@@ -188,8 +188,7 @@ class MachCommands(CommandBase):
def clean(self, manifest_path=None, params=[], verbose=False):
self.ensure_bootstrapped()
- virtualenv_fname = '_venv%d.%d' % (sys.version_info[0], sys.version_info[1])
- virtualenv_path = path.join(self.get_top_dir(), 'python', virtualenv_fname)
+ virtualenv_path = path.join(self.get_top_dir(), '.venv')
if path.exists(virtualenv_path):
print('Removing virtualenv directory: %s' % virtualenv_path)
shutil.rmtree(virtualenv_path)
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index dfe775d83be..99c5424baf3 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -80,8 +80,7 @@ class PostBuildCommands(CommandBase):
@CommandBase.allow_target_configuration
def run(self, servo_binary: str, params, debugger=False, debugger_cmd=None,
headless=False, software=False, emulator=False, usb=False):
- self._run(servo_binary, params, debugger, debugger_cmd,
- headless, software, emulator, usb)
+ return self._run(servo_binary, params, debugger, debugger_cmd, headless, software, emulator, usb)
def _run(self, servo_binary: str, params, debugger=False, debugger_cmd=None,
headless=False, software=False, emulator=False, usb=False):
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index de421068050..ff7ad897723 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -18,7 +18,7 @@ import subprocess
import textwrap
import json
-from python.servo.post_build_commands import PostBuildCommands
+from servo.post_build_commands import PostBuildCommands
import wpt
import wpt.manifestupdate
import wpt.run