-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabfile.py
39 lines (29 loc) · 918 Bytes
/
fabfile.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
from fabric.api import *
import os
import sys
VIRTUAL_ENV = os.environ.get('VIRTUAL_ENV')
ACTIVATE = 'source {0}/bin/activate && '.format(VIRTUAL_ENV) if VIRTUAL_ENV else ''
def venv_local(command, *args, **kwargs):
return local(ACTIVATE + command, *args, **kwargs)
@task
def bump(version='patch'):
# Version should be either: major, minor, patch
venv_local('bumpversion {0} --list'.format(version))
local('git push')
local('git push --tags')
@task
def check_pypirc():
conf = os.path.expanduser('~/.pypirc')
open(conf, 'a').close()
with open(conf) as pypirc:
if '[jangl]' not in pypirc.read():
print '\n[jangl] does not exist in ~/.pypirc\n'
sys.exit(1)
@task
def push_to_pypi():
check_pypirc()
local('python setup.py sdist upload -r jangl')
local('python setup.py bdist_wheel upload -r jangl')
@task
def push():
push_to_pypi()