forked from jpfn2407/aedb_ds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
56 lines (45 loc) · 1.37 KB
/
Copy pathtasks.py
File metadata and controls
56 lines (45 loc) · 1.37 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
from invoke import task
import re
@task
def test(c):
c.run("coverage run -m unittest discover")
@task(test)
def cov(c):
c.run("coverage report")
c.run("coverage html")
@task
def setupstream(c, username="amgs"):
remotes = c.run("git remote", hide=True).stdout
if "upstream" not in remotes:
origin_url = c.run("git remote get-url origin", hide=True).stdout.split("\n")[0]
project_name = re.search(f"\/\/.+\/.+\/(.+?)\.git$", origin_url).group(1)
c.run(f"git remote add upstream https://github.com/{username}/{project_name}.git")
@task(setupstream)
def sync(c):
c.run("git fetch upstream")
c.run("git merge upstream/master")
@task
def pr(c):
c.run("hub pr list --format='[%I] %cI %uI %t [%H] | %U%n'")
@task
def clean(c):
c.run("if exist %CD%\dist rmdir /S /Q dist")
c.run("if exist %CD%\\build rmdir /S /Q build")
c.run("if exist %CD%\\aed_ds.egg-info rmdir /S /Q aed_ds.egg-info")
@task(clean)
def build(c):
c.run("python setup.py bdist_wheel")
@task(build)
def install(c):
c.run("pip uninstall -y aed-ds")
c.run("pip install --find-links=%cd%\dist aed_ds")
@task
def xclean(c):
c.run("rm -rf dist/ build/ *.egg-info/")
@task(xclean)
def xbuild(c):
c.run("pip uninstall -y aed-ds")
c.run("python setup.py bdist_wheel")
@task(xbuild)
def xinstall(c):
c.run("pip install --find-links=./dist aed_ds")