Skip to content

Commit 0dc4fc4

Browse files
[PATCH] Various pre-release chores (- WIP #365 -)
Changes in file .github/CODE_OF_CONDUCT.md: * Style refactoring Changes in file .github/ISSUE_TEMPLATE.md: * Style refactoring Changes in file .github/ISSUE_TEMPLATE/bug_report.md: * Style refactoring Changes in file .github/PULL_REQUEST_TEMPLATE.md: * Minor updates * Style refactoring Changes in file .github/workflows/Tests.yml: * More tweaks for GHI #365 related to coverage * split off DOCTESTS job * related work Changes in file Makefile: * related work Changes in file tests/__init__.py: * related work Changes in file tests/check_integration_coverage: * related work Changes in file tests/test_basic.py: * style changes Changes in file tests/test_build.py: * related work Changes in file tests/test_extra.py: * test-case regression fix Changes in file tests/test_fuzz.py: * edge-case regression fix
1 parent 8e3f2dc commit 0dc4fc4

File tree

12 files changed

+231
-74
lines changed

12 files changed

+231
-74
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Examples of unacceptable behavior by participants include:
2525
* Publishing others' private information, such as a physical or electronic
2626
address, without explicit permission
2727
* Unethical, malicious, or other 'Black-hat' hacking activity that harms the
28-
overall security of the project
28+
overall security of the project
2929
* The use of sexualized language or imagery and unwelcome sexual attention or
30-
advances
30+
advances
3131
* Trolling, insulting/derogatory comments, and personal or political attacks
3232
* Public or private harassment
3333
* Other conduct which could reasonably be considered inappropriate in a

.github/ISSUE_TEMPLATE.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
1-
>> Your Issue may have already been reported!
2-
>> Please check the [list of issues](../) before creating a new one.
1+
> Your Issue may have already been reported!
2+
> Please check the [list of issues](../) before creating a new one.
33
44
## Basic Info
5-
>> When reporting an issue, please list the version of Python Multicast Library you are using and any relevant information about your software environment:
6-
- Python version:
7-
>> `python3 --version || python --version`
8-
- OS type
9-
>> `uname -a`
10-
- [ ] linux
11-
- [ ] MacOS (darwin)
12-
- `multicast` version:
13-
>> `python3 -m multicast --version`
145

6+
> When reporting an issue, please list the version of Python Multicast Library you are using and
7+
> any relevant information about your software environment:
8+
> - Python version:
9+
>> `python3 --version || python --version`
10+
> - OS type
11+
>> `uname -a`
12+
> - [ ] Linux
13+
> - [ ] MacOS (darwin)
14+
> - `multicast` version:
15+
>> `python3 -m multicast --version`
1516
17+
## Steps to Reproduce Issue
1618

17-
## Steps to Reproduce Issue:
19+
> Avoid vague language like "it doesn't work." Please describe as specifically as you can what
20+
> behavior you are actually seeing (eg: an error message? a nil return value?).
1821
19-
>> Avoid vague language like "it doesn't work." Please describe as specifically as you can what behavior you are actually seeing (eg: an error message? a nil return value?).
2022
1.
2123
2.
2224
3.
2325
4.
2426

25-
## Logs (If Available):
26-
>> Please attach any logs from Multicast relevant to the bug.
27+
## Logs
28+
29+
*(If Available)*
30+
31+
> Please attach any logs from Multicast relevant to the bug.
2732
33+
## Additional Information
2834

29-
## Additional Information:
30-
>> Anything else relevant to this issue.
35+
> Anything else relevant to this issue.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: Bug, Failing
5+
labels: Bug
66
assignees: reactive-firewall
77

88
---
@@ -12,6 +12,7 @@ A clear and concise description of what the bug is.
1212

1313
**To Reproduce**
1414
Steps to reproduce the behavior:
15+
1516
1. Go to '...'
1617
2. Click on '....'
1718
3. Scroll down to '....'
@@ -26,11 +27,22 @@ If applicable, add logs here to help explain your problem.
2627
**Screenshots** _(optional)_
2728
If applicable, add screenshots to help explain your problem.
2829

29-
**PiAP Device (please complete the following information):**
30-
- OS: [e.g. macOS]
31-
- OS Version: [e.g. 22]
32-
- Python Version [e.g. 3.12] _(optional)_
33-
- Multicast Python Library Version: [e.g. v0.5.0]
30+
**Device (please complete the following information)**
31+
32+
* Python Version: _e.g. 3.14_
33+
34+
> `python3 --version || python --version`
35+
36+
* OS type
37+
- [ ] Linux
38+
- [ ] MacOS (darwin)
39+
40+
> `uname -s`
41+
42+
* OS Version: _e.g. 24_
43+
* `Multicast` Library Version: _e.g. v2.1.0_
44+
45+
> `python3 -m multicast --version`
3446
3547
**Additional context** _(optional)_
3648
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,69 @@
1-
# Reviewing:
1+
# TEMPLATE
22

3-
This is the checklist that I try to go through for every single pull request that I get. If you're wondering why it takes so long for me to accept pull requests, this is why.
3+
> Here is a basic PR template. (remove instructions and this line and above before marking ready)
4+
5+
# Patch Notes
6+
7+
## Impacted GHI
8+
9+
- [x] Closes _ID_
10+
- [x] Contributes to _ID_
11+
- [ ] Opens _ID_
12+
13+
14+
## Included and Superseded PR/MRs
15+
16+
* Supersedes _ID_
17+
* Includes and Supersedes _ID_
18+
19+
---
20+
21+
<details><summary>Release Instructions</summary>
22+
23+
# Reviewing Instructions
24+
25+
This is the checklist that I try to go through for every single pull request that I get.
26+
If you're wondering why it takes so long for me to accept pull requests, this is why.
427

528
## General
629

730
- [ ] Is this change useful to me, or something that I think will benefit others greatly?
831
- [ ] Check for overlap with other PRs.
9-
- [ ] Think carefully about the long-term implications of the change. How will it affect existing projects that are dependent on this? How will it affect my projects? If this is complicated, do I really want to maintain it forever? Is there any way it could be implemented as a separate package, for better modularity and flexibility?
32+
- [ ] Think carefully about the long-term implications of the change.
33+
How will it affect existing projects that are dependent on this?
34+
How will it affect my projects?
35+
If this is complicated, do I really want to maintain it forever?
36+
Is there any way it could be implemented as a separate package,
37+
for better modularity and flexibility?
1038

1139
## Check the Code
1240

1341
- [ ] If it does too much, ask for it to be broken up into smaller PRs.
1442
- [ ] Does it pass `make test-style` (flake8, etc.)?
1543
- [ ] Is it consistent?
16-
- [ ] Review the changes carefully, line by line. Make sure you understand every single part of every line. Learn whatever you do not know yet.
17-
- [ ] Take the time to get things right. PRs almost always require additional improvements to meet the bar for quality. Be very strict about quality. This usually takes several commits on top of the original PR.
44+
- [ ] Review the changes carefully, line by line.
45+
Make sure you understand every single part of every line.
46+
Learn whatever you do not know yet.
47+
- [ ] Take the time to get things right.
48+
PRs almost always require additional improvements to meet the bar for quality.
49+
Be very strict about quality. This usually takes several commits on top of the original PR.
1850

1951
## Check the Tests
2052

2153
- [ ] Does it have tests? If not:
2254

23-
- [ ] Comment on the PR "Can you please add tests for this code to `tests/test_blah.py`", or...
24-
- [ ] Write the tests yourself.
55+
- [ ] Comment on the PR "Can you please add tests for this code to `tests/test_blah.py`", or...
56+
- [ ] Write the tests yourself.
2557

26-
- [ ] Do the tests pass for all of the CI tests? If not, write a note in the PR to fix CI, or fix them yourself.
58+
- [ ] Do the tests pass for all of the CI tests? If not, write a note in the PR to fix CI,
59+
or fix them yourself.
2760

2861
## Check the Docs
2962

3063
- [ ] Does it have docs? If not:
3164

32-
- [ ] Comment on the PR "Can you please add docs for this feature to the wiki", or...
33-
- [ ] Write the docs yourself.
65+
- [ ] Comment on the PR "Can you please add docs for this feature to the wiki", or...
66+
- [ ] Write the docs yourself.
3467

3568
- [ ] If any new functions/classes are added, do they contain docstrings?
3669

@@ -42,10 +75,14 @@ This is the checklist that I try to go through for every single pull request tha
4275
## Close Issues
4376

4477
- [ ] Merge the PR branch. This will close the PR's issue.
45-
- [ ] Close any duplicate or related issues that can now be closed. Write thoughtful comments explaining how the issues were resolved.
78+
- [ ] Close any duplicate or related issues that can now be closed.
79+
Write thoughtful comments explaining how the issues were resolved.
4680

4781
## Release (optional)
4882

4983
- [ ] Decide whether the changes in master make sense as a major, minor, or patch release.
50-
- [ ] Look at the clock. If you're tired, release later when you have time to deal with release problems.
84+
- [ ] Look at the clock. If you're tired, release later,
85+
when you have time to deal with release problems.
5186
- [ ] Then follow all the steps in [Release Checklist]
87+
88+
</details>

.github/workflows/Tests.yml

Lines changed: 109 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ jobs:
8181
COV_CORE_SOURCE: ./
8282
COV_CORE_CONFIG: ./.coveragerc
8383
COV_CORE_DATAFILE: ./coverage.xml
84-
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
85-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
86-
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
8784
steps:
8885
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8986
- name: Set up Python ${{ matrix.python-version }}
@@ -97,13 +94,18 @@ jobs:
9794
- name: Install code-climate tools for ${{ matrix.python-version }} on ${{ matrix.os }}
9895
if: ${{ !cancelled() && runner.os == 'Linux' }}
9996
shell: bash
97+
env:
98+
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
99+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
100100
run: |
101101
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ;
102102
chmod +x ./cc-test-reporter 2>/dev/null || true ;
103103
./cc-test-reporter before-build || true ;
104104
- name: Install deepsource tools for ${{ matrix.python-version }} on ${{ matrix.os }}
105105
if: ${{ !cancelled() && runner.os == 'Linux' }}
106106
shell: bash
107+
env:
108+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
107109
run: |
108110
(curl https://deepsource.io/cli | sh) || true ;
109111
- name: Pre-Clean
@@ -112,9 +114,7 @@ jobs:
112114
- name: Generate Test Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
113115
env:
114116
TESTS_USE_PYTEST: 1
115-
run: make -f Makefile test >> $GITHUB_STEP_SUMMARY ;
116-
- name: Generate Doctest Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
117-
run: make -f Makefile test-mat-doctests ;
117+
run: make -f Makefile test >> "$GITHUB_STEP_SUMMARY" ;
118118
- name: Upload Python ${{ matrix.python-version }} test coverage to Codecov
119119
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
120120
with:
@@ -127,6 +127,101 @@ jobs:
127127
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}
128128
verbose: true
129129
fail_ci_if_error: false
130+
- name: Upload Python ${{ matrix.python-version }} second flag coverage to Codecov
131+
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
132+
with:
133+
token: ${{ secrets.CODECOV_TOKEN }}
134+
job_code: ${{ github.run_id }}-${{ github.run_number }}
135+
files: ./coverage.xml,./test-reports/coverage.xml
136+
directory: .
137+
env_vars: OS,PYTHON_VERSION
138+
flags: multicast
139+
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}-merge
140+
verbose: true
141+
fail_ci_if_error: false
142+
- name: Upload Python ${{ matrix.python-version }} Artifact
143+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144+
with:
145+
name: Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
146+
path: ./test-reports/
147+
if-no-files-found: ignore
148+
- name: code-climate for ${{ matrix.python-version }} on ${{ matrix.os }}
149+
if: ${{ !cancelled() && runner.os == 'Linux' }}
150+
shell: bash
151+
env:
152+
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
153+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
154+
run: |
155+
./cc-test-reporter after-build --exit-code 0 || true ;
156+
- name: deepsource for ${{ matrix.python-version }} on ${{ matrix.os }}
157+
if: ${{ !cancelled() && runner.os == 'Linux' }}
158+
shell: bash
159+
env:
160+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
161+
run: |
162+
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ;
163+
- name: Post-Clean
164+
id: post
165+
run: make -j1 -f Makefile clean || true ;
166+
if: ${{ always() }}
167+
168+
169+
DOCTESTS:
170+
permissions:
171+
actions: read
172+
contents: read
173+
statuses: write
174+
packages: none
175+
pull-requests: read
176+
security-events: none
177+
environment: ${{ needs.check_mats.outputs.mats_environment }}
178+
if: ${{ !cancelled() && (needs.check_mats.outputs.should_run == 'true') }}
179+
needs: [check_mats]
180+
runs-on: ${{ matrix.os }}
181+
timeout-minutes: 10
182+
strategy:
183+
matrix:
184+
os: [ubuntu-latest, macos-latest, windows-latest]
185+
python-version: ["${{ vars.PYTHON_OLD_MIN }}", "${{ vars.PYTHON_OLD_EXTRA }}", "${{ vars.PYTHON_DEFAULT }}", "${{ vars.PYTHON_EXPERIMENTAL }}"]
186+
env:
187+
OS: ${{ matrix.os }}
188+
PYTHON_VERSION: ${{ matrix.python-version }}
189+
LANG: "en_US.utf-8"
190+
COVERAGE_RCFILE: ./.coveragerc
191+
COV_CORE_SOURCE: ./
192+
COV_CORE_CONFIG: ./.coveragerc
193+
steps:
194+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
195+
- name: Set up Python ${{ matrix.python-version }}
196+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
197+
with:
198+
python-version: ${{ matrix.python-version }}
199+
- name: Fix braindead windows ${{ matrix.python-version }} on ${{ matrix.os }}
200+
uses: ./.github/actions/upgrade-windows-pip
201+
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
202+
run: make -f Makefile test-reqs || true ;
203+
- name: Install code-climate tools for ${{ matrix.python-version }} on ${{ matrix.os }}
204+
if: ${{ !cancelled() && runner.os == 'Linux' }}
205+
shell: bash
206+
env:
207+
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
208+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
209+
run: |
210+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ;
211+
chmod +x ./cc-test-reporter 2>/dev/null || true ;
212+
./cc-test-reporter before-build || true ;
213+
- name: Install deepsource tools for ${{ matrix.python-version }} on ${{ matrix.os }}
214+
if: ${{ !cancelled() && runner.os == 'Linux' }}
215+
shell: bash
216+
env:
217+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
218+
run: |
219+
(curl https://deepsource.io/cli | sh) || true ;
220+
- name: Pre-Clean
221+
id: clean
222+
run: make -j1 -f Makefile clean || true ;
223+
- name: Generate Doctest Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
224+
run: make -f Makefile test-mat-doctests ;
130225
- name: Upload Python ${{ matrix.python-version }} doctest coverage to Codecov
131226
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
132227
with:
@@ -142,17 +237,22 @@ jobs:
142237
- name: Upload Python ${{ matrix.python-version }} Artifact
143238
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
144239
with:
145-
name: Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
240+
name: DocTest-Report-${{ matrix.os }}-${{ matrix.python-version }}
146241
path: ./test-reports/
147242
if-no-files-found: ignore
148243
- name: code-climate for ${{ matrix.python-version }} on ${{ matrix.os }}
149244
if: ${{ !cancelled() && runner.os == 'Linux' }}
150245
shell: bash
246+
env:
247+
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
248+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
151249
run: |
152250
./cc-test-reporter after-build --exit-code 0 || true ;
153251
- name: deepsource for ${{ matrix.python-version }} on ${{ matrix.os }}
154252
if: ${{ !cancelled() && runner.os == 'Linux' }}
155253
shell: bash
254+
env:
255+
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
156256
run: |
157257
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ;
158258
- name: Post-Clean
@@ -217,7 +317,7 @@ jobs:
217317
security-events: none
218318
environment: ${{ needs.check_mats.outputs.mats_environment }}
219319
if: ${{ success() }}
220-
needs: [check_mats, COVERAGE]
320+
needs: [check_mats, COVERAGE, DOCTESTS]
221321
runs-on: ${{ matrix.os }}
222322
timeout-minutes: 10
223323
strategy:
@@ -337,7 +437,7 @@ jobs:
337437
pull-requests: read
338438
security-events: none
339439
environment: ${{ needs.check_mats.outputs.mats_environment }}
340-
if: ${{ success() }}
440+
if: ${{ !cancelled() && success() }}
341441
needs: [COVERAGE, STYLE]
342442
runs-on: ${{ matrix.os }}
343443
defaults:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ test-mat-doctests: test-reports MANIFEST.in ## Run doctests MAT category (doctes
281281
$(QUIET)$(WAIT) ; \
282282
$(COVERAGE) combine --keep --data-file=coverage_doctests ./.coverage.* 2>$(ERROR_LOG_PATH) || : ; \
283283
$(COVERAGE) report -m --include=* --data-file=coverage_doctests 2>$(ERROR_LOG_PATH) || : ; \
284-
$(COVERAGE) xml -o test-reports/coverage_doctests.xml --include=* --data-file=coverage_doctests 2>$(ERROR_LOG_PATH) || : ; \
284+
$(COVERAGE) xml -o test-reports/coverage_doctests.xml --include=multicast/* --data-file=coverage_doctests 2>$(ERROR_LOG_PATH) || : ; \
285285
fi
286286
$(QUIET)$(WAIT) ;
287287
$(QUIET)$(DO_FAIL) ;

0 commit comments

Comments
 (0)