I'm trying to add support for Sentry to an existing Python Flask application that uses Python Poetry for dependency management.
The Sentry docs say to run this:
pip install --upgrade 'sentry-sdk[flask]
That works. But I want to convert that into a pyproject.toml dependency entry for Python Poetry. If I try just this:
[tool.poetry.dependencies]
# <snip>
sentry-sdk = "1.5.12"
I get a SolverProblemError:
... depends on sentry-sdk (1.5.12) which doesn't match any versions, version solving failed.
If I try:
[tool.poetry.dependencies]
# <snip>
sentry-sdk[flask] = "1.5.12"
I get Invalid TOML file.
How do I convert this pip dependency to Python pyproject.toml format?
This worked for me:
poetry add sentry-sdk --extras=flask
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With