Search code examples
pythonpippipenvpipfile

How to freeze a dev requirements and generate to dev.txt with pipenv? (Only Dev packages/dependencies)


Let's take an example of Pipfile below. Here I would like to freeze only ipdb to dev.txt

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
ipdb = "*"

[packages]
django = "*"

[requires]
python_version = "3.7"

I know to how to freeze requirements but I want to freeze specific dev packages into dev.txt

I have checked into Generating Requirements from the docs.

Docs have only $pipenv lock -r --dev > requirements.txt which generates all the dependencies.

I have tried $pipenv lock --dev > dev.txt. It does not work.

Any help would be much appreciated.


Solution

  • Yes it works with pipenv lock --dev -r > dev.py.

    Maybe you are confused about the number of dependencies, it's because you have all the dependencies of your dev packages and so on. But there is only your dev packages here.

    EDIT: Don't forget the -r option, it's maybe what you are missing.