Pipenv:
I found at https://realpython.com/pipenv-guide/ that to tranfer the project to development i have to run
pipenv lock
(to update/create the Pipfile.lock file)
As per my understanding whenever we install any package using
pipenv install django
Pipfile.lock is automatically generated/updated.
So whats the need to do
pipenv lock
isnt the Pipfile.lock always the updated.
of course in case i want to create .lock file at any time (by chance if its delete) i may do pipenv lock
Also if by chance the pipfile is deleted can i recreate it again.
pipenv install by default does attempt to re-lock unless using the --deploy flag. That distinction seems to be key and shouldn't be hidden in the advanced section. An intuitive command for installing dependencies is pipenv install which was used before.
When you create a Pipenv environment either for a new or an existing project, the Pipfile is generated automatically. The file is added to the current project, you can see it in the Project tool window.
Pipenv is dead.
Other comments here saying 2-3 minutes per lock are consistent with my general experience. This wasn't for complex pipenv operations either. A simple command: pipenv run python main.py took progressively longer to execute. It takes about 2 minutes (feels like 5!) on my 2016 MBP to install 102 dependencies.
You're right that the Pipfile.lock
has already been created when installing the virtual environment or some packages. As far as I understand, the goal would be to update all your dependencies before entering production.
But I think against the documentation you should not update the Pipfile.lock
at this stage, unless you're very confident in your CI pipeline and your test framework, because it could potentially deploy in production some untested dependency version Remember that pipenv lock
will not install on your development machine the update dependencies, and if you rerun your tests without pipenv sync
you will not test the updated dependencies. I prefer locking once and for all the dependencies at a early stage, then keep it until deployment, then after the deployment update the dependencies and begin the next version.
That's also why I am very careful with pip install <package>
, because it will also automatically update all your dependencies, while I would prefer that pipenv
tries to keep all the other dependency versions unchanged, unless specifically specified or clash between dependency versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With