mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-02 17:40:07 +00:00
Add --ignore-errors
to skip files with errors
#10
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shumbo on 3/14/2025
Overview
This PR introduces the
--ignore-errors
flag to pipreqs, allowing users to continue generating requirements.txt even if some files contain syntax errors. When this option is enabled, files with syntax errors will be skipped, and a warning will be logged instead of failing the entire process.Key Improvements Over #287
I initially worked on this without being aware of PR #287, which proposed a similar change. After finishing my implementation, I became aware of #287 and reviewed it carefully. While I appreciate the original contribution, I believe this PR still provides additional value for the following reasons:
Includes a Test Case
This PR adds a test (
test_ignore_errors
) to ensure the new flag works correctly. The previous PR did not include a test, which could make it harder to verify correctness and prevent regressions in the future.Preserves Notebook Parsing Functionality
Since #287 was opened, pipreqs has added support for reading Jupyter notebooks using read_file_content. However, it looks like there was an issue during conflict resolution in #287, causing the code to revert to reading files as plain text instead of using read_file_content.
I appreciate the work done in #287 and would be happy to collaborate to refine this feature. Let me know if any changes are needed! 😊