mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Add wptserve into python import paths.
This commit is contained in:
parent
9eb417528b
commit
29d9c85c56
1 changed files with 16 additions and 5 deletions
|
@ -131,7 +131,7 @@ def wpt_path(is_firefox, topdir, *paths):
|
||||||
return os.path.join(topdir, rel, *paths)
|
return os.path.join(topdir, rel, *paths)
|
||||||
|
|
||||||
|
|
||||||
def wpt_harness_path(is_firefox, topdir, *paths):
|
def wptrunner_path(is_firefox, topdir, *paths):
|
||||||
wpt_root = wpt_path(is_firefox, topdir)
|
wpt_root = wpt_path(is_firefox, topdir)
|
||||||
if is_firefox:
|
if is_firefox:
|
||||||
rel = os.path.join(wpt_root, "tests", "tools", "wptrunner")
|
rel = os.path.join(wpt_root, "tests", "tools", "wptrunner")
|
||||||
|
@ -141,6 +141,16 @@ def wpt_harness_path(is_firefox, topdir, *paths):
|
||||||
return os.path.join(topdir, rel, *paths)
|
return os.path.join(topdir, rel, *paths)
|
||||||
|
|
||||||
|
|
||||||
|
def wptserve_path(is_firefox, topdir, *paths):
|
||||||
|
wpt_root = wpt_path(is_firefox, topdir)
|
||||||
|
if is_firefox:
|
||||||
|
rel = os.path.join(wpt_root, "tests", "tools", "wptserve")
|
||||||
|
else:
|
||||||
|
rel = os.path.join(wpt_root, "web-platform-tests", "tools", "wptserve")
|
||||||
|
|
||||||
|
return os.path.join(topdir, rel, *paths)
|
||||||
|
|
||||||
|
|
||||||
def _activate_virtualenv(topdir, is_firefox):
|
def _activate_virtualenv(topdir, is_firefox):
|
||||||
virtualenv_path = os.path.join(topdir, "python", "_virtualenv")
|
virtualenv_path = os.path.join(topdir, "python", "_virtualenv")
|
||||||
check_exec_path = lambda path: path.startswith(virtualenv_path)
|
check_exec_path = lambda path: path.startswith(virtualenv_path)
|
||||||
|
@ -175,9 +185,9 @@ def _activate_virtualenv(topdir, is_firefox):
|
||||||
# and it will check for conflicts.
|
# and it will check for conflicts.
|
||||||
requirements_paths = [
|
requirements_paths = [
|
||||||
os.path.join("python", "requirements.txt"),
|
os.path.join("python", "requirements.txt"),
|
||||||
wpt_harness_path(is_firefox, topdir, "requirements.txt",),
|
wptrunner_path(is_firefox, topdir, "requirements.txt",),
|
||||||
wpt_harness_path(is_firefox, topdir, "requirements_firefox.txt"),
|
wptrunner_path(is_firefox, topdir, "requirements_firefox.txt"),
|
||||||
wpt_harness_path(is_firefox, topdir, "requirements_servo.txt"),
|
wptrunner_path(is_firefox, topdir, "requirements_servo.txt"),
|
||||||
]
|
]
|
||||||
|
|
||||||
if need_pip_upgrade:
|
if need_pip_upgrade:
|
||||||
|
@ -267,7 +277,8 @@ def bootstrap(topdir):
|
||||||
sys.path[0:0] = [os.path.join(topdir, path) for path in SEARCH_PATHS]
|
sys.path[0:0] = [os.path.join(topdir, path) for path in SEARCH_PATHS]
|
||||||
|
|
||||||
sys.path[0:0] = [wpt_path(is_firefox, topdir),
|
sys.path[0:0] = [wpt_path(is_firefox, topdir),
|
||||||
wpt_harness_path(is_firefox, topdir)]
|
wptrunner_path(is_firefox, topdir),
|
||||||
|
wptserve_path(is_firefox, topdir)]
|
||||||
|
|
||||||
import mach.main
|
import mach.main
|
||||||
mach = mach.main.Mach(os.getcwd())
|
mach = mach.main.Mach(os.getcwd())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue