Skip to content

fix: read the venv with uv pip list so the repo installed from its own directory has a version (TC-7405) - #495

Merged
tmihalac merged 1 commit into
RHEcosystemAppEng:mainfrom
tmihalac:fix-TC-7405-venv-package-list
Nov 5, 2026
Merged

tmihalac merged 1 commit into
RHEcosystemAppEng:mainfrom
tmihalac:fix-TC-7405-venv-package-list

Conversation

@tmihalac

@tmihalac tmihalac commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

Follow-up to #493 and #494 (TC-7405). This commit was pushed to the #494 branch after #494 had merged, so it is not on main.

The pyyaml 5.3 case (CVE-2020-14343) still failed the Tekton integration test on the 0.0.5 backport #492, with label false_positive:

Version check completed — 1 package(s) matched but none are vulnerable. ... stdlib:None (unknown)

Cause

pyyaml has only setup.py, so uv pip install . installs pyyaml itself into transitive_env. parse_python_venv read the venv with uv pip freeze, which prints that package as pyyaml @ file:///... with no version. The parser skips name @ url lines, so the version check found no pyyaml ("NO MATCH [nvd]: pyyaml not found in dependencies") and fell back to the stdlib check.

Change

parse_python_venv runs uv pip list --format=freeze, which prints pyyaml==5.3. The package_matchers.py docstring is updated to match.

Verification

  • With real uv on the pyyaml 5.3 venv: uv pip freeze prints pyyaml @ file:///tmp/..., and uv pip list --format=freeze prints pyyaml==5.3.
  • New src/vuln_analysis/utils/tests/test_lock_file_parsers.py. It fails before the change ({}) and passes after it ({"pyyaml": "5.3"}).
  • test_python_dep_tree_real_uv.py now also checks parse_python_venv on the real venv, and it passes.
  • 109 related tests pass (test_lock_file_parsers.py, test_python_build_tree.py, test_python_dep_tree_real_uv.py, tests/test_version_check.py, tests/test_package_identifier.py).

The same fix is on #492 (0.0.5) as 34e6c6ef.

🤖 Generated with Claude Code

…own directory has a version (TC-7405)

The pyyaml 5.3 case (CVE-2020-14343) still failed the integration test on
PR 492 with false_positive: "Version check completed - 1 package(s) matched
but none are vulnerable ... stdlib:None (unknown)". pyyaml has only setup.py,
so `uv pip install .` installs pyyaml itself into transitive_env, and
`uv pip freeze` prints it as "pyyaml @ file:///..." without a version.
parse_python_venv skipped such lines, so the version check found no pyyaml
and fell back to the stdlib check. It now runs
`uv pip list --format=freeze`, which prints "pyyaml==5.3".

Verified with real uv: freeze prints "pyyaml @ file:///tmp/...", list prints
"pyyaml==5.3". The real-uv pyyaml test now also checks parse_python_venv.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit e9aca6c)
@tmihalac
tmihalac merged commit 2a889b1 into RHEcosystemAppEng:main Nov 5, 2026
1 of 3 checks passed
@tmihalac
tmihalac deleted the fix-TC-7405-venv-package-list branch November 5, 2026 14:05
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