bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.38k stars 388 forks source link

handle FileNotFoundError in parse_requirements function #397

Closed mateuslatrova closed 12 months ago

mateuslatrova commented 1 year ago

When the function "parse_requirements.txt" does not find the file passed as a parameter, it just raises an OSError.

This PR changes that behavior. Now, when that happens, this function handles it by printing a helpful message to the user and ends the program execution immediately.

fredgrub commented 1 year ago

This PR is related to PR https://github.com/bndr/pipreqs/pull/392. Since this PR modifies the functioning of the parse_requirements function, we must accept it first.

codecov-commenter commented 1 year ago

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (55eee29) 89.96% compared to head (4a28ae7) 90.07%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #397 +/- ## ========================================== + Coverage 89.96% 90.07% +0.11% ========================================== Files 2 2 Lines 259 262 +3 ========================================== + Hits 233 236 +3 Misses 26 26 ``` | [Files](https://app.codecov.io/gh/bndr/pipreqs/pull/397?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [pipreqs/pipreqs.py](https://app.codecov.io/gh/bndr/pipreqs/pull/397?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cGlwcmVxcy9waXByZXFzLnB5) | `89.96% <87.23%> (+0.11%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alan-barzilay commented 1 year ago

LGTM just remove the white trailing space please

alan-barzilay commented 1 year ago

ah, and rebase, thx

mateuslatrova commented 1 year ago

@alan-barzilay rebased and fixed the white trailing space.