Skip to content

Commit 67e3510

Browse files
[PATCH] fetch cc test reporter tool as gist submodule (#82)
# Patch Notes ## Impacted GHI - [x] Closes #79 --- <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a flexible cleanup command and a standardized build configuration for enhanced automation. - Added a new submodule for the fetch-test-reporter functionality. - **Build & CI Improvements** - Streamlined job execution with dynamic environment settings and refined workflow conditions for more reliable deployments. - Simplified Python version specifications in CI workflows. - Enhanced the Makefile with new targets for building, testing, and cleaning. - Updated the CodeQL analysis workflow to include submodule support. - Added parameters for improved submodule handling in various CI workflows. - **Dependency Updates** - Updated and added dependencies to leverage modern tooling and improve performance and security. - **Documentation** - Corrected typographical errors to enhance clarity. - Expanded module-level documentation for improved usability. - **Tests** - Enhanced testing scripts with improved error handling, validation checks, and streamlined reporting. - Introduced new scripts for checking copyright lines and spelling errors. - Added new functions to improve the robustness of testing scripts. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 2322eab + 6f3ed58 commit 67e3510

25 files changed

+964
-462
lines changed

.appveyor.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@ image:
99
- Visual Studio 2022
1010
- Visual Studio 2019
1111
clone_depth: 50
12-
init:
12+
install:
13+
- cmd: >-
14+
choco install make || VER>NUL
15+
- cmd: >-
16+
choco install git || VER>NUL
17+
- cmd: >-
18+
choco install python --pre || VER>NUL
19+
20+
choco upgrade python --pre || VER>NUL
21+
- cmd: >-
22+
python -m pip install flake8 || VER>NUL
23+
24+
python -m pip install coverage || VER>NUL
25+
- cmd: >-
26+
choco install codecov || VER>NUL
27+
before_build:
1328
- cmd: >-
14-
choco install make || VER>NUL
29+
git submodule sync || VER>NUL
1530
16-
choco install git || VER>NUL
17-
18-
choco install python --pre || VER>NUL
19-
20-
choco upgrade python --pre || VER>NUL
21-
22-
python -m pip install flake8 || VER>NUL
23-
24-
python -m pip install coverage || VER>NUL
25-
26-
choco install codecov || VER>NUL
31+
git submodule update --init || VER>NUL
2732
2833
dir
2934
build_script:

.circleci/config.yml

+75-75
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,130 @@
1-
version: 2
1+
---
2+
version: 2.1
3+
commands:
4+
cleanup:
5+
steps:
6+
- run:
7+
shell: /bin/bash
8+
name: "Cleanup"
9+
command: |
10+
make clean
11+
when: always
12+
reposync:
13+
steps:
14+
- run:
15+
shell: /bin/bash
16+
name: "Fetch"
17+
command: |
18+
git fetch --all ;
19+
when: always
20+
- run:
21+
shell: /bin/bash
22+
name: "Sync Submodules"
23+
command: |
24+
git submodule sync ;
25+
when: on_success
26+
- run:
27+
shell: /bin/bash
28+
name: "Update Submodules"
29+
command: |
30+
git submodule update --init ;
31+
when: on_success
32+
33+
parameters:
34+
python-version:
35+
type: string
36+
default: "3.12"
37+
238
jobs:
339
build:
440
docker:
5-
- image: cimg/python:3.7
6-
- image: cimg/python:3.8
7-
- image: cimg/python:3.9
8-
- image: cimg/python:3.10
9-
- image: cimg/python:3.11
10-
- image: cimg/python:3.12
41+
- image: cimg/python:<< pipeline.parameters.python-version >>
42+
resource_class: medium
1143
environment:
1244
CI: cicleci
1345
DEBIAN_FRONTEND: noninteractive
1446
LANG: en_US.UTF-8
15-
LC_CTYPE: en_EN.UTF-8
47+
LC_CTYPE: en_US.UTF-8
1648
SHELL: /bin/bash
1749
working_directory: ~/python-repo
1850
steps:
1951
- checkout
20-
- run:
21-
name: "fetch and pull"
22-
command: |
23-
git fetch && git pull --all || true
52+
- reposync
2453
- run:
2554
shell: /bin/bash
2655
name: "install depends attempt"
2756
command: |
28-
python3 -m pip install --user -r ./requirements.txt || true
57+
python3 -m pip install --user -r ./requirements.txt || : ;
2958
when: on_success
3059
- run:
3160
shell: /bin/bash
32-
name: "install test extras attempt"
61+
name: "install test depends attempt"
3362
command: |
34-
python3 -m pip install --user -r ./test-requirements.txt || true
63+
python3 -m pip install --upgrade --user -r ./test-requirements.txt || : ;
64+
when: on_success
3565
- save_cache:
3666
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
3767
paths:
3868
- ~/python-repo
3969

4070
test:
4171
docker:
42-
- image: cimg/python:3.7
43-
- image: cimg/python:3.8
44-
- image: cimg/python:3.9
45-
- image: cimg/python:3.10
46-
- image: cimg/python:3.11
47-
- image: cimg/python:3.12
72+
- image: cimg/python:<< pipeline.parameters.python-version >>
4873
parallelism: 2
74+
resource_class: medium
4975
environment:
5076
CI: cicleci
5177
DEBIAN_FRONTEND: noninteractive
5278
LANG: en_US.UTF-8
53-
LC_CTYPE: en_EN.UTF-8
79+
LC_CTYPE: en_US.UTF-8
5480
SHELL: /bin/bash
5581
working_directory: ~/python-repo
5682
steps:
5783
- restore_cache:
5884
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
5985
- run:
6086
shell: /bin/bash
61-
name: "clean up for test"
87+
name: "Installing deps for test"
6288
command: |
63-
make clean
64-
when: always
89+
python3 -m pip install --upgrade --user -r ./test-requirements.txt || : ;
90+
when: on_success
91+
- cleanup
6592
- run:
6693
shell: /bin/bash
6794
name: "Unit Tests"
6895
command: |
6996
make test
7097
when: on_success
71-
- run:
72-
shell: /bin/bash
73-
name: "clean up from test"
74-
command: |
75-
make clean
76-
when: always
77-
- run:
78-
shell: /bin/bash
79-
name: "clean up from FAIL"
80-
command: |
81-
make clean
82-
when: on_fail
98+
- cleanup
8399

84100
pytest:
85101
docker:
86-
- image: cimg/python:3.7
87-
- image: cimg/python:3.8
88-
- image: cimg/python:3.9
89-
- image: cimg/python:3.10
90-
- image: cimg/python:3.11
91-
- image: cimg/python:3.12
102+
- image: cimg/python:<< pipeline.parameters.python-version >>
92103
parallelism: 2
104+
resource_class: medium
93105
environment:
94106
CI: cicleci
95107
DEBIAN_FRONTEND: noninteractive
96108
LANG: en_US.UTF-8
97-
LC_CTYPE: en_EN.UTF-8
109+
LC_CTYPE: en_US.UTF-8
98110
SHELL: /bin/bash
99111
working_directory: ~/python-repo
100112
steps:
101113
- restore_cache:
102114
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
103115
- run:
104116
shell: /bin/bash
105-
name: "setup up for pytest"
117+
name: "set up depends"
106118
command: |
107-
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
119+
python3 -m pip install --upgrade --user -r ./requirements.txt || : ;
108120
when: on_success
109121
- run:
110122
shell: /bin/bash
111-
name: "clean up for pytest"
123+
name: "install test-reqs attempt"
112124
command: |
113-
make clean
114-
when: always
125+
python3 -m pip install --upgrade --user -r ./test-requirements.txt || : ;
126+
when: on_success
127+
- cleanup
115128
- run:
116129
shell: /bin/bash
117130
name: "pytest Unit Tests"
@@ -124,55 +137,41 @@ jobs:
124137
- store_artifacts:
125138
path: test-reports
126139
when: on_success
127-
- run:
128-
shell: /bin/bash
129-
name: "clean up from pytest"
130-
command: |
131-
make clean
132-
when: always
133-
- run:
134-
shell: /bin/bash
135-
name: "clean up from FAIL"
136-
command: |
137-
make clean
138-
when: on_fail
140+
- cleanup
139141

140142
lint:
141143
docker:
142-
- image: cimg/python:3.11
144+
- image: cimg/python:<< pipeline.parameters.python-version >>
145+
resource_class: medium
143146
environment:
144147
CI: cicleci
145148
DEBIAN_FRONTEND: noninteractive
146149
LANG: en_US.UTF-8
147150
SHELL: /bin/bash
148-
LC_CTYPE: en_EN.UTF-8
151+
LC_CTYPE: en_US.UTF-8
149152
working_directory: ~/python-repo
150153
steps:
151154
- restore_cache:
152155
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
153156
- run:
154-
name: "install linters extras attempt"
157+
name: "install reqs attempt"
155158
command: |
156-
python3 -m pip install --upgrade --user -r ./test-requirements.txt || true
159+
python3 -m pip install --user -r ./requirements.txt || : ;
157160
- run:
158-
shell: /bin/bash
159-
name: "clean up for test"
161+
name: "install test-reqs attempt"
160162
command: |
161-
make clean
163+
python3 -m pip install --user -r ./test-requirements.txt || : ;
164+
- cleanup
162165
- run:
163166
shell: /bin/bash
164167
name: "check code style and spelling"
165168
command: |
166-
make test-style || python3 -m flake8 --ignore=W191,W391,E117 --max-line-length=100 --verbose --count --config=.flake8.ini --max-complexity=10
167-
- run:
168-
shell: /bin/bash
169-
name: "clean up when done"
170-
command: |
171-
make clean
169+
make test-style || python3 -m flake8 --verbose --count --config=.flake8.ini
170+
- cleanup
172171

173172
workflows:
174173
version: 2
175-
workflow:
174+
test-matrix:
176175
jobs:
177176
- build
178177
- test:
@@ -184,3 +183,4 @@ workflows:
184183
- pytest:
185184
requires:
186185
- build
186+
- test

.codecov.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ coverage:
3939
github_checks:
4040
annotations: true
4141
flags:
42+
pythonrepo:
43+
paths:
44+
- "pythonrepo/"
4245
tests:
4346
paths:
44-
- tests
47+
- "tests/"
48+
- "!pythonrepo/"

.coveragerc

+38-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,56 @@
11
[run]
2+
concurrency = multiprocessing
23
parallel = True
4+
sigterm = True
5+
# enable if you want to consider branches in coverage
6+
# branch = True
37

48
[report]
5-
include = pythonrepo*,tests*
9+
include = pythonrepo/*
610
# Regexes for lines to exclude from consideration
711
exclude_lines =
812
# Have to re-enable the standard pragma
913
pragma: no cover
14+
pass
15+
except ImportError
16+
except ModuleNotFoundError
1017
except Exception
11-
except BaseException:
18+
except BaseException
19+
except UnicodeDecodeError
1220
# Don't complain if tests don't hit defensive assertion code:
1321
raise AssertionError
1422
raise NotImplementedError
1523
raise ImportError
24+
raise ModuleNotFoundError
1625
except unittest.SkipTest
17-
except IOError
18-
except OSError
19-
26+
except ..Error
2027
# Don't complain if non-runnable code isn't run:
21-
if __name__ in '__main__':
28+
if __name__ .. .__main__.:
29+
if __name__ in u'__main__':
30+
if __name__ in u"__main__":
31+
os.abort()
32+
exit
2233

2334
ignore_errors = True
2435

36+
partial_branches =
37+
# Have to re-enable the standard pragma rules
38+
pragma: no branch
39+
skipcq: PYL-
40+
finally:
41+
@
42+
except unittest.SkipTest
43+
self.skipTest
44+
self.fail
45+
# Don't complain if non-runnable code isn't run:
46+
if __name__ in u'__main__':
47+
if __name__ in u"__main__":
48+
if __name__ in '__main__':
49+
if __sys_path__ not in sys.path:
50+
# don't complain about sys.modules
51+
sys.modules
52+
not in sys.modules:
53+
if context.__name__ is None:
54+
if 'os' not in sys.modules:
55+
if 'os.path' not in sys.modules:
56+
if 'argparse' not in sys.modules:

.flake8.ini

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[flake8]
2-
select = C,E,F,W,B,B950
2+
select = C,D,E,F,W,B,B950
33
# Ignore specific warnings and errors according to CEP-8 style
4-
extend-ignore =
5-
W191, # Indentation contains tabs
6-
W391, # Blank line at end of file
7-
E117, # Over-indented
8-
D208, # Docstring is over-indented
9-
D203, # 1 blank line required before class docstring - CEP-7
10-
D212, # Multi-line docstring summary should start at the first line - CEP-7
4+
extend-ignore = E117,D203,D208,D212,W191,W391
5+
# CEP-8 Custom Exceptions:
6+
# W191, # Indentation contains tabs
7+
# W391, # Blank line at end of file
8+
# E117, # Over-indented
9+
# D208, # Docstring is over-indented
10+
# D203, # 1 blank line required before class docstring - CEP-7
11+
# D212, # Multi-line docstring summary should start at the first line - CEP-7
1112
# Ignore long lines as specified in CEP-8
1213
max-line-length = 100
1314
extend-exclude =

0 commit comments

Comments
 (0)