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

Don't rely on pipfile_location to determine lockfile_location #3589

Closed
techalchemy opened this issue Mar 6, 2019 · 5 comments
Closed

Don't rely on pipfile_location to determine lockfile_location #3589

techalchemy opened this issue Mar 6, 2019 · 5 comments
Labels
Type: Behavior Change This issue describes a behavior change. Type: Discussion This issue is open for discussion. Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@techalchemy
Copy link
Member

We are currently relying on project.pipfile_location in order to determine lockfile_location. There are a few reasons for this, one of which is that we actually need a pipfile to exist in most cases in order to perform a comparison of the known pipfile hash which is stored in the lockfile and likely would require --ignore-pipfile to make this all work properly.

@techalchemy techalchemy added Type: Enhancement 💡 This is a feature or enhancement request. Type: Discussion This issue is open for discussion. Type: Behavior Change This issue describes a behavior change. labels Mar 6, 2019
@techalchemy
Copy link
Member Author

/cc @uranusjr @frostming @jxltom

@frostming
Copy link
Contributor

I remember there is a PR there. #3386 , needs to be refined though.

@uranusjr
Copy link
Member

uranusjr commented Mar 7, 2019

But what do we rely on then, project root?

@techalchemy
Copy link
Member Author

Yeah that is how Pipfile.find works which determines pipfile_location. Just not sure about what to do if the user provides a Pipfile.lock but no Pipfile. Do we need to just not generate the Pipfile in most cases? It’s likely as simple as adding Project.exists() instead of explicit checks for one or the other

If we leave things as they are and only make this one change to lockfile discovery, as soon as you pipenv install, a new Pipfile will be generated and it will be empty. If you ever add something to or or install again, it will wipe the lockfile.

@uranusjr
Copy link
Member

uranusjr commented Mar 7, 2019

I don’t think an empty Pipfile is the right answer, since that would be hilariously inconsistent to Pipfile.lock. I see two possibilities:

  • Convert Pipfile.lock back to Pipfile, like how requirements.txt is converted on project init.
  • Do nothing when Pipfile is not needed (i.e. for sync or install --ignore-pipfile), and hard-error (Pipfile does not exist!) in all other cases.

@matteius matteius closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Behavior Change This issue describes a behavior change. Type: Discussion This issue is open for discussion. Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests

4 participants