Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
The ordinary Python import regex includes newlines in its whitespace classes. Given two consecutive project imports,
parse_imports()can return no dependencies; with aliases on both lines, it raisesValueError: too many values to unpack. This affects the dependency checks used by Code Genesis.Limit this regex to horizontal whitespace so it stops at each import line. Preserve spaces, tabs and formfeeds, comma-separated imports, and existing alias extraction. Add public-API regression tests with actual project files covering LF/CRLF, consecutive imports, a following
fromimport, and a following statement.Related issue number
No linked issue. All 27 open PR file lists were checked; neither target file is modified by another PR. The merged import-parser fix #811 addresses relative paths, a separate problem.
Validation
python -m pytest tests/utils/test_python_import_lines.py --disable-socket -q).test_relative_import_double_dotassertion fails on the unchanged baseline (52 passed, 1 failed): it expects/while the resolved path uses\. This PR leaves path resolution unchanged.git diff --checkpassed.pre-commit run --all-fileswas already run against the same upstream baseline during the preceding snapshot contribution; unrelated baseline lint/format failures remain (includingfile_lock.pyE731 andskills_manager.pyE305). This independent worktree contains only this parser fix and its new tests.Checklist
pre-commit installandpre-commit run --all-filesbefore git commit, and passed lint check (baseline failures described above)Prepared with Codex, including regression tests and a separate AI code review.