FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pymanager/make.py at main · python/pymanager · GitHub
python
pymanager
Repository navigation
Code
Issues
23
(23)
Pull requests
7
(7)
Actions
Security and quality
1
(1)
Insights
Expand file tree
Breadcrumbs
pymanager
/
make.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (43 loc) · 1.41 KB
Breadcrumbs
pymanager
/
make.py
Copy path
File metadata and controls
49 lines (43 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
os
import
subprocess
import
sys
from
subprocess
import
check_call
as
run
from
_make_helper
import
get_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"
not
in
sys
.
argv
:
rmtree
(
BUILD
)
rmtree
(
TEMP
)
rmtree
(
LAYOUT
)
ref
=
"none"
try
:
ref
=
os
.
getenv
(
"BUILD_SOURCEBRANCH"
,
os
.
getenv
(
"GITHUB_REF"
,
""
))
if
not
ref
:
with
subprocess
.
Popen
(
[
"git"
,
"describe"
,
"HEAD"
,
"--tags"
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
as
p
:
out
,
err
=
p
.
communicate
()
if
out
:
ref
=
"refs/tags/"
+
out
.
decode
().
strip
()
ref
=
os
.
getenv
(
"OVERRIDE_REF"
,
ref
)
print
(
"Building for tag"
,
ref
)
except
subprocess
.
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"
)
for
f
in
(
TEMP
/
"bundle"
).
iterdir
():
f
.
rename
(
LAYOUT
/
"bundled"
/
f
.
name
)
Back
|
FazBrowse Home
|
New Git URL