Skip to content

Commit 6c9054b

Browse files
[TESTS] Initial hardening with pinned dependencies (- WIP #40 -)
* [TESTS] Initial hardening with pinned dependencies (- WIP #40 -) Notible change: introduced a new config for test environment's dependancies with `test-requirements.txt` Squashes the following changes: * [REGRESSION] Revert test-requirement of pytest-cov back down to v4+ to continue to support Python 3.7 in CI * [REGRESSION] revert pytyest-enabler back to v1.0.1 in CI to continue support of pre-v3.8 python (- WIP #40 -) * [TESTS] Testing prototype tool to fetch and verify the cc-test-reporter (- WIP #40 -) - Testing only AMD64 for linux and darwin latest. Once working we can look at figuring out arm64. * [REGRESSION] chmod 755 new tool 🙉 (- WIP #40 -) * [STYLE] numerous style fixes to satisfy shellcheck and improve consistancy (- WIP #74 -) * [REGRESSION] fix syntax by reverting - back to a working CI (- WIP #74 -)
1 parent d288e89 commit 6c9054b

File tree

4 files changed

+238
-72
lines changed

4 files changed

+238
-72
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: 28 additions & 50 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 -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 -r ./test-requirements.txt || true
156157
- name: Pre-Clean
157158
id: clean
158159
run: make -j1 -f Makefile clean || true ;
@@ -198,23 +199,18 @@ 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 -r ./test-requirements.txt || true
206205
- name: Install code-climate tools for ${{ matrix.python-version }}
207-
if: ${{ runner.os }} == "Linux"
206+
if: ${{ runner.os }} != "Linux"
208207
shell: bash
209-
run: |
210-
if [ $OS == ubuntu-latest ] ; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ; fi ;
211-
if [ $OS == ubuntu-latest ] ; then chmod +x ./cc-test-reporter 2>/dev/null || true ; fi
212-
if [ $OS == ubuntu-latest ] ; then ./cc-test-reporter before-build || true ; fi
208+
run: if [ "$OS" == "macos-latest" ] ; then ./tests/fetch_cc-test-reporter || true ; fi ;
213209
- name: Install deepsource tools for ${{ matrix.python-version }}
214210
if: ${{ runner.os }} == "Linux"
215211
shell: bash
216212
run: |
217-
if [ $OS == ubuntu-latest ] ; then (curl https://deepsource.io/cli | sh) || true ; else echo "SKIP deepsource" ; fi ;
213+
if [ "$OS" == "ubuntu-latest" ] ; then (curl https://deepsource.io/cli | sh) || true ; else echo "SKIP deepsource" ; fi ;
218214
- name: Pre-Clean
219215
id: clean
220216
run: make -j1 -f Makefile clean || true ;
@@ -241,15 +237,15 @@ jobs:
241237
path: ./test-reports/
242238
if-no-files-found: ignore
243239
- name: code-climate for ${{ matrix.python-version }}
244-
if: ${{ runner.os }} == "Linux"
240+
if: ${{ runner.os }} != "Linux"
245241
shell: bash
246242
run: |
247-
if [ $OS == ubuntu-latest ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
243+
if [ "$OS" == "macos-latest" ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
248244
- name: deepsource for ${{ matrix.python-version }}
249245
if: ${{ runner.os }} == "Linux"
250246
shell: bash
251247
run: |
252-
if [ $OS == ubuntu-latest ] ; then ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; else echo "SKIP deepsource" ; fi ;
248+
if [ "$OS" == "ubuntu-latest" ] ; then ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; else echo "SKIP deepsource" ; fi ;
253249
- name: Post-Clean
254250
id: post
255251
run: make -j1 -f Makefile clean || true ;
@@ -282,23 +278,18 @@ jobs:
282278
python-version: ${{ matrix.python-version }}
283279
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
284280
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 ;
281+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
282+
pip install -r ./requirements.txt ;
283+
pip install -r ./test-requirements.txt || true ;
290284
- name: Install code-climate tools for ${{ matrix.python-version }}
291285
if: ${{ runner.os }} == "Linux"
292286
shell: bash
293-
run: |
294-
if [ $OS == ubuntu-latest ] ; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ; fi ;
295-
if [ $OS == ubuntu-latest ] ; then chmod +x ./cc-test-reporter 2>/dev/null || true ; fi
296-
if [ $OS == ubuntu-latest ] ; then ./cc-test-reporter before-build || true ; fi
287+
run: if [ "$OS" == "ubuntu-latest" ] ; then ./tests/fetch_cc-test-reporter || true ; fi ;
297288
- name: Install deepsource tools for ${{ matrix.python-version }}
298289
if: ${{ runner.os }} == "Linux"
299290
shell: bash
300291
run: |
301-
if [ $OS == ubuntu-latest ] ; then (curl https://deepsource.io/cli | sh) || true ; else echo "SKIP deepsource" ; fi ;
292+
if [ "$OS" == "ubuntu-latest" ] ; then (curl https://deepsource.io/cli | sh) || true ; else echo "SKIP deepsource" ; fi ;
302293
- name: Pre-Clean
303294
id: clean
304295
run: make -j1 -f Makefile clean || true ;
@@ -328,12 +319,12 @@ jobs:
328319
if: ${{ runner.os }} == "Linux"
329320
shell: bash
330321
run: |
331-
if [ $OS == ubuntu-latest ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
322+
if [ "$OS" == "ubuntu-latest" ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
332323
- name: deepsource for ${{ matrix.python-version }}
333324
if: ${{ runner.os }} == "Linux"
334325
shell: bash
335326
run: |
336-
if [ $OS == ubuntu-latest ] ; then ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; else echo "SKIP deepsource" ; fi ;
327+
if [ "$OS" == "ubuntu-latest" ] ; then ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; else echo "SKIP deepsource" ; fi ;
337328
- name: Post-Clean
338329
id: post
339330
run: make -j1 -f Makefile clean || true ;
@@ -357,11 +348,9 @@ jobs:
357348
python-version: "3.10"
358349
- name: Install dependencies for python Linters
359350
run: |
360-
pip install --upgrade pip setuptools wheel
351+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
361352
pip install -r ./requirements.txt ;
362-
pip install flake8 ;
363-
pip install pyflakes ;
364-
pip install pep8 ;
353+
pip install -r ./test-requirements.txt || true ;
365354
- name: Pre-Clean
366355
id: clean
367356
run: make -j1 -f Makefile clean || true ;
@@ -403,17 +392,12 @@ jobs:
403392
python-version: ${{ matrix.python-version }}
404393
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
405394
run: |
406-
pip install --upgrade pip setuptools wheel
395+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" ;
407396
pip install -r ./requirements.txt ;
408-
pip install coverage ;
409-
pip install pytest ;
410-
pip install pytest-cov ;
397+
pip install -r ./test-requirements.txt || true ;
411398
- name: Install code-climate tools for ${{ matrix.python-version }}
412399
if: ${{ runner.os }} != "Linux"
413-
run: |
414-
if [ $OS == macos-latest ] ; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter || true ; fi ;
415-
if [ $OS == macos-latest ] ; then chmod +x ./cc-test-reporter 2>/dev/null || true ; fi
416-
if [ $OS == macos-latest ] ; then ./cc-test-reporter before-build || true ; fi
400+
run: if [ $OS == macos-latest ] ; then ./tests/fetch_cc-test-reporter || true ; fi ;
417401
shell: bash
418402
- name: Pre-Clean
419403
id: clean-prep
@@ -448,7 +432,7 @@ jobs:
448432
- name: code-climate for ${{ matrix.python-version }}
449433
if: ${{ runner.os }} != "Linux"
450434
run: |
451-
if [ $OS == macos-latest ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
435+
if [ "$OS" == "macos-latest" ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "SKIP code climate" ; fi ;
452436
- name: Post-purge
453437
id: post-uninstall
454438
run: make -j1 -f Makefile purge || true ;
@@ -477,15 +461,9 @@ jobs:
477461
python-version: "3.10"
478462
- name: Install dependencies for Tox
479463
run: |
480-
pip install --upgrade pip setuptools wheel tox
464+
pip install --upgrade "pip>=21.0" "setuptools>=45.0" "wheel>=0.37" "tox>=3.0";
481465
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 ;
466+
pip install -r ./test-requirements.txt || true ;
489467
- name: Pre-Clean
490468
id: clean
491469
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>=4.0.0
28+
pytest-enabler>=1.0.1
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)