forked from tianyikillua/ddtruss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
45 lines (32 loc) · 781 Bytes
/
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
import platform
import shutil
from invoke import task
import ddtruss
VERSION = ddtruss.__version__
@task
def build(c):
print(f"Building v{VERSION}...")
shutil.rmtree("dist", ignore_errors=True)
if platform.system() == "Windows":
python = "python"
else:
python = "python3"
c.run(f"{python} setup.py sdist")
c.run(f"{python} setup.py bdist_wheel")
@task
def tag(c):
print(f"Tagging v{VERSION}...")
c.run(f"git tag v{VERSION}")
c.run("git push --tags")
@task
def upload(c):
print("Uploading wheels from dist/* to PyPI...")
c.run("twine upload dist/*")
@task
def docs(c):
print("Building docs...")
c.run("sphinx-build docs docs/_build")
@task
def format(c):
c.run("isort -rc .")
c.run("black .")