forked from tomerfiliba-org/rpyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
executable file
·30 lines (24 loc) · 1.05 KB
/
build.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
#!/usr/bin/env python
from __future__ import print_function
from plumbum import local, cli
from plumbum.path.utils import delete
from rpyc.version import version_string
class Build(cli.Application):
publish = cli.Flag("--publish")
def main(self):
delete("build", "dist", "MANIFEST", local.cwd // "*.egg-info")
# generate zip, tar.gz, and win32 installer
if self.publish:
print("registering...")
local.python("setup.py", "register")
print("uploading zip and tar.gz")
local.python("setup.py", "sdist", "--formats=zip,gztar", "upload")
print("uploading win installer")
local.python("setup.py", "bdist_wininst", "--plat-name=win32", "upload")
else:
local.python("setup.py", "sdist", "--formats=zip,gztar")
local.python("setup.py", "bdist_wininst", "--plat-name=win32")
delete("build", local.cwd // "*.egg-info")
print("Built", [f.basename for f in local.cwd / "dist"])
if __name__ == "__main__":
Build.run()