claude-dev-env 1.42.0 → 1.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_shared/pr-loop/scripts/_claude_permissions_common.py +1 -5
- package/_shared/pr-loop/scripts/code_rules_gate.py +293 -8
- package/_shared/pr-loop/scripts/fix_hookspath.py +96 -5
- package/_shared/pr-loop/scripts/grant_project_claude_permissions.py +3 -16
- package/_shared/pr-loop/scripts/post_audit_thread.py +4 -4
- package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/claude_permissions_constants.py +1 -1
- package/_shared/pr-loop/scripts/preflight.py +13 -31
- package/_shared/pr-loop/scripts/reviews_disabled.py +2 -16
- package/_shared/pr-loop/scripts/revoke_project_claude_permissions.py +3 -16
- package/_shared/pr-loop/scripts/tests/conftest.py +1 -51
- package/_shared/pr-loop/scripts/tests/test_agent_config_carveout.py +4 -4
- package/_shared/pr-loop/scripts/tests/test_claude_permissions_common.py +4 -2
- package/_shared/pr-loop/scripts/tests/test_claude_permissions_constants.py +4 -2
- package/_shared/pr-loop/scripts/tests/test_claude_settings_keys_constants.py +4 -2
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate_constants.py +4 -2
- package/_shared/pr-loop/scripts/tests/test_fix_hookspath_constants.py +6 -2
- package/_shared/pr-loop/scripts/tests/test_grant_project_claude_permissions.py +2 -2
- package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +1 -2
- package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +4 -2
- package/_shared/pr-loop/scripts/tests/test_preflight.py +17 -52
- package/_shared/pr-loop/scripts/tests/test_preflight_constants.py +6 -2
- package/_shared/pr-loop/scripts/tests/test_revoke_project_claude_permissions.py +2 -2
- package/agents/pr-description-writer.md +50 -140
- package/docs/PR_DESCRIPTION_GUIDE.md +101 -102
- package/hooks/_gh_pr_author_swap_utils.py +1 -1
- package/hooks/blocking/bot_mention_comment_blocker.py +4 -10
- package/hooks/blocking/code_rules_enforcer.py +217 -99
- package/hooks/blocking/code_rules_path_utils.py +8 -1
- package/hooks/blocking/destructive_command_blocker.py +1 -1
- package/hooks/blocking/es_exe_path_rewriter.py +7 -13
- package/hooks/blocking/gh_body_arg_blocker.py +6 -1
- package/hooks/blocking/gh_pr_author_enforcer.py +5 -5
- package/hooks/blocking/gh_pr_author_restore.py +5 -5
- package/hooks/blocking/hedging_language_blocker.py +4 -10
- package/hooks/blocking/md_path_exemptions.py +205 -0
- package/hooks/blocking/md_to_html_blocker.py +48 -20
- package/hooks/blocking/pr_converge_bugteam_enforcer.py +5 -11
- package/hooks/blocking/pr_description_enforcer.py +626 -41
- package/hooks/blocking/question_to_user_enforcer.py +4 -10
- package/hooks/blocking/state_description_blocker.py +6 -12
- package/hooks/blocking/tdd_enforcer.py +1 -1
- package/hooks/blocking/test_bot_mention_comment_blocker.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer.py +3 -3
- package/hooks/blocking/test_code_rules_enforcer_any_exempt_files.py +1 -1
- package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +0 -2
- package/hooks/blocking/test_code_rules_enforcer_comment_string_awareness.py +184 -0
- package/hooks/blocking/test_code_rules_enforcer_type_checking_scope.py +82 -0
- package/hooks/blocking/test_code_rules_enforcer_unused_imports.py +29 -29
- package/hooks/blocking/test_gh_body_arg_blocker.py +7 -8
- package/hooks/blocking/test_gh_pr_author_enforcer.py +1 -1
- package/hooks/blocking/test_gh_pr_author_restore.py +1 -1
- package/hooks/blocking/test_hedging_language_blocker.py +2 -2
- package/hooks/blocking/test_md_to_html_blocker.py +463 -8
- package/hooks/blocking/test_pr_converge_bugteam_enforcer.py +1 -1
- package/hooks/blocking/test_pr_description_enforcer.py +1210 -13
- package/hooks/blocking/test_question_to_user_enforcer.py +1 -1
- package/hooks/blocking/windows_rmtree_blocker.py +5 -11
- package/hooks/diagnostic/hook_log_extractor.py +1 -1
- package/hooks/diagnostic/hook_log_init.py +1 -1
- package/hooks/diagnostic/hook_log_stop_wrapper.py +1 -1
- package/hooks/diagnostic/test_hook_log_extractor.py +1 -1
- package/hooks/diagnostic/test_hook_log_init.py +2 -2
- package/hooks/diagnostic/test_hook_log_stop_wrapper.py +1 -1
- package/hooks/git-hooks/gate_utils.py +1 -1
- package/hooks/git-hooks/pre_commit.py +1 -1
- package/hooks/git-hooks/pre_push.py +1 -1
- package/hooks/git-hooks/test_config.py +5 -5
- package/hooks/git-hooks/test_pre_push.py +6 -6
- package/hooks/{config → hooks_constants}/code_rules_enforcer_constants.py +37 -0
- package/hooks/hooks_constants/code_rules_path_utils_constants.py +28 -0
- package/hooks/hooks_constants/md_to_html_blocker_constants.py +82 -0
- package/hooks/{config → hooks_constants}/pr_converge_bugteam_enforcer_state.py +1 -1
- package/hooks/hooks_constants/pr_description_enforcer_constants.py +154 -0
- package/hooks/{config → hooks_constants}/pre_tool_use_stdin.py +1 -1
- package/hooks/{config → hooks_constants}/project_paths_reader.py +2 -2
- package/hooks/{config → hooks_constants}/test_banned_identifiers_constants.py +1 -1
- package/hooks/{config → hooks_constants}/test_dynamic_stderr_handler.py +1 -1
- package/hooks/{config → hooks_constants}/test_hardcoded_user_path_constants.py +1 -1
- package/hooks/{config → hooks_constants}/test_hook_log_extractor_constants.py +2 -2
- package/hooks/hooks_constants/test_md_to_html_blocker_constants.py +110 -0
- package/hooks/{config → hooks_constants}/test_messages.py +2 -6
- package/hooks/{config → hooks_constants}/test_path_rewriter_constants.py +1 -1
- package/hooks/hooks_constants/test_pr_description_enforcer_constants.py +292 -0
- package/hooks/{config → hooks_constants}/test_pre_tool_use_stdin.py +2 -2
- package/hooks/{config → hooks_constants}/test_project_paths_reader.py +3 -3
- package/hooks/{config → hooks_constants}/test_session_env_cleanup_constants.py +1 -1
- package/hooks/{config → hooks_constants}/test_setup_project_paths_constants.py +2 -2
- package/hooks/{config → hooks_constants}/test_unused_module_import_constants.py +1 -1
- package/hooks/lifecycle/pr_converge_bugteam_skill_tracker.py +5 -11
- package/hooks/lifecycle/test_pr_converge_bugteam_skill_tracker.py +1 -1
- package/hooks/session/gh_pr_author_session_cleanup.py +5 -6
- package/hooks/session/session_env_cleanup.py +4 -10
- package/hooks/session/test_gh_pr_author_session_cleanup.py +1 -1
- package/hooks/session/test_untracked_repo_detector.py +2 -2
- package/hooks/session/untracked_repo_detector.py +6 -12
- package/hooks/test__gh_pr_author_swap_utils.py +1 -1
- package/hooks/validators/run_all_validators.py +16 -5
- package/hooks/validators/test_output_formatter.py +46 -0
- package/hooks/workflow/doc_gist_auto_publish.py +1 -1
- package/hooks/workflow/md_to_html_companion.py +8 -15
- package/hooks/workflow/test_md_to_html_companion.py +184 -23
- package/package.json +1 -1
- package/rules/ask-user-question-required.md +1 -1
- package/rules/vault-context.md +1 -1
- package/scripts/{config → dev_env_scripts_constants}/timing.py +1 -1
- package/scripts/setup_project_paths.py +49 -11
- package/scripts/sweep_empty_dirs.py +10 -1
- package/scripts/test_setup_project_paths.py +2 -2
- package/scripts/test_sweep_empty_dirs.py +2 -6
- package/skills/_shared/pr-loop/scripts/_path_resolver.py +1 -1
- package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +1 -1
- package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +1 -1
- package/skills/_shared/pr-loop/scripts/init_loop_state.py +1 -1
- package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +1 -1
- package/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +2 -2
- package/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +2 -2
- package/skills/bugteam/PROMPTS.md +1 -1
- package/skills/bugteam/SKILL.md +1 -1
- package/skills/bugteam/reference/github-pr-reviews.md +1 -1
- package/skills/bugteam/scripts/{_claude_permissions_common.py → _bugteam_permissions_common.py} +1 -13
- package/skills/bugteam/scripts/bugteam_code_rules_gate.py +1 -13
- package/skills/bugteam/scripts/bugteam_fix_hookspath.py +1 -16
- package/skills/bugteam/scripts/bugteam_preflight.py +1 -13
- package/skills/bugteam/scripts/grant_project_claude_permissions.py +2 -8
- package/skills/bugteam/scripts/probe_code_rules_enforcer_check.py +1 -1
- package/skills/bugteam/scripts/reflow_skill_md.py +1 -1
- package/skills/bugteam/scripts/revoke_project_claude_permissions.py +2 -8
- package/skills/bugteam/scripts/{test__claude_permissions_common.py → test__bugteam_permissions_common.py} +4 -4
- package/skills/bugteam/scripts/test_agent_config_carveout.py +2 -2
- package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +0 -26
- package/skills/bugteam/scripts/{test_claude_permissions_common.py → test_bugteam_permissions_common.py} +3 -66
- package/skills/bugteam/scripts/test_bugteam_preflight.py +2 -27
- package/skills/bugteam/scripts/windows_safe_rmtree.py +1 -1
- package/skills/doc-gist/SKILL.md +1 -1
- package/skills/doc-gist/scripts/gist_upload.py +1 -1
- package/skills/implement/SKILL.md +2 -2
- package/skills/implement/scripts/append_note.py +1 -1
- package/skills/pr-converge/pr_converge_skill_constants/__init__.py +0 -0
- package/skills/pr-converge/{config → pr_converge_skill_constants}/constants.py +1 -1
- package/skills/pr-converge/scripts/check_bugbot_ci.py +1 -1
- package/skills/pr-converge/scripts/check_convergence.py +11 -4
- package/skills/pr-converge/scripts/check_pending_reviews.py +1 -1
- package/skills/pr-converge/scripts/fetch_copilot_reviews.py +1 -1
- package/skills/pr-converge/scripts/post_fix_reply.py +1 -1
- package/skills/pr-converge/scripts/pr_converge_scripts_constants/__init__.py +0 -0
- package/skills/pr-converge/scripts/{config → pr_converge_scripts_constants}/pr_converge_constants.py +1 -1
- package/skills/pr-converge/scripts/reflow_skill_md.py +90 -16
- package/skills/pr-converge/scripts/test_check_convergence.py +18 -0
- package/skills/pr-converge/scripts/test_reflow_skill_md.py +0 -31
- package/skills/pre-compact/SKILL.md +114 -0
- package/skills/session-log/SKILL.md +98 -233
- package/hooks/config/pr_description_enforcer_constants.py +0 -19
- package/hooks/config/test_pr_description_enforcer_constants.py +0 -82
- package/skills/bugteam/scripts/test_grant_project_claude_permissions.py +0 -55
- package/skills/bugteam/scripts/test_revoke_project_claude_permissions.py +0 -55
- package/skills/pr-converge/scripts/conftest.py +0 -60
- package/skills/pr-converge/scripts/evict_cached_config_modules.py +0 -20
- package/skills/pr-converge/scripts/test_evict_cached_config_modules.py +0 -22
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/__init__.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/claude_settings_keys_constants.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/code_rules_gate_constants.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/fix_hookspath_constants.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/post_audit_thread_constants.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/preflight_constants.py +0 -0
- /package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/reviews_disabled_constants.py +0 -0
- /package/hooks/git-hooks/{config.py → git_hooks_constants/__init__.py} +0 -0
- /package/hooks/{config → hooks_constants}/__init__.py +0 -0
- /package/hooks/{config → hooks_constants}/any_type_config.py +0 -0
- /package/hooks/{config → hooks_constants}/banned_identifiers_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/blocking_check_limits.py +0 -0
- /package/hooks/{config → hooks_constants}/bot_mention_comment_blocker_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/convergence_branch_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/doc_gist_auto_publish_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/dynamic_stderr_handler.py +0 -0
- /package/hooks/{config → hooks_constants}/gh_pr_author_swap_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/hardcoded_user_path_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/hook_log_extractor_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/html_companion_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/inline_tuple_string_magic_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/messages.py +0 -0
- /package/hooks/{config → hooks_constants}/path_rewriter_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/pr_converge_bugteam_enforcer_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/session_env_cleanup_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/setup_project_paths_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/state_description_blocker_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/stuttering_check_config.py +0 -0
- /package/hooks/{config → hooks_constants}/stuttering_import_binding_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/sys_path_insert_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/unused_module_import_constants.py +0 -0
- /package/hooks/{config → hooks_constants}/windows_rmtree_blocker_constants.py +0 -0
- /package/{skills/_shared/pr-loop/scripts/config → hooks/lifecycle}/__init__.py +0 -0
- /package/{skills/bugteam/scripts/config → hooks/session}/__init__.py +0 -0
- /package/scripts/{config → dev_env_scripts_constants}/__init__.py +0 -0
- /package/skills/{doc-gist/scripts/config → _shared/pr-loop/scripts/skills_pr_loop_constants}/__init__.py +0 -0
- /package/skills/_shared/pr-loop/scripts/{config → skills_pr_loop_constants}/path_resolver_constants.py +0 -0
- /package/skills/{implement/scripts/config → bugteam/scripts/bugteam_scripts_constants}/__init__.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/bugteam_code_rules_gate_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/bugteam_fix_hookspath_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/bugteam_preflight_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/claude_permissions_common_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/probe_code_rules_enforcer_check_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/reflow_skill_md_constants.py +0 -0
- /package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/windows_safe_rmtree_constants.py +0 -0
- /package/skills/{pr-converge/config → doc-gist/scripts/doc_gist_scripts_constants}/__init__.py +0 -0
- /package/skills/doc-gist/scripts/{config → doc_gist_scripts_constants}/gist_upload_constants.py +0 -0
- /package/skills/{pr-converge/scripts/config → implement/scripts/implement_scripts_constants}/__init__.py +0 -0
- /package/skills/implement/scripts/{config → implement_scripts_constants}/notes_constants.py +0 -0
- /package/skills/pr-converge/scripts/{config → pr_converge_scripts_constants}/reflow_skill_md_constants.py +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"""Regression tests for revoke_project_claude_permissions module-import behavior.
|
|
2
|
-
|
|
3
|
-
Pins the loop1-3 fix: a defensive cache pop above sys.path.insert evicts every
|
|
4
|
-
cached `config` and `config.<submodule>` entry so the from-import binds against
|
|
5
|
-
scripts/config/ rather than a stale parent package shadowing it.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import importlib
|
|
11
|
-
import sys
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
from types import ModuleType
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_script_directory = str(Path(__file__).resolve().parent)
|
|
17
|
-
if _script_directory not in sys.path:
|
|
18
|
-
sys.path.insert(0, _script_directory)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _reload_revoke_with_stale_config_cache() -> ModuleType:
|
|
22
|
-
fake_submodule_name = "config.claude_permissions_common_constants"
|
|
23
|
-
fake_parent_name = "config"
|
|
24
|
-
sentinel_module_a = ModuleType(fake_parent_name)
|
|
25
|
-
sentinel_module_b = ModuleType(fake_submodule_name)
|
|
26
|
-
sys.modules[fake_parent_name] = sentinel_module_a
|
|
27
|
-
sys.modules[fake_submodule_name] = sentinel_module_b
|
|
28
|
-
try:
|
|
29
|
-
target_module = sys.modules.get("revoke_project_claude_permissions")
|
|
30
|
-
if target_module is None:
|
|
31
|
-
target_module = importlib.import_module("revoke_project_claude_permissions")
|
|
32
|
-
else:
|
|
33
|
-
target_module = importlib.reload(target_module)
|
|
34
|
-
finally:
|
|
35
|
-
sys.modules.pop(fake_parent_name, None)
|
|
36
|
-
sys.modules.pop(fake_submodule_name, None)
|
|
37
|
-
return target_module
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def test_revoke_module_imports_when_config_is_already_cached(tmp_path: Path) -> None:
|
|
41
|
-
"""Module import must succeed even when sys.modules carries a stale `config`.
|
|
42
|
-
|
|
43
|
-
Regression for loop1-3 — invokes is_valid_project_root after reload to
|
|
44
|
-
prove the binding came from scripts/config/ rather than the sentinel.
|
|
45
|
-
"""
|
|
46
|
-
reloaded_module = _reload_revoke_with_stale_config_cache()
|
|
47
|
-
not_a_project_root = tmp_path / "empty_dir"
|
|
48
|
-
not_a_project_root.mkdir()
|
|
49
|
-
assert reloaded_module.is_valid_project_root(not_a_project_root) is False, (
|
|
50
|
-
"is_valid_project_root must run normally after the reload — proof that "
|
|
51
|
-
"the from-import bound real constants, not the stale cached ones"
|
|
52
|
-
)
|
|
53
|
-
a_claude_project_root = tmp_path / "claude_project"
|
|
54
|
-
(a_claude_project_root / ".claude").mkdir(parents=True)
|
|
55
|
-
assert reloaded_module.is_valid_project_root(a_claude_project_root) is True
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"""Test fixtures for skills/pr-converge/scripts/.
|
|
2
|
-
|
|
3
|
-
Two unrelated Python packages live under the name ``config`` in this repo:
|
|
4
|
-
- ``skills/pr-converge/config/`` (constants for the pr-converge scripts)
|
|
5
|
-
- ``hooks/config/`` (constants for the code-rules enforcer and other hooks)
|
|
6
|
-
|
|
7
|
-
When tests under this directory exercise pr-converge scripts that load
|
|
8
|
-
``from config.constants import ...`` and other code paths in the same
|
|
9
|
-
pytest process also load a different ``config`` package,
|
|
10
|
-
``sys.modules['config']`` and ``sys.modules['config.<submodule>']`` cache
|
|
11
|
-
entries from one package leak into the other. The next
|
|
12
|
-
``from config.<submodule> import ...`` then fails with
|
|
13
|
-
``ModuleNotFoundError`` because the cached parent package does not
|
|
14
|
-
expose that submodule.
|
|
15
|
-
|
|
16
|
-
Independently, several scripts in this folder do
|
|
17
|
-
``Path(__file__).resolve()`` then prepend the resulting directory to
|
|
18
|
-
``sys.path``. On Windows when the working tree lives under a mapped drive
|
|
19
|
-
backed by a UNC share (``Y:`` -> ``\\\\server\\share\\...``), ``.resolve()``
|
|
20
|
-
returns the UNC form, and Python's import machinery on this host cannot
|
|
21
|
-
locate ``config`` packages from a UNC ``sys.path`` entry. The Y:-form entry
|
|
22
|
-
gets pushed to a later index by subsequent inserts, making
|
|
23
|
-
``from config.<submodule> import ...`` fail.
|
|
24
|
-
|
|
25
|
-
This autouse fixture restores both invariants once per pytest session,
|
|
26
|
-
immediately before the first test executes (after collection and module
|
|
27
|
-
imports have completed; session-scoped fixtures run after import, not
|
|
28
|
-
before, so test-module-level ``import`` of pr-converge scripts is
|
|
29
|
-
isolated by each module's own ``_load_module()`` helper rather than by
|
|
30
|
-
this fixture):
|
|
31
|
-
1. evict every ``config`` and ``config.*`` entry from ``sys.modules``
|
|
32
|
-
2. prepend the drive-letter (``.absolute()``) form of the pr-converge
|
|
33
|
-
directory to ``sys.path`` so package resolution always has a
|
|
34
|
-
non-UNC path to search first
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
from __future__ import annotations
|
|
38
|
-
|
|
39
|
-
import sys
|
|
40
|
-
from pathlib import Path
|
|
41
|
-
|
|
42
|
-
import pytest
|
|
43
|
-
|
|
44
|
-
PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM = str(Path(__file__).absolute().parent.parent)
|
|
45
|
-
|
|
46
|
-
if PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM not in sys.path:
|
|
47
|
-
sys.path.insert(0, PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@pytest.fixture(scope="session", autouse=True)
|
|
51
|
-
def _evict_config_namespace_at_session_start() -> None:
|
|
52
|
-
for each_module_name in [
|
|
53
|
-
each_key
|
|
54
|
-
for each_key in list(sys.modules)
|
|
55
|
-
if each_key == "config" or each_key.startswith("config.")
|
|
56
|
-
]:
|
|
57
|
-
sys.modules.pop(each_module_name, None)
|
|
58
|
-
if PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM in sys.path:
|
|
59
|
-
sys.path.remove(PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM)
|
|
60
|
-
sys.path.insert(0, PR_CONVERGE_DIRECTORY_DRIVE_LETTER_FORM)
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"""Evict cached ``config`` package bindings before local ``config`` imports.
|
|
2
|
-
|
|
3
|
-
Mirrors ``_evict_config_module`` in the repository root ``conftest.py``: stale
|
|
4
|
-
``config`` or ``config.*`` entries from other packages must not satisfy
|
|
5
|
-
``from config.…`` in these scripts after ``sys.path`` inserts the script directory.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import importlib
|
|
11
|
-
import sys
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def evict_cached_config_modules() -> None:
|
|
15
|
-
for each_cached_module_name in list(sys.modules):
|
|
16
|
-
is_config_root = each_cached_module_name == "config"
|
|
17
|
-
is_config_submodule = each_cached_module_name.startswith("config.")
|
|
18
|
-
if is_config_root or is_config_submodule:
|
|
19
|
-
sys.modules.pop(each_cached_module_name, None)
|
|
20
|
-
importlib.invalidate_caches()
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"""Tests for evict_cached_config_modules."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import sys
|
|
6
|
-
import types
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
|
|
9
|
-
_scripts_directory = Path(__file__).absolute().parent
|
|
10
|
-
if str(_scripts_directory) not in sys.path:
|
|
11
|
-
sys.path.insert(0, str(_scripts_directory))
|
|
12
|
-
|
|
13
|
-
from evict_cached_config_modules import evict_cached_config_modules
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def test_should_remove_root_config_and_submodules() -> None:
|
|
17
|
-
fake = types.ModuleType("config")
|
|
18
|
-
sys.modules["config"] = fake
|
|
19
|
-
sys.modules["config.stale_submodule"] = types.ModuleType("config.stale_submodule")
|
|
20
|
-
evict_cached_config_modules()
|
|
21
|
-
assert "config" not in sys.modules
|
|
22
|
-
assert "config.stale_submodule" not in sys.modules
|
|
File without changes
|
|
File without changes
|
/package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/code_rules_gate_constants.py
RENAMED
|
File without changes
|
/package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/fix_hookspath_constants.py
RENAMED
|
File without changes
|
/package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/post_audit_thread_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
/package/_shared/pr-loop/scripts/{config → pr_loop_shared_constants}/reviews_disabled_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/skills/{implement/scripts/config → bugteam/scripts/bugteam_scripts_constants}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/bugteam_preflight_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/skills/bugteam/scripts/{config → bugteam_scripts_constants}/reflow_skill_md_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
/package/skills/{pr-converge/config → doc-gist/scripts/doc_gist_scripts_constants}/__init__.py
RENAMED
|
File without changes
|
/package/skills/doc-gist/scripts/{config → doc_gist_scripts_constants}/gist_upload_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|