reynoldsnlp / pipster

pipster: The pythonic way to `pip install`.
MIT License
8 stars 2 forks source link

Pipfile search depth #15

Closed reynoldsnlp closed 1 year ago

reynoldsnlp commented 1 year ago

Currently, when checking for Pipfiles to notify that Pipfiles are ignored, we go to the arbitrary depth of 4 parent directories. Is there a more robust way to do this?

reynoldsnlp commented 1 year ago

Is there any reason that this should not just go all the way to the filesystem root (or to a PermissionError)? Unless there is a security risk to globbing, a Pipfile in any direct parent directory should probably be noted. Should there only be one Pipfile per project?

It might be worth piggy-backing on the --verbose flag of pip install and only print the list of Pipfiles if verbose: (or if there is only one Pipfile). Otherwise, just give a message to say that Pipfiles have been ignored. Use verbose=True to list ignored Pipfiles.

reynoldsnlp commented 1 year ago

It looks like pipenv only goes to a depth of 3 by default: https://github.com/pypa/pipenv/blob/main/pipenv/utils/pipfile.py#L44-L55