Skip to content

Add PyPI package scanning support#4

Merged
vinmay merged 2 commits intomainfrom
add-pypi-support
Mar 1, 2026
Merged

Add PyPI package scanning support#4
vinmay merged 2 commits intomainfrom
add-pypi-support

Conversation

@vinmay
Copy link
Owner

@vinmay vinmay commented Mar 1, 2026

Users can now scan PyPI packages directly using the pypi: scheme:
agent-scan pypi:requests
agent-scan pypi:requests==2.31.0

When no version is specified the latest release is resolved from the PyPI JSON API. The resolved version is shown in the scan footer and included in JSON output under resolved_version.

Implementation:

  • source_loader: _is_pypi_target (pypi: prefix), _parse_pypi_target, _fetch_pypi_package (PyPI JSON API → sdist/wheel download + safe extraction), PyPI branch in resolve_target(); resolved_version field on ResolvedTarget dataclass
  • scanner: stamps resolved_version into the report dict
  • text_reporter: footer shows "(version X.Y.Z)" for PyPI scans
  • cli: pypi_download progress label
  • tests/test_pypi_loader.py: 20 tests covering detection, parsing, resolution, error handling, and report output

vinmay and others added 2 commits February 28, 2026 23:54
Users can now scan PyPI packages directly using the pypi: scheme:
  agent-scan pypi:requests
  agent-scan pypi:requests==2.31.0

When no version is specified the latest release is resolved from the
PyPI JSON API. The resolved version is shown in the scan footer and
included in JSON output under resolved_version.

Implementation:
- source_loader: _is_pypi_target (pypi: prefix), _parse_pypi_target,
  _fetch_pypi_package (PyPI JSON API → sdist/wheel download + safe
  extraction), PyPI branch in resolve_target(); resolved_version field
  on ResolvedTarget dataclass
- scanner: stamps resolved_version into the report dict
- text_reporter: footer shows "(version X.Y.Z)" for PyPI scans
- cli: pypi_download progress label
- tests/test_pypi_loader.py: 20 tests covering detection, parsing,
  resolution, error handling, and report output

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vinmay vinmay merged commit 174d170 into main Mar 1, 2026
2 checks passed
@vinmay vinmay deleted the add-pypi-support branch March 1, 2026 05:38
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.

1 participant