Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: tools/telemetry/third_party/modulegraph/modulegraph_tests/testdata/nspkg/src/install.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 """
3 Script that will create a subdirectory one level up with two subdirs
4 with --single-version-externally-managed namespace packages.
5
6 Use this script with new versions of distribute and setuptools to ensure
7 that changes in the handling of this option don't break us.
8 """
9 import pkg_resources
10 import subprocess
11 import os
12 import sys
13 import shutil
14
15 def main():
16 r = pkg_resources.require('setuptools')[0]
17 install_dir = os.path.join(
18 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
19 "%s-%s"%(r.project_name, r.version))
20 if os.path.exists(install_dir):
21 print("Skip %s %s: already installed"%(r.project_name, r.version))
22
23 else:
24 os.mkdir(install_dir)
25 os.mkdir(os.path.join(install_dir, "parent"))
26 os.mkdir(os.path.join(install_dir, "child"))
27
28 if os.path.exists('parent/build'):
29 shutil.rmtree('parent/build')
30 if os.path.exists('child/build'):
31 shutil.rmtree('child/build')
32
33 for subdir in ('parent', 'child'):
34 p = subprocess.Popen([
35 sys.executable,
36 "setup.py",
37 "install",
38 "--install-lib=%s/%s"%(install_dir, subdir),
39 "--single-version-externally-managed",
40 "--record", "files.txt"
41 ],
42 cwd=subdir)
43 xit = p.wait()
44 if xit != 0:
45 print("ERROR: install failed")
46 sys.exit(1)
47
48
49 if os.path.exists('%s/files.txt'%(subdir,)):
50 os.unlink('%s/files.txt'%(subdir,))
51
52
53 if __name__ == "__main__":
54 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698