-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathautomate.py
More file actions
59 lines (46 loc) · 1.33 KB
/
automate.py
File metadata and controls
59 lines (46 loc) · 1.33 KB
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
58
59
import argparse
import os
import sys
from subprocess import Popen, PIPE
def print_help():
print("""
====What needs to happen========
1. make sure all changes pushed to master
2. generate a git tag
3. remove dist/* to remove old distribution
4. run python setup.py sdist , generates new distribution
5. twine upload dist/*
""")
# create description of task
parser = argparse.ArgumentParser(description='Distribute PyRXNLP')
parser.add_argument(
'-i',
'--info',
action='store_true',
help="info",
required=False)
parser.add_argument(
'-v',
'--version',
type=str,
help="provide a version number that doesn't collide",
required=False)
args = parser.parse_args()
version=args.version
info=args.info
if info:
print_help()
elif version is not None:
# 1. make sure all changes pushed to master
# 2. generate a git tag
# 3. remove dist/*
# 4. run setup.py python setup.py sdist
# 5. twine upload dist/*
os.system ("git tag {0}".format(version))
os.system ("git push origin {0}".format(version))
os.putenv ("version",version)
os.system ("rm -r dist/*")
os.system ("python setup.py sdist".format(version))
os.system ("twine upload dist/*")
else:
parser.print_help()