Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9824949

Browse filesBrowse files
committed
setup CI with pytest and implement a bit of DRY in circle-ci
Signed-off-by: Pierre Tardy <tardyp@gmail.com>
1 parent 607a9c3 commit 9824949
Copy full SHA for 9824949

4 files changed

+85-82Lines changed: 85 additions & 82 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.circleci/config.yml‎

Copy file name to clipboard
+83-65Lines changed: 83 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,113 @@
1-
version: 2
1+
version: 2.1
22

3+
commands:
4+
mac_install_python:
5+
parameters:
6+
python_version:
7+
description: "version of python to install"
8+
type: string
9+
default: 3.6.5
10+
steps:
11+
- run: |
12+
brew update
13+
python --version
14+
sudo -H pip install --upgrade virtualenv
15+
brew install pyenv
16+
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
17+
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
18+
source ~/.bash_profile
19+
pyenv install << parameters.python_version >>
20+
pyenv versions
21+
pyenv global << parameters.python_version >>
22+
python --version
23+
24+
install_run_tests:
25+
steps:
26+
- run: |
27+
python setup.py install
28+
python -m pip install pytest
29+
- run: pytest
30+
331
jobs:
4-
python_3_6_5:
32+
mac_python_3_6:
533
shell: /bin/bash --login
634
macos:
735
xcode: '9.4.1'
836
steps:
937
- checkout
10-
- run: |
11-
brew update
12-
python --version
13-
sudo -H pip install --upgrade virtualenv
14-
brew install pyenv
15-
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
16-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
17-
source ~/.bash_profile
18-
pyenv install 3.6.5
19-
pyenv versions
20-
pyenv global 3.6.5
21-
python --version
22-
- run: python setup.py install
23-
- run: python setup.py test
38+
- mac_install_python:
39+
python_version: "3.6.5"
40+
- install_run_tests
2441

25-
python_3_7_10:
42+
43+
mac_python_3_7:
2644
shell: /bin/bash --login
2745
macos:
2846
xcode: '9.4.1'
2947
steps:
3048
- checkout
31-
- run: |
32-
brew update
33-
python --version
34-
sudo -H pip install --upgrade virtualenv
35-
brew install pyenv
36-
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
37-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
38-
source ~/.bash_profile
39-
pyenv install 3.7.10
40-
pyenv versions
41-
pyenv global 3.7.10
42-
python --version
43-
- run: python setup.py install
44-
- run: python setup.py test
49+
- mac_install_python:
50+
python_version: "3.7.10"
51+
- install_run_tests
52+
4553

46-
python_3_8_10:
54+
mac_python_3_8:
4755
shell: /bin/bash --login
4856
macos:
4957
xcode: '9.4.1'
5058
steps:
5159
- checkout
52-
- run: |
53-
brew update
54-
python --version
55-
sudo -H pip install --upgrade virtualenv
56-
brew install pyenv
57-
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
58-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
59-
source ~/.bash_profile
60-
pyenv install 3.8.10
61-
pyenv versions
62-
pyenv global 3.8.10
63-
python --version
64-
- run: python setup.py install
65-
- run: python setup.py test
60+
- mac_install_python:
61+
python_version: "3.8.10"
62+
- install_run_tests
6663

67-
python_3_9_5:
64+
mac_python_3_9:
6865
shell: /bin/bash --login
6966
macos:
7067
xcode: '9.4.1'
7168
steps:
7269
- checkout
73-
- run: |
74-
brew update
75-
python --version
76-
sudo -H pip install --upgrade virtualenv
77-
brew install pyenv
78-
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
79-
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
80-
source ~/.bash_profile
81-
pyenv install 3.9.5
82-
pyenv versions
83-
pyenv global 3.9.5
84-
python --version
85-
- run: python setup.py install
86-
- run: python setup.py test
70+
- mac_install_python:
71+
python_version: "3.9.5"
72+
- install_run_tests
73+
74+
linux_python_3_6:
75+
machine:
76+
image: python:3.6
77+
steps:
78+
- checkout
79+
- install_run_tests
80+
81+
linux_python_3_7:
82+
machine:
83+
image: python:3.7
84+
steps:
85+
- checkout
86+
- install_run_tests
87+
88+
linux_python_3_8:
89+
machine:
90+
image: python:3.8
91+
steps:
92+
- checkout
93+
- install_run_tests
94+
95+
linux_python_3_9:
96+
machine:
97+
image: python:3.9
98+
steps:
99+
- checkout
100+
- install_run_tests
87101

88102
workflows:
89103
version: 2
90104
python_matrix_build:
91105
jobs:
92-
- python_3_6_5
93-
- python_3_7_10
94-
- python_3_8_10
95-
- python_3_9_5
106+
- mac_python_3_6
107+
- mac_python_3_7
108+
- mac_python_3_8
109+
- mac_python_3_9
110+
- linux_python_3_6
111+
- linux_python_3_7
112+
- linux_python_3_8
113+
- linux_python_3_9
Collapse file

‎.travis.yml‎

Copy file name to clipboardExpand all lines: .travis.yml
-13Lines changed: 0 additions & 13 deletions
This file was deleted.
Collapse file

‎appveyor.yml‎

Copy file name to clipboardExpand all lines: appveyor.yml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ environment:
1111
install:
1212
- "%PYTHON_EXE% --version"
1313
- "%PYTHON_EXE% setup.py install"
14+
- "%PYTHON_EXE% -m pip install pytest"
1415

1516
build: off
1617

1718
test_script:
18-
- "%PYTHON_EXE% setup.py test"
19+
- "%PYTHON_EXE% -m pytest"
Collapse file

‎setup.py‎

Copy file name to clipboardExpand all lines: setup.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def test_suite():
3838
'pyyaml',
3939
'xmltodict',
4040
],
41-
extra_requires={
42-
"tests": ["pytest"]
43-
},
4441
python_requires='>=3.6',
4542
entry_points={
4643
'console_scripts': [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.