forked from tomerfiliba-org/rpyc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.py
executable file
·35 lines (28 loc) · 1.29 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
30
31
32
33
34
#!/usr/bin/env python
from __future__ import print_function
from plumbum import local, cli
from plumbum.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")
# upload to sourceforge
print("uploading to sourceforge")
dst = "gangesmaster,rpyc@frs.sourceforge.net:/home/frs/project/r/rp/rpyc/main/%s/" % (version_string,)
local["rsync"]("-rv", "dist/", dst)
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()