Skip to content

Batch: 2 fixes, one commit each - #49

Merged
thebenignhacker merged 2 commits into
mainfrom
integrate/2026-10-17-r11
Oct 17, 2026
Merged

thebenignhacker merged 2 commits into
mainfrom
integrate/2026-10-17-r11

Conversation

@thebenignhacker

Copy link
Copy Markdown
Member

This pull request lands 2 commits in internal/manifest and CHANGELOG.md.

Included

Verified on this exact tree

  • go build ./...: exit 0
  • go vet ./...: exit 0
  • gofmt -l cmd internal pkg: no files listed
  • golangci-lint run ./... (golangci-lint 2.12.2): exit 3, can't load config: unsupported version of the configuration: ""
  • golangci-lint run -c <copy of .golangci.yml converted by golangci-lint migrate> ./...: 8 issues (staticcheck: 8); the same command on origin/main (c263b32): 8 issues (staticcheck: 8), the same 8 check IDs in the same files
  • Changelog check: none in the repository
  • go test -json -race -p 4 -count=1 -coverprofile=<temporary file> ./...: exit 0; 16 packages, 13 ok and 3 with no test files
  • Top-level tests from that run: 518 passed, 1 skipped, 0 failed
  • Tests including subtests from that run: 1599 passed, 1 skipped, 0 failed
  • Skipped: TestIntegration_FetchPyPIPackage (internal/analyzer/source), output pip not available, skipping test

Not included

None

Closes

Fixes #47
Fixes #48

How to merge

Rebase and merge, so that each change stays its own commit on main.

…ements/dev.txt, as a scan of its directory reads it, instead of refusing it as an unsupported manifest file (#47)

For a requirements/dev.txt holding "-r requirements.txt" and "paramiko>=3.0",
cryptodeps analyze requirements/dev.txt --offline exited 2 with "Error:
analysis failed: unsupported manifest file: dev.txt", with and without
--no-workspaces, while cryptodeps analyze . --offline read the same file.
DetectAndParse, which reads a file passed as the argument, chose the parser
from the file's name alone, while a scan of a directory chooses it from the
path, which knows the requirements/ layout. DetectAndParse now uses the path
lookup as well. When no parser matches, the path lookup returns the name
lookup's error, so docs/notes.txt and x/Cargo.toml are still refused with
"unsupported manifest file: notes.txt" and "unsupported manifest file:
Cargo.toml", and exit 2.

The scan of the file now lists paramiko and the unread -r line, its JSON
report differs from the report for the scan of the directory only in
timestamps and paths, and both exit 1.

Fixes #47
… when reading dependencies, so "cryptography==42.0.0 \" with a --hash line after it has the version 42.0.0 (#48)

pip reads a line that ends in a backslash together with the next line, so a
requirements.txt holding "cryptography==42.0.0 \" and
"    --hash=sha256:..." on two lines pins cryptography 42.0.0. The
dependency parser read one physical line at a time, so analyze --offline
--format json reported "version": "42.0.0 \\" and the table printed
cryptography@42.0.0 \. Dependencies are now read from the lines the
unread-lines reader reads, with continued lines joined as pip joins them and
numbered by their first line, and a requirement ends at its first
per-requirement option, such as --hash. pip 26.0 ends it at the first
space-separated token that begins with "-"; a tab before such a token ends
it here too. That file now reports version 42.0.0 at line 1, its JSON output
differs only in the version and timestamps, and the exit code is 1 before
and after.

The same cut leaves a --hash on the requirement's own line out of the
version, which was "42.0.0 --hash=sha256:...". An -r line or a name @ URL
line continued onto the next line is skipped as a whole: "-r \" followed by
extra.txt was also read as a dependency named extra with the version .txt,
and "paramiko @ \" followed by a URL as paramiko with the version "@ \".
Both stay listed in unreadLines, unchanged. For
testdata/fixtures/python-project the table output, and the JSON output
apart from timestamps, are the same before and after.

Fixes #48
@thebenignhacker
thebenignhacker merged commit 09d9c66 into main Oct 17, 2026
3 checks passed
@thebenignhacker
thebenignhacker deleted the integrate/2026-10-17-r11 branch October 17, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant