-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpie_tasks.py
50 lines (37 loc) · 1.11 KB
/
pie_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
from pie import *
# Get OS-specific partial path
VENV_BUILD = os.path.join(".venvs", "build")
VENV_TEST = os.path.join(".venvs", "test")
@task
def build():
with venv(VENV_BUILD):
cmd(r"python setup.py bdist_wheel clean --all")
@task
def createVenvs():
venv(VENV_BUILD).create()
venv(VENV_TEST).create()
@task
def setup():
createVenvs()
updatePackages()
@task
def test():
with venv(VENV_TEST):
cmd(r"python -m pytest -s --cov-report term --cov-report html --cov=agsadmin .\\tests")
@task
def updatePackages():
with venv(VENV_BUILD):
pip(r"install -U setuptools")
pip(r"install -U pip")
pip(r"install -U -r requirements.build.txt")
pip(r"install -U -r requirements.txt")
with venv(VENV_TEST):
pip(r"install -U setuptools")
pip(r"install -U pip")
pip(r"install -U -r requirements.test.txt")
pip(r"install -U -r requirements.txt")
@task([OptionsParameter('version')])
def upload(version):
with venv(VENV_BUILD):
cmd(r'python -m twine upload dist\agsadmin-{}-py2.py3-none-any.whl'.format(version))