question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`extras_require` ignores version specifier

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

The extras_require in the generated setup.py ignores the version specified in the pyproject.toml, leading to inconsistent/broken builds when installing a package with extras.

Gist above contains full info, but specifically:

[tool.poetry.dependencies]
kombu = {version = '^=4.5', optional = true}

[tool.poetry.extras]
queue = ['kombu']

Becomes:

extras_require = \
{'queue': ['kombu']}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
abncommented, Oct 9, 2020

@Fizzadar you can add the following to your pyproject.toml to avoid this altogether. Poetry will stop generating setup files by default in coming release.

[tool.poetry.build]
generate-setup-file = false
0reactions
dimblebycommented, Sep 2, 2022

This issue is a big misunderstanding, the actual problem is this bogus version ^=4.5

if you replace that with ^4.5 which is presumably what was intended then the requirement comes out as 'kombu>=4.5,<5.0'.

so it would still be nice if poetry rejected the bad version rather than somehow interpreting it as being *: but that’s the real problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a default extra_require environment - Packaging
We just need to allow users to create an environment called None. For now the following will fail: from setuptools import setup extras_require...
Read more >
How to specify platforms-specific extras or version in Pipfile?
It's not clear what to do when one wants to specify different version or options for a package, depending on the platform. Specifically,...
Read more >
setup.py vs setup.cfg in Python - Towards Data Science
python_requires : This is a comma-separate string that contains version specifiers for the Python version supported by the package. install_requires : A list...
Read more >
PDM - The Blue Book - GitHub Pages
If the package is given without a version specifier like pdm add requests . ... to tell PDM to ignore the version specifiers...
Read more >
setuptools.txt
``extras_require`` A dictionary mapping names of "extras" (optional features of your ... Version specifiers for a given project are internally sorted into ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found