bkawan
bkawan

Reputation: 1361

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.

Upvotes: 1

Views: 1187

Answers (3)

Ashwini Verma
Ashwini Verma

Reputation: 51

Below will solve your problem. It include all packages include dev ones.

pipenv requirements --dev > req-dev.txt

Upvotes: 0

Premkumar chalmeti
Premkumar chalmeti

Reputation: 1018

The -d or --dev generates both develop and default requirements.

To only generate dev requirement.

pipenv lock --dev-only -r > dev.txt

Upvotes: 0

juncaks
juncaks

Reputation: 96

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.

Upvotes: 1

Related Questions