Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathmake.py
More file actions
Latest commit
49 lines (43 loc) · 1.41 KB
/
Copy pathmake.py
File metadata and controls
49 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
importos
importsubprocess
importsys
fromsubprocessimportcheck_callasrun
from_make_helperimportget_dirs, rmtree
# Clean DEBUG flag in case it affects build
os.environ["PYMANAGER_DEBUG"] =""
DIRS=get_dirs()
BUILD=DIRS["build"]
TEMP=DIRS["temp"]
LAYOUT=DIRS["out"]
SRC=DIRS["src"]
DIST=DIRS["dist"]
if"-i"notinsys.argv:
rmtree(BUILD)
rmtree(TEMP)
rmtree(LAYOUT)
ref="none"
try:
ref=os.getenv("BUILD_SOURCEBRANCH", os.getenv("GITHUB_REF", ""))
ifnotref:
withsubprocess.Popen(
["git", "describe", "HEAD", "--tags"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
) asp:
out, err=p.communicate()
ifout:
ref="refs/tags/"+out.decode().strip()
ref=os.getenv("OVERRIDE_REF", ref)
print("Building for tag", ref)
exceptsubprocess.CalledProcessError:
pass
# Run main build - this fills in BUILD and LAYOUT
run([sys.executable, "-m", "pymsbuild", "wheel"],
cwd=DIRS["root"],
env={**os.environ, "BUILD_SOURCEBRANCH": ref})
# Bundle current latest release
run([LAYOUT/"py-manager.exe", "install", "-v", "-f", "--download", TEMP/"bundle", "3-64", "3-arm64"])
(LAYOUT/"bundled").mkdir(parents=True, exist_ok=True)
(TEMP/"bundle"/"index.json").rename(LAYOUT/"bundled"/"fallback-index.json")
forfin (TEMP/"bundle").iterdir():
f.rename(LAYOUT/"bundled"/f.name)