Skip to content

Patch check_pip #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 15, 2024
Merged

Conversation

reactive-firewall
Copy link
Collaborator

No description provided.

### ChangeLog:

Changes in file tests/check_pip:
 handle_signals
Changes in file tests/check_pip:
 - now uses github anotation format
@reactive-firewall reactive-firewall self-assigned this Oct 12, 2024
@reactive-firewall reactive-firewall linked an issue Oct 12, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.023%. Comparing base (5a7c1c1) to head (a735cfb).
Report is 9 commits behind head on Feature-replace-stickler.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           Feature-replace-stickler      #162   +/-   ##
==========================================================
  Coverage                    98.023%   98.023%           
==========================================================
  Files                             6         6           
  Lines                           354       354           
  Branches                         21        21           
==========================================================
  Hits                            347       347           
  Misses                            3         3           
  Partials                          4         4           
Flag Coverage Δ
3.10 98.023% <100.000%> (ø)
3.11 98.023% <100.000%> (ø)
3.12 98.023% <100.000%> (ø)
macos-latest 98.023% <100.000%> (ø)
multicast 98.023% <100.000%> (ø)
ubuntu-latest 98.023% <100.000%> (ø)
windows-latest 85.311% <0.000%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
multicast/recv.py 98.667% <100.000%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a7c1c1...a735cfb. Read the comment docs.

### ChangeLog:

Changes in file .github/workflows/Tests.yml:
 jobs:

Changes in file tests/check_pip:
 FILES_TO_CHECK=$(git ls-tree -r --full-tree --name-only HEAD -- "${_TEST_ROOT_DI
 cleanup || rm -f ${LOCK_FILE} 2>/dev/null || : ;
 fi
 function handle_signals() {
### ChangeLog:

Changes in file requirements.txt:
 Unknown Changes

Changes in file tests/check_pip:
 function navigate_dirs_by_git() {
 handle_signals

Changes in file tests/requirements.txt:
 pytest-flake8>=1.0.7
@@ -31,7 +31,7 @@ setuptools>=75.0
# pip - MIT license
pip>=22.0
# build - MIT license
build>=1.1.1
build>=1.1.1, !=1.2.2.post1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai,
CI found found a test bug:

E AssertionError: Regex didn't match: '^\s*[a-zA-Z0-9_-.]+(?:,?\s?(?:==|!=|>=|<=|>|<)\s?[0-9.]+)+(?:\s*(?:#.*)?)$' not found in 'build>=1.2.1, !=1.2.2.post1' : Invalid requirement format at line 69: 'build>=1.2.1, !=1.2.2.post1'

this is coming from the test code in tests/test_deps.py around line 69.

The regular expression misses PEP-440 style a#, b#, rc#, .pre# and .post# suffixes.

Help me fix the regular expression.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reactive-firewall,

The current regular expression doesn't account for PEP-440 version suffixes like a#, b#, rc#, .pre#, and .post#. To fix this, we need to update the regex to accommodate these suffixes.

Here's an updated regex that should cover these cases:

r'^\s*[a-zA-Z0-9_\-\.]+(?:,?\s*(?:==|!=|>=|<=|>|<)\s*[0-9]+(?:\.[0-9]+)*(?:[a-zA-Z]+[0-9]*)?(?:\.[a-zA-Z]+[0-9]*)*)+(?:\s*(?:#.*)?)$'

This regex allows for:

  • Package names containing letters, numbers, underscores, hyphens, and dots.
  • One or more version specifiers, each potentially starting with a comma.
  • Version numbers that can include numbers and dots, followed by optional alphabetic suffixes (e.g., rc1, post1), and additional dot-separated segments.
  • Comments at the end of the line.

Please update the regular expression in tests/test_deps.py around line 69 with this updated version to fix the test failure.

I recall from previous learnings that requirements lines may include multiple version specifiers separated by commas, and that the regex should accommodate this format.

Let me know if you need any further assistance.


✏️ Learnings added
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#162
File: requirements.txt:34-34
Timestamp: 2024-10-15T08:52:00.534Z
Learning: When validating requirements files in `tests/test_deps.py`, ensure that the regex accounts for PEP-440 version suffixes such as `a#`, `b#`, `rc#`, `.pre#`, and `.post#`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-10-12T00:41:41.731Z
Learning: For future scripts, reactive-firewall prefers to use only POSIX built-ins (like `printf` instead of `echo`) to align with CEP-8 conventions.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-10-12T03:22:28.902Z
Learning: For future scripts, reactive-firewall prefers to keep the shebang line with an extra space (e.g., `#! /bin/bash`) as per project style.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#110
File: docs/CI.md:32-32
Timestamp: 2024-10-08T21:59:30.537Z
Learning: Reactive-firewall prefers to keep the word "own" in headings when emphasizing the reader's personal test.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#110
File: docs/CI.md:32-32
Timestamp: 2024-09-17T06:40:42.918Z
Learning: Reactive-firewall prefers to keep the word "own" in headings when emphasizing the reader's personal test.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-10-08T03:15:05.171Z
Learning: For future reviews, remember that when drafting or updating CEP documents, it's important to adhere to the project's standard format and include all relevant sections such as Motivation, Detailed Explanation, Implementation Guidelines, Impact, and References.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-10-08T21:59:30.537Z
Learning: For future reviews, remember that when drafting or updating CEP documents, it's important to adhere to the project's standard format and include all relevant sections such as Motivation, Detailed Explanation, Implementation Guidelines, Impact, and References.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#110
File: docs/USAGE.md:66-66
Timestamp: 2024-10-08T21:59:30.537Z
Learning: Reactive-firewall prefers to use "Caveat" as a heading instead of "Caution".

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#110
File: docs/USAGE.md:66-66
Timestamp: 2024-09-17T03:38:28.677Z
Learning: Reactive-firewall prefers to use "Caveat" as a heading instead of "Caution".

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#118
File: tests/check_pip:92-197
Timestamp: 2024-10-08T21:59:30.537Z
Learning: Reactive-firewall prefers defining functions before they are called in Bash scripts to avoid errors due to Bash's sequential interpretation.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#118
File: tests/check_pip:92-197
Timestamp: 2024-09-24T01:03:10.574Z
Learning: Reactive-firewall prefers defining functions before they are called in Bash scripts to avoid errors due to Bash's sequential interpretation.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#75
File: tests/test_deps.py:67-86
Timestamp: 2024-10-08T21:59:30.537Z
Learning: When testing the format of `tests/requirements.txt`, ensure that the regex pattern:
- Requires no whitespace directly before the comma.
- Excludes invalid operator combinations like `!!`, `!>`, `<!`, `><`, `>>`, `<<`, `<>`, `=>`, `=<`, `!`.
- Enforces one or more version specifiers to require pinned versions.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#75
File: tests/test_deps.py:67-86
Timestamp: 2024-10-08T21:59:27.171Z
Learning: When testing the format of `tests/requirements.txt`, ensure that the regex pattern:
- Requires no whitespace directly before the comma.
- Excludes invalid operator combinations like `!!`, `!>`, `<!`, `><`, `>>`, `<<`, `<>`, `=>`, `=<`, `!`.
- Enforces one or more version specifiers to require pinned versions.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#75
File: tests/test_deps.py:67-86
Timestamp: 2024-09-14T10:03:06.427Z
Learning: When testing the format of `tests/requirements.txt`, ensure that the regex pattern:
- Requires no whitespace directly before the comma.
- Excludes invalid operator combinations like `!!`, `!>`, `<!`, `><`, `>>`, `<<`, `<>`, `=>`, `=<`, `!`.
- Enforces one or more version specifiers to require pinned versions.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-10-08T21:59:30.537Z
Learning: In the project's requirements files, requirement lines may include multiple version specifiers separated by commas (e.g., 'setuptools>=38.0, !=71.0.1, !=72.0'), and regular expressions used in tests should account for this format.

Learnt from: reactive-firewall
PR: reactive-firewall/multicast#0
File: :0-0
Timestamp: 2024-09-14T05:36:36.885Z
Learning: In the project's requirements files, requirement lines may include multiple version specifiers separated by commas (e.g., 'setuptools>=38.0, !=71.0.1, !=72.0'), and regular expressions used in tests should account for this format.

### ChangeLog:

Changes in file multicast/recv.py:
 def doStep(self, *args, **kwargs):

Changes in file tests/test_deps.py:
 def test_requirements_file_exists(self):

Changes in file tests/test_usage.py:
 def test_aborts_WHEN_calling_multicast_GIVEN_invalid_tools(self):
 def test_hear_is_stable_WHEN_calling_multicast_GIVEN_invalid_tool(self):
 def test_help_works_WHEN_calling_multicast_GIVEN_help_tool(self):
 def test_recv_Errors_WHEN_say_not_used(self):
@reactive-firewall reactive-firewall merged commit a735cfb into Feature-replace-stickler Oct 15, 2024
63 checks passed
@reactive-firewall reactive-firewall deleted the patch-unlicense branch October 15, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow public domain via the "Unlicense" in license checks
1 participant