mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Create a marker file to avoid running pip when possible
This commit is contained in:
parent
e10c5c74cc
commit
9737b2375e
1 changed files with 14 additions and 5 deletions
|
@ -96,12 +96,21 @@ def _activate_virtualenv(topdir):
|
||||||
# chain each of the requirements files into the same `pip install` call
|
# chain each of the requirements files into the same `pip install` call
|
||||||
# and it will check for conflicts.
|
# and it will check for conflicts.
|
||||||
requirements_paths = [
|
requirements_paths = [
|
||||||
os.path.join(topdir, "python", "requirements.txt"),
|
os.path.join("python", "requirements.txt"),
|
||||||
os.path.join(topdir, "tests", "wpt", "harness", "requirements.txt"),
|
os.path.join("tests", "wpt", "harness", "requirements.txt"),
|
||||||
os.path.join(topdir, "tests", "wpt", "harness", "requirements_servo.txt"),
|
os.path.join("tests", "wpt", "harness", "requirements_servo.txt"),
|
||||||
]
|
]
|
||||||
for path in requirements_paths:
|
for req_rel_path in requirements_paths:
|
||||||
subprocess.check_call(["pip", "install", "-q", "-r", path])
|
req_path = os.path.join(topdir, req_rel_path)
|
||||||
|
marker_file = req_rel_path.replace(os.path.sep, '-')
|
||||||
|
marker_path = os.path.join(virtualenv_path, marker_file)
|
||||||
|
try:
|
||||||
|
if os.path.getmtime(req_path) + 10 < os.path.getmtime(marker_path):
|
||||||
|
continue
|
||||||
|
except OSError:
|
||||||
|
open(marker_path, 'w').close()
|
||||||
|
subprocess.check_call(["pip", "install", "-q", "-r", req_path])
|
||||||
|
os.utime(marker_path, None)
|
||||||
|
|
||||||
|
|
||||||
def bootstrap(topdir):
|
def bootstrap(topdir):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue