Skip to content

Commit dc37967

Browse files
[TESTS] Initial hardening with pinned dependencies (- WIP #40 -)
Notible change: introduced a new config for test environment's dependancies with `test-requirements.txt`
1 parent d288e89 commit dc37967

File tree

3 files changed

+55
-51
lines changed

3 files changed

+55
-51
lines changed

.circleci/config.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@ jobs:
2929
when: on_success
3030
- run:
3131
shell: /bin/bash
32-
name: "install coverage attempt"
32+
name: "install test extras attempt"
3333
command: |
34-
python3 -m pip install --user coverage || true
35-
- run:
36-
name: "install flake8 attempt"
37-
command: |
38-
python3 -m pip install --user flake8 || true
39-
when: on_success
34+
python3 -m pip install --user -r ./test-requirements.txt || true
4035
- save_cache:
4136
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
4237
paths:
@@ -61,12 +56,6 @@ jobs:
6156
steps:
6257
- restore_cache:
6358
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
64-
- run:
65-
shell: /bin/bash
66-
name: "clean up for test"
67-
command: |
68-
python3 -m pip install --user coverage || true
69-
when: on_success
7059
- run:
7160
shell: /bin/bash
7261
name: "clean up for test"
@@ -111,17 +100,11 @@ jobs:
111100
steps:
112101
- restore_cache:
113102
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
114-
- run:
115-
shell: /bin/bash
116-
name: "clean up for test"
117-
command: |
118-
python3 -m pip install --user coverage || true
119-
when: on_success
120103
- run:
121104
shell: /bin/bash
122105
name: "setup up for pytest"
123106
command: |
124-
python3 -m pip install --user pytest || true
107+
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
125108
when: on_success
126109
- run:
127110
shell: /bin/bash
@@ -168,9 +151,9 @@ jobs:
168151
- restore_cache:
169152
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
170153
- run:
171-
name: "install flake8 attempt"
154+
name: "install linters extras attempt"
172155
command: |
173-
python3 -m pip install --user flake8 || true
156+
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
174157
- run:
175158
shell: /bin/bash
176159
name: "clean up for test"

.github/workflows/Tests.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ jobs:
9393
python-version: ${{ matrix.python-version }}
9494
- name: Setup dependencies
9595
run: |
96-
python -m pip install --upgrade pip setuptools wheel
96+
python -m pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37"
9797
pip install -r ./requirements.txt
98+
pip install --user -r ./test-requirements.txt || true
9899
- name: Pre-build
99100
id: bootstrap
100101
run: |
@@ -151,8 +152,8 @@ jobs:
151152
python-version: ${{ matrix.python-version }}
152153
- name: Install dependencies for ${{ matrix.python-version }}
153154
run: |
154-
pip install -r ./requirements.txt ;
155-
pip install coverage || true ;
155+
pip install -r ./requirements.txt
156+
pip install --user -r ./test-requirements.txt || true
156157
- name: Pre-Clean
157158
id: clean
158159
run: make -j1 -f Makefile clean || true ;
@@ -198,11 +199,9 @@ jobs:
198199
python-version: ${{ matrix.python-version }}
199200
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
200201
run: |
201-
pip install --upgrade --upgrade-strategy eager pip setuptools wheel ;
202-
pip install --upgrade --upgrade-strategy eager -r ./requirements.txt ;
203-
pip install --upgrade --upgrade-strategy eager pytest ;
204-
pip install --upgrade --upgrade-strategy eager pytest-cov ;
205-
pip install --upgrade --upgrade-strategy eager coverage ;
202+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37"
203+
pip install -r ./requirements.txt
204+
pip install --user -r ./test-requirements.txt || true
206205
- name: Install code-climate tools for ${{ matrix.python-version }}
207206
if: ${{ runner.os }} == "Linux"
208207
shell: bash
@@ -282,11 +281,9 @@ jobs:
282281
python-version: ${{ matrix.python-version }}
283282
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
284283
run: |
285-
pip install --upgrade --upgrade-strategy eager pip setuptools wheel ;
286-
pip install --upgrade --upgrade-strategy eager -r ./requirements.txt ;
287-
pip install --upgrade --upgrade-strategy eager pytest ;
288-
pip install --upgrade --upgrade-strategy eager pytest-cov ;
289-
pip install --upgrade --upgrade-strategy eager coverage ;
284+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
285+
pip install -r ./requirements.txt ;
286+
pip install --user -r ./test-requirements.txt || true ;
290287
- name: Install code-climate tools for ${{ matrix.python-version }}
291288
if: ${{ runner.os }} == "Linux"
292289
shell: bash
@@ -357,11 +354,9 @@ jobs:
357354
python-version: "3.10"
358355
- name: Install dependencies for python Linters
359356
run: |
360-
pip install --upgrade pip setuptools wheel
357+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
361358
pip install -r ./requirements.txt ;
362-
pip install flake8 ;
363-
pip install pyflakes ;
364-
pip install pep8 ;
359+
pip install --user -r ./test-requirements.txt || true ;
365360
- name: Pre-Clean
366361
id: clean
367362
run: make -j1 -f Makefile clean || true ;
@@ -403,11 +398,9 @@ jobs:
403398
python-version: ${{ matrix.python-version }}
404399
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
405400
run: |
406-
pip install --upgrade pip setuptools wheel
401+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
407402
pip install -r ./requirements.txt ;
408-
pip install coverage ;
409-
pip install pytest ;
410-
pip install pytest-cov ;
403+
pip install --user -r ./test-requirements.txt || true ;
411404
- name: Install code-climate tools for ${{ matrix.python-version }}
412405
if: ${{ runner.os }} != "Linux"
413406
run: |
@@ -477,15 +470,9 @@ jobs:
477470
python-version: "3.10"
478471
- name: Install dependencies for Tox
479472
run: |
480-
pip install --upgrade pip setuptools wheel tox
473+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" "tox>=3.0";
481474
pip install -r ./requirements.txt ;
482-
pip install coverage ;
483-
pip install codecov ;
484-
pip install flake8 ;
485-
pip install pyflakes ;
486-
pip install pep8 ;
487-
pip install tox ;
488-
pip install six ;
475+
pip install --user -r ./test-requirements.txt || true ;
489476
- name: Pre-Clean
490477
id: clean
491478
run: make -j1 -f Makefile clean || true ;

test-requirements.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#python
2+
# time - builtin - PSF licence
3+
# re - builtin - PSF licence?
4+
# subprocess - PSF licence
5+
# sphinx
6+
# argparse - builtin - PSF licence
7+
argparse>=1.4.0
8+
# argparse - builtin - PSF licence
9+
setuptools>=38.0
10+
# virtualenv - MIT
11+
virtualenv>=15.0.1
12+
# six - MIT
13+
six>=1.0.0
14+
# pgpy - BSD 3-Clause licensed
15+
#pgpy>=0.4.1
16+
tox>=3.0.0
17+
#py>=1.4.33
18+
# pip>=19.0
19+
###
20+
# TESTING ONLY - Do NOT report issues with these optionals on python-repo
21+
###
22+
flake8>=5.0
23+
pyflakes>=2.5.0
24+
pep8>=1.0
25+
pytest>=7
26+
pytest-checkdocs>=2.4
27+
pytest-cov>=5.0.0
28+
pytest-enabler>=3.2.0
29+
pytest-flake8>=1.0
30+
coverage >= 6.3
31+
pytest-cov >= 4.0.0;
32+
pytest-enabler >= 1.0.1
33+
wheel >= 0.37.0
34+
pip >= 21.0

0 commit comments

Comments
 (0)