-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.env
131 lines (91 loc) · 2.17 KB
/
.env
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
OPEN_PROJECT_NAME="connectable"
if [ "$PROJECT_NAME" = "$OPEN_PROJECT_NAME" ]; then
return
fi
if [ ! -f ".env" ]; then
return
fi
export PROJECT_NAME=$OPEN_PROJECT_NAME
export PROJECT_DIR="$PWD"
if [ ! -f "pyvenv.cfg" ]; then
if ! hash pyvenv 2>/dev/null; then
alias pyvenv="pyvenv-3.4";
fi
echo "Making venv for $PROJECT_NAME"
pyvenv .
. bin/activate
pip install -r requirements/development.txt
fi
. bin/activate
# Let's make sure this is a hubflow enabled repo
yes | git hf init >/dev/null 2>/dev/null
# Quick directory switching
alias root="cd $PROJECT_DIR"
alias project="root; cd $PROJECT_NAME"
alias tests="root; cd tests"
alias examples="root; cd examples"
alias requirements="root; cd requirements"
alias test="_test"
function _start {
export LAST_DIRECTORY="$PWD"
root
}
function _end {
cd $LAST_DIRECTORY
unset LAST_DIRECTORY
}
function open {
_start; $CODE_EDITOR connectable/*.py setup.py tests/*.py examples/*.py README.md tox.ini .gitignore CHANGELOG.md setup.cfg .editorconfig .env .coveragerc .travis.yml; _end
}
function clean {
_start; isort connectable/*.py setup.py; _end
}
function check {
_start; frosted connectable/*.py; _end
}
function _test {
_start; tox; _end
}
function coverage {
_start; py.test --cov-report html --cov connectable/ tests
$BROWSER htmlcov/index.html; _end
}
function load {
_start; python setup.py install; _end
}
function unload {
_start; pip uninstall connectable; _end
}
function install {
_start; sudo python setup.py install; _end
}
function update {
_start; pip install -r requirements/development.txt -U; _end
}
function distribute {
_start; python setup.py sdist upload; _end
}
function leave {
export PROJECT_NAME=""
export PROJECT_DIR=""
unalias root
unalias project
unalias tests
unalias examples
unalias requirements
unalias test
unset -f _start
unset -f _end
unset -f open
unset -f clean
unset -f _test
unset -f coverage
unset -f load
unset -f unload
unset -f install
unset -f update
unset -f distribute
unset -f leave
deactivate
}