frostming / unearth

A utility to fetch and download python packages
https://unearth.readthedocs.io
MIT License
142 stars 18 forks source link

Do not display warning message when .netrc is does not exist #139

Closed enku closed 3 months ago

enku commented 3 months ago

Is your feature request related to a problem? Please describe. I'm always frustrated when I run pdm now because I always get the following message (twice):

# pdm show --name
Couldn't parse netrc because of FileNotFoundError: [Errno 2] No such file or directory: '/home/marduk/.netrc'
Couldn't parse netrc because of FileNotFoundError: [Errno 2] No such file or directory: '/home/marduk/.netrc'
gbp-ps

This is because of

  1. commit 9ee45283f6f60426bd2cfe4c819ec8032c15db01 shows warning messages when netrc cannot be parsed
  2. I do not have a .netrc file

Describe the solution you'd like Possibly silence the warning for FileNotFoundError

Describe alternatives you've considered Possibly check for the existence of the file before attempting to parse

Additional Context This is with pdm version 2.18.1 and unearth 0.17.0