Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Decouple project from the existence of Pipfile. #3386
Decouple project from the existence of Pipfile. #3386
Changes from 3 commits
c9041b8
c17f36f
0efa7e9
08b3571
09e1d55
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do still want to create non existent pipfiles when we ensure projects exist, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't touch an empty Pipfile here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this isn’t different fundamentally.
pipfile_exists
is justbool(pipfile_location)
. It is arguably cleaner so it seems okThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pipfile_location
no longer returnsNone
, checking the existence makes more sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not bare...elif not bare
seems like it might be a mistakeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t change this one, it is going to regress environment discovery on windows unless you change every reference to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a relative path also breaks https://github.com/pypa/pipenv/blob/master/pipenv/project.py#L217-L221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the existence of the file instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t use
isfile
. I know it seems intuitive but this will break pipenv for lots of people. Changing things like this en mass for no reason isn’t going to fly. This library is downloaded millions of times a month. Even if 1% of the users set their Pipfile to a network path or use the envvar to point at a temp file that doesn’t exist to work around some issue, you just fundamentally broke pipenv for those users because of this change.Improvements are good and important and I’m willing to break compatibility for some things. But changes like this one only screw users over and make people like Hynek write about how many regressions they experience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is made to work with #3386 (diff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return the project home even if there is no Pipfile existing.
NOTE:
$ pipenv --where
still prints an error if Pipfile doesn't exist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
pipenv --venv
andpipenv --rm
is possible when Pipfile is not present.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m pretty sure this returns an actual path like
project.path_to("Pipfile")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case the Pipfile is not found it returns None. Then https://github.com/pypa/pipenv/blob/master/pipenv/project.py#L217-L221 will be broken.