I'm learning pipenv and there's something I don't quite understand. Apparently your Pipfile can contain two sections:
[packages]
...
[dev-packages]
....
As I understand it, the packages section is where the packages that you install are listed. But what is the dev-packages section for? How is it different from the packages section?
If you use pipenv install --dev in your project, pipenv should install all the packages that are required to develop your project. If it recursively installed all dev dependencies all the way down, it might pull in Python profiling packages, test runners, etc., that other packages need for development.
Turns out it's surprisingly simple. Go to the root of your project & open up a new terminal. Use the following commands to open a shell and get the location of the virtual environment. If you open up this in the file explorer, you'll find exactly where the modules are being installed.
It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages. It also generates the ever-important Pipfile. lock , which is used to produce deterministic builds.
This section is for development requirements. So stuff like linters, unit test libraries, etc. All that is not needed on user's machine.
To install package as dev-requirement add -d
to install
command, to install the dev-requirements section add -d
to sync
command.
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