In my pyproject.toml
I have configured a “normal” and a “dev” configuration, like so:
[tool.poetry]
name = "project_name"
version = "0.2.0"
description = "Project description"
authors = ["me"]
license = "no one is allowed to use this code except myself ;)"
readme = "README.md"
package-mode = false
[tool.poetry.dependencies]
python = "^3.10"
exceptiongroup = ">=1.2,<2.0"
tabulate = ">=0.9,<1.0"
trio = ">=0.25,<1.0"
rich = ">=13.7,<14.0"
[tool.poetry.group.dev.dependencies]
pytest = "^8.2.1"
asynctest = "^0.13.0"
pytest-asyncio = "^0.23.7"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Now, in my build script (which is actually a docker script in my case, but it could be any other build script) I want to first install all dependencies of both groups:
poetry install --with dev
, then run the unittests of my project and afterwards uninstall the dev
dependencies again:
# ! PSEUDOCODE !
poetry remove * --group dev
However, I’m facing the problem that poetry
seems to disallow uninstalling all dependencies of a group at once.
There is the poetry remove
command, but it needs a package
to be specified
Is there some option I am overlooking which lets me obtain a wildcard
like effect?