scancode.io icon indicating copy to clipboard operation
scancode.io copied to clipboard

resolve_dependencies fails when multiple manifest files are present in a project

Open Nour1709 opened this issue 1 year ago • 3 comments

When running the resolve_dependencies pipeline on a project that contains multiple manifest files, the pipeline fails.

In our case, the project includes several requirements.txt files located in different subfolders.

The error seems to happen in the step that collects manifest inputs, probably in the get_manifest_inputs function, which appears to expect a single manifest file, not a list of files. As a result, instead of resolving dependencies for all manifests found in the codebase, the pipeline stops with an exception.

Nour1709 avatar Nov 17 '25 10:11 Nour1709

Hey @Nour1709 ! I’d like to work on this issue. Could you please assign it to me and let me know if there’s anything specific I should follow?

Theminacious avatar Nov 17 '25 11:11 Theminacious

Hi @Nour1709 , I've created a fix for this issue! The Problem: The pipeline was processing each manifest file individually, but python-inspector is designed to handle multiple requirement files in a single call for better dependency resolution. My Solution:

  1. Modified resolve_pypi_packages() to accept multiple requirement files
  2. Updated get_data_from_manifests() to batch-process all PyPI manifests together
  3. Maintained backward compatibility with the existing API
  4. Added comprehensive tests to prevent regressions Pull Request: #[PR_NUMBER] The changes are minimal and focused, with good test coverage. The fix:
  • Handles multiple manifest files correctly
  • Improves efficiency through batch processing
  • Maintains backward compatibility
  • Includes comprehensive tests Please review when you have a chance! Let me know if you need any changes or have questions.

pradhyum6144 avatar Nov 30 '25 12:11 pradhyum6144

Hi @Nour1709 I attempted to reproduce this issue on ScanCode.io 36.1.0 using multiple requirements.txt files in different subfolders. After running scan_codebase followed by resolve_dependencies, the pipeline completed successfully without errors. It seems this issue may already be resolved in the current version.

dikshaa2909 avatar Mar 01 '26 19:03 dikshaa2909