-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_glass.py
37 lines (27 loc) · 1003 Bytes
/
build_glass.py
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
import subprocess
import sys
import os
import shutil
if os.path.isdir("build"):
shutil.rmtree("build")
if os.path.isdir("python_glass.egg-info"):
shutil.rmtree("python_glass.egg-info")
with open("README_glass.rst", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("README.rst", "w", encoding="utf-8") as out_file:
out_file.write(content)
with open("setup_glass.py", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("setup.py", "w", encoding="utf-8") as out_file:
out_file.write(content)
with open("MANIFEST.in", "w", encoding="utf-8") as out_file:
out_file.write(
"""include glass/README_PYPI.md
include glass/LICENSE
include glass/CodeCompressor/pcpp/LICENSE
""")
subprocess.call([sys.executable, "setup.py", "sdist", "bdist_wheel"])
with open("README_glass_engine.rst", "r", encoding="utf-8") as in_file:
content = in_file.read()
with open("README.rst", "w", encoding="utf-8") as out_file:
out_file.write(content)