forked from kevlened/pytest-parallel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
37 lines (28 loc) · 777 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
from invoke import task
from codecs import open
from os import path
import shutil
import re
with open(path.join('pytest_parallel', '__init__.py'), encoding='utf-8') as f:
version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
@task
def test(c):
c.run('tox')
@task
def lint(c):
c.run('tox -e flake8')
@task
def build(c):
shutil.rmtree('build', ignore_errors=True)
shutil.rmtree('dist', ignore_errors=True)
shutil.rmtree('pytest_parallel.egg-info', ignore_errors=True)
c.run('python setup.py sdist bdist_wheel')
@task
def release(c):
test(c)
build(c)
c.run('git commit -am {}'.format(version))
c.run('git tag {}'.format(version))
c.run('git push')
c.run('git push --tags')
c.run('twine upload dist/*')