Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

extras_require ignores version specifier #3163

Closed
3 tasks done
Fizzadar opened this issue Oct 9, 2020 · 9 comments · Fixed by python-poetry/poetry-core#461
Closed
3 tasks done

extras_require ignores version specifier #3163

Fizzadar opened this issue Oct 9, 2020 · 9 comments · Fixed by python-poetry/poetry-core#461
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected

Comments

@Fizzadar
Copy link

Fizzadar commented Oct 9, 2020

  • 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']}
@Fizzadar Fizzadar added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 9, 2020
@abn
Copy link
Member

abn commented 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

@abn abn added Good First Issue and removed status/triage This issue needs to be triaged labels Oct 9, 2020
@abn
Copy link
Member

abn commented Oct 9, 2020

The issue lies in thow the SdistBuilder computes extras from the pyproject.toml. The fix needs to happen in poetry-core. We must, retrive extra dependencies from project level dependencies prior to serialising them.

@iadi7ya
Copy link

iadi7ya commented Oct 10, 2020

Hi @abn Can I take this up?

@abn
Copy link
Member

abn commented Oct 10, 2020

@iadi7ya definitely. If you need input, feel free to ping on discord.

Please read #3061 before contributing.

@abn
Copy link
Member

abn commented Oct 13, 2020

@iadi7ya is this something you are still working on?

@iadi7ya
Copy link

iadi7ya commented Oct 14, 2020

@iadi7ya is this something you I'm not able to find the solution for this,

I am not able to figure out solution for this.

@abn
Copy link
Member

abn commented Oct 14, 2020

As mentioned in #3061, feel free to discuss this on discord. Happy to give you pointers if you want to contirbute. The crux of what needs to be done is highlighted in the my comment above.

@finswimmer finswimmer added the area/build-system Related to PEP 517 packaging (see poetry-core) label Oct 17, 2020
@dimbleby
Copy link
Contributor

dimbleby commented 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.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants