-
Notifications
You must be signed in to change notification settings - Fork 0
fix(coverage): discover hash-pinned requirements lock files #1157
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
Changes from all commits
d70594a
bddf204
800d345
7fd8724
919f961
0687a05
02aabf8
43ad99d
0aba0b4
c4121f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,16 +145,23 @@ def _install_trusted_uv_url_opener() -> None: | |
|
|
||
| def _is_candidate_lock_name(name: str) -> bool: | ||
| """Return whether a file name is a possible pip requirements lock.""" | ||
| return name == "requirements.lock" or ( | ||
| fnmatch.fnmatch(name, "requirements*.txt") | ||
| and not fnmatch.fnmatch(name, "requirements-*-ci-hashes.txt") | ||
| return ( | ||
| ( | ||
| fnmatch.fnmatch(name, "requirements*.txt") | ||
| and not fnmatch.fnmatch(name, "requirements-*-ci-hashes.*") | ||
| ) | ||
| or ( | ||
| fnmatch.fnmatch(name, "requirements*.lock") | ||
| and not fnmatch.fnmatch(name, "requirements-*-ci-hashes.*") | ||
| ) | ||
| ) | ||
|
seonghobae marked this conversation as resolved.
Comment on lines
146
to
157
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Lock candidate change is a safe superset
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
|
|
||
| def _is_candidate_lock_path(path: pathlib.PurePosixPath) -> bool: | ||
| """Return whether one safe tracked path can name a pip requirements lock. | ||
|
|
||
| In addition to conventional ``requirements*.txt`` names, repositories often | ||
| In addition to conventional ``requirements*.txt`` and ``requirements*.lock`` | ||
| names, repositories often | ||
| keep concrete environment closures as direct children such as | ||
| ``requirements/ci.txt`` or ``service/requirements/package.txt``. Only direct | ||
| ``.txt`` children of a directory named ``requirements`` gain this path-based | ||
|
seonghobae marked this conversation as resolved.
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,14 +266,28 @@ def _rewrite_materialized_includes( | |
| ' encoding="utf-8",\n' | ||
| ' )\n', | ||
| ) | ||
| replace_once( | ||
| TEST, | ||
| ' "requirements-test.txt",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ' "requirements-test.txt",\n' | ||
| ' "requirements/ci.txt",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ) | ||
| test_text = Path(TEST).read_text(encoding="utf-8") | ||
| if ' "requirements/ci.txt",\n' not in test_text: | ||
| if ' "services/account_unification/requirements-dev.lock",\n' in test_text: | ||
| replace_once( | ||
| TEST, | ||
| ' "requirements-test.txt",\n' | ||
| ' "services/account_unification/requirements-dev.lock",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ' "requirements-test.txt",\n' | ||
| ' "requirements/ci.txt",\n' | ||
| ' "services/account_unification/requirements-dev.lock",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ) | ||
| else: | ||
| replace_once( | ||
| TEST, | ||
| ' "requirements-test.txt",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ' "requirements-test.txt",\n' | ||
| ' "requirements/ci.txt",\n' | ||
| ' "services/account_unification/requirements-dev.txt",\n', | ||
| ) | ||
|
Comment on lines
+270
to
+290
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Untested migration branch breaks 100% coverage gate The new module-level Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| insert_before( | ||
| TEST, | ||
| ' between_file.write_text("START old", encoding="utf-8")\n', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.