-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtasks.py
56 lines (46 loc) · 1.4 KB
/
tasks.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
"""
Automate deployment to PyPi
"""
import invoke,json,pathlib
def get_token():
with open(f"{pathlib.Path(__file__).parent /'token.json' }", "r") as cfg:
return cfg['token']
@invoke.task
def deploy(ctx):
"""
Automate deployment
rm -rf build/* dist/*
bumpversion patch --verbose
python3 setup.py sdist bdist_wheel
twine upload dist/*
git push --tags
"""
ctx.run("rm -rf build/* dist/*")
# ctx.run("bumpversion {bump} --verbose")
ctx.run("python3 setup.py sdist bdist_wheel")
ctx.run("python3 -m twine check dist/*")
ctx.run(f"python3 -m twine upload --config-file {pathlib.Path(__file__).parent / '.pypirc' } dist/*")
# ctx.run("git push origin --tags")
# ctx.run("git push kristy --tags")
@invoke.task
def gitpush(ctx, message):
"""
Automate push for minor changes including typos and reversions
"""
message = ' '.join(message.split('_'))
ctx.run("git add -A")
ctx.run(f"git commit -m '{message}'")
ctx.run("git push origin")
# ctx.run("git push kristy")
@invoke.task
def gittag(ctx):
"""
Automate push and tagging
for any change that will change behaviour
"""
# message = ' '.join(message.split('_'))
# ctx.run("git add -A")
# ctx.run(f"git commit -m '{message}'")
# ctx.run(f"git tag -a {tag} -m {message}")
ctx.run("git push origin --tags")
# ctx.run("git push kristy --tags")