Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Poetry - update -dev dependencies only to latest

How do I get Poetry to update dev dependencies only to latest?

I originally had:

[tool.poetry.dev-dependencies]
pytest = "^4.6"

But I wanted:

[tool.poetry.dev-dependencies]
pytest = "^6.0"

I achieved it by manual editing the pyproject.toml file.

When I ran poetry update it ( brilliantly ) bumped all my normal ( non-dev ) dependencies.

like image 824
rustyMagnet Avatar asked Dec 06 '25 17:12

rustyMagnet


1 Answers

With latest poetry version you should use

poetry add pytest@latest --group dev

like image 103
superjambon Avatar answered Dec 10 '25 11:12

superjambon