generated from dawsonbooth/poetry-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
50 lines (33 loc) · 841 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
46
47
48
49
50
import os
import shutil
from invoke import task
def copy(from_path: str, to_path: str):
if os.path.isdir(from_path):
shutil.copytree(from_path, to_path)
elif os.path.isfile(from_path):
shutil.copy(from_path, to_path)
@task
def clean(c):
c.run("pyclean .")
@task
def lint(c):
c.run("pylint emoji")
@task
def test(c):
c.run("pytest emoji/test.py")
@task
def docs(c):
c.run("pydoc-markdown -p emoji > docs/documentation.md")
copy("README.md", "docs/README.md")
c.run("mkdocs build --clean")
@task
def build(c):
c.run("poetry build")
@task
def publish(c):
c.run("mkdocs gh-deploy")
c.run("poetry publish")
version = c.run("poetry version -s").stdout
c.run(f'git commit -m "v{version}"')
c.run(f"git tag v{version}")
c.run(f"git push origin v{version}")