forked from pyenchant/pyenchant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.py
57 lines (38 loc) · 1.15 KB
/
release.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
import platform
import shutil
import subprocess
import sys
from bootstrap import bootstrap_windows
def run(*cmd):
print(*cmd)
subprocess.run(cmd, check=True, stdout=subprocess.PIPE)
def ensure_empty(data_path):
if os.path.exists(data_path):
shutil.rmtree(data_path)
os.mkdir(data_path)
def make_windows_wheel(platform):
ensure_empty("build/")
ensure_empty("enchant/data/")
bootstrap_windows(platform)
run("python", "setup.py", "bdist_wheel", "--plat-name", platform)
def make_wheel_any():
ensure_empty("build/")
ensure_empty("enchant/data/")
run("python", "setup.py", "bdist_wheel")
def make_sdist():
ensure_empty("build/")
ensure_empty("enchant/data/")
run("python", "setup.py", "sdist")
def main():
""" Build artifacts that we need to upload to pypi """
ensure_empty("build/")
ensure_empty("dist/")
print("Building artifacts for new release ...")
make_windows_wheel(platform="win_amd64")
make_windows_wheel(platform="win32")
make_wheel_any()
make_sdist()
print("Done!. Artifacts are in dist/, ready for upload")
if __name__ == "__main__":
main()