Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display the directory path of the found requirements.txt file #4987

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

HosamAlmoghraby
Copy link
Contributor

@HosamAlmoghraby HosamAlmoghraby commented Mar 16, 2022

Thank you for contributing to Pipenv!

The issue

What is the thing you want to fix? Is it associated with an issue on GitHub? Please mention it.
#2222
#2870

Always consider opening an issue first to describe your problem, so we can discuss what is the best way to amend it. Note that if you do not describe the goal of this change or link to a related issue, the maintainers may close the PR without further review.

If your pull request makes a non-insignificant change to Pipenv, such as the user interface or intended functionality, please file a PEEP.

https://github.com/pypa/pipenv/blob/master/peeps/PEEP-000.md

The fix

How does this pull request fix your problem? Did you consider any alternatives? Why is this the best solution, in your opinion?

When pipenv does not find Pipfile, it tries to find requirements.txt file, if the file is not in the same directory, then, pipenv looks in the parent directories (the default settings PIPENV_MAX_DEPTH=3).
when pipenv finds the requirements.txt file either in the same folder or in one of the parent folders, it prints the message: "requirements.txt found, instead of Pipfile! Converting...".
I think this message is cofusing for the user when there is no requirements.txt file stored in the same folder and the user might not know that pipenv looks in the parent folders as well.
The confusion here could be avoided by displaying to the user the folder path of the requirements.txt file where pipenv found it.

Here is my proposal: "requirements.txt found in <requirements.txt-DIR-PATH> instead of Pipfile! Converting..."
I bolded requirements.txt and Pipfile and colored the directory path to the requirements.txt file with Yellow.

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix, .feature, .behavior, .doc. .vendor. or .trivial (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@HosamAlmoghraby
Copy link
Contributor Author

here is a screenshot of how the message will look like:
image

mkdir outer-dir
cd outer-dir
touch requirements.txt
mkdir inner-dir
cd inner-dir
pipenv shell

@matteius
Copy link
Member

Personally I think it looks good, but also the current tests broke because of a git:// protocol deprecation, so not running this until we can merge: #4989 and your PR gets updated with the updated main branch at that time.

@oz123 oz123 merged commit 6742e0c into pypa:main Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants