resolve_dependencies fails when multiple manifest files are present in a project
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.
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?
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:
- Modified
resolve_pypi_packages()to accept multiple requirement files - Updated
get_data_from_manifests()to batch-process all PyPI manifests together - Maintained backward compatibility with the existing API
- 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.
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.