OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python Poetry specify dependency on `sentry-sdk[flask]`

  • Thread starter Thread starter clay
  • Start date Start date
C

clay

Guest
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:

Code:
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:

Code:
[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:

Code:
[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?
<p>I'm trying to add support for Sentry to an existing Python Flask application that uses Python Poetry for dependency management.</p>
<p>The Sentry docs say to run this:</p>
<pre class="lang-bash prettyprint-override"><code>pip install --upgrade 'sentry-sdk[flask]
</code></pre>
<p>That works. But I want to convert that into a <code>pyproject.toml</code> dependency entry for Python Poetry. If I try just this:</p>
<pre class="lang-ini prettyprint-override"><code>[tool.poetry.dependencies]
# <snip>
sentry-sdk = "1.5.12"
</code></pre>
<p>I get a <code>SolverProblemError</code>:</p>
<blockquote>
<p>... depends on sentry-sdk (1.5.12) which doesn't match any versions, version solving failed.</p>
</blockquote>
<p>If I try:</p>
<pre class="lang-ini prettyprint-override"><code>[tool.poetry.dependencies]
# <snip>
sentry-sdk[flask] = "1.5.12"
</code></pre>
<p>I get <code>Invalid TOML file</code>.</p>
<p>How do I convert this pip dependency to Python <code>pyproject.toml</code> format?</p>
 

Latest posts

Online statistics

Members online
0
Guests online
3
Total visitors
3
Top