-
-
Notifications
You must be signed in to change notification settings - Fork 215
/
config.yml
139 lines (125 loc) · 3.47 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
version: 2
jobs:
quality:
docker:
- image: circleci/python:3.7
parallelism: 4
working_directory: ~/repo
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip --quiet
pip install black isort mypy --quiet
- run:
name: Check Code Style
command: |
. venv/bin/activate
isort --version
isort -c -rc setup.py src/ -p einsteinpy -sd THIRDPARTY # This avoids installing einsteinpy
black --version
black src/ setup.py --check
- run:
name: check MyPy
command: |
. venv/bin/activate
mypy --ignore-missing-imports --check-untyped-defs --no-strict-optional src/
test_py36: &test-template # See https://discuss.circleci.com/t/run-tests-on-multiple-versions-of-python/15462/2
docker:
- image: circleci/python:3.6
working_directory: ~/repo
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip --quiet
pip install numpy --quiet
pip install . --quiet
pip install .[dev] --quiet
- run:
name: run tests
command: |
. venv/bin/activate
MPLBACKEND=Agg pytest -n 8 -vv # Test against installed code (Can use --doctest-modules)
test_py37:
<<: *test-template
docker:
- image: circleci/python:3.7
test_py38:
<<: *test-template
docker:
- image: circleci/python:3.8
coverage:
docker:
- image: circleci/python:3.7
working_directory: ~/repo
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install numpy --quiet
pip install --editable .[dev] --quiet
- run:
name: run coverage
command: |
. venv/bin/activate
MPLBACKEND=Agg NUMBA_DISABLE_JIT=1 pytest --cov # Test against sources
- run:
name: publish coverage
command: |
. venv/bin/activate
pip install codecov --quiet
codecov
docs:
docker:
- image: circleci/python:3.7
working_directory: ~/repo
steps:
- checkout
- run:
name: install dependencies
command: |
sudo apt update && sudo apt install --no-install-recommends pandoc texlive texlive-latex-extra texlive-fonts-recommended dvipng graphviz
python3 -m venv venv
. venv/bin/activate
pip install .[dev] --quiet
pip install alabaster
- run:
name: build docs
command: |
. venv/bin/activate
sphinx-build -vW -b html docs/source docs-html
- store_artifacts:
path: docs-html
destination: docs-html
workflows:
version: 2
build_and_test:
jobs:
- quality
- test_py36:
requires:
- quality
- test_py37:
requires:
- quality
- test_py38:
requires:
- quality
- coverage:
requires:
- quality
- docs:
requires:
- test_py36
- test_py37
- test_py38