-
Notifications
You must be signed in to change notification settings - Fork 1
/
tasks.py
43 lines (35 loc) · 1.31 KB
/
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
from invoke import run, task
TESTPYPI = "https://testpypi.python.org/pypi"
@task
def lint():
"""Run flake8 to lint code"""
run("python setup.py flake8")
@task(lint)
def test():
"""Lint, unit test, and check setup.py"""
run("nosetests --with-coverage --cover-package=dirwalker")
run("python setup.py check")
@task()
def release(deploy=False, test=False, version=''):
"""Tag release, run Travis-CI, and deploy to PyPI
"""
if test:
run("python setup.py check")
run("python setup.py register sdist upload --dry-run")
if deploy:
run("python setup.py check")
if version:
run("git checkout master")
run("git tag -a v{ver} -m 'v{ver}'".format(ver=version))
run("git push")
run("git push origin --tags")
run("python setup.py register sdist upload")
else:
print("* Have you updated the version?")
print("* Have you updated CHANGELOG.md?")
print("* Have you fixed any last minute bugs?")
print("If you answered yes to all of the above questions,")
print("then run `invoke release --deploy -vX.YY.ZZ` to:")
print("- Checkout master")
print("- Tag the git release with provided vX.YY.ZZ version")
print("- Push the master branch and tags to repo")