57

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?

Jim
  • 13,430
  • 26
  • 104
  • 155

1 Answers1

85

This section is for development requirements. So stuff like linters, unit test libraries, etc. All that is not needed on the user's machine.

To install a package as dev-requirement add -d to install command (i.e. pipenv install -d ...), to install the dev-requirements section add -d to sync command (i.e. pipenv sync -d ...).

Kye
  • 4,279
  • 3
  • 21
  • 49
Andrew Morozko
  • 2,576
  • 16
  • 16
  • 3
    Just to be clear, syntax is `pipenv install -d` not `pipenv -d install` – Connor Aug 29 '22 at 18:21
  • 1
    @Connor I've amended this answer to reflect this. – Kye Nov 27 '22 at 02:24
  • Is it safe to say then that installing Jupyterlabs for use in writing and trying out the code should be done as a dev-package? – Don 'FreihEitner' Eitner Nov 27 '22 at 02:44
  • is `pipenv install -d` for dev packages **including** the standard packages? – carkod Dec 27 '22 at 00:07
  • 1
    @carkod Yes. It installs the standard AND the dev packages. As far as I know there is no way to install ONLY the dev packages (which might have been useful when running linters and formatters in CI/CD pipelines) – Ambar Mar 29 '23 at 12:55