/
config.yml
154 lines (129 loc) · 3.22 KB
/
config.yml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: 2.1
orbs:
codecov: codecov/codecov@1.0.2
jobs:
lint:
docker:
- image: circleci/python:3.7
steps:
- checkout
- run:
name: Install shellcheck
command: |
sudo apt-get update
sudo apt-get install shellcheck
- run:
name: Create virtualenv
command: |
mkdir -p ~/.venv
virtualenv ~/.venv
echo "source ~/.venv/bin/activate" >> $BASH_ENV
- run:
name: Install dependencies
command: |
pip install -r requirements-lint.txt
pip install .
- run:
name: Lint
command: therapist run --use-tracked-files
test: &test-defaults
docker:
- image: circleci/python:3.7
steps:
- checkout
- run:
name: Create virtualenv
command: |
mkdir -p ~/.venv
virtualenv ~/.venv
echo "source ~/.venv/bin/activate" >> $BASH_ENV
- run:
name: Install dependencies
command: |
pip install -r requirements-dev.txt
pip install .
- run:
name: Test
command: pytest -vvv --cov-report=xml --cov
- codecov/upload:
file: coverage.xml
test-py35:
<<: *test-defaults
docker:
- image: circleci/python:3.5
test-py36:
<<: *test-defaults
docker:
- image: circleci/python:3.6
test-py37:
<<: *test-defaults
docker:
- image: circleci/python:3.7
deploy:
docker:
- image: circleci/python:3.7
steps:
- checkout
- restore_cache:
key: v1-python-{{ .Environment.CIRCLE_JOB }}
- run:
name: Create virtualenv
command: |
mkdir -p ~/.venv
virtualenv ~/.venv
echo "source ~/.venv/bin/activate" >> $BASH_ENV
- run:
name: Install dependencies
command: pip install twine
- save_cache:
paths:
- "~/.venv"
key: v1-python-{{ .Environment.CIRCLE_JOB }}
- run:
name: Verify git tag matches version
command: python setup.py verify
- run:
name: Create .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = rehandalal" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: Create distributions
command: |
python setup.py sdist
python setup.py bdist_wheel
- run:
name: Upload to PyPI
command: twine upload dist/*
workflows:
version: 2
test_and_deploy:
jobs:
- lint:
filters:
tags:
only: /^v.*/
- test-py35:
filters:
tags:
only: /^v.*/
- test-py36:
filters:
tags:
only: /^v.*/
- test-py37:
filters:
tags:
only: /^v.*/
- deploy:
requires:
- lint
- test-py35
- test-py36
- test-py37
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/