Skip to content

extras_require ignores version specifier #3163

Closed
python-poetry/poetry-core
#461

Description

@Fizzadar
  • 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']}

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Oct 9, 2020
  2. abn commented on Oct 9, 2020

    @abn
    Member

    @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
  3. abn commented on Oct 9, 2020

    @abn
    Member

    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.

  4. iadi7ya commented on Oct 10, 2020

    @iadi7ya

    Hi @abn Can I take this up?

  5. abn commented on Oct 10, 2020

    @abn
    Member

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

    Please read #3061 before contributing.

  6. abn commented on Oct 13, 2020

    @abn
    Member

    @iadi7ya is this something you are still working on?

  7. iadi7ya commented on Oct 14, 2020

    @iadi7ya

    @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.

  8. abn commented on Oct 14, 2020

    @abn
    Member

    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.

  9. dimbleby commented on Sep 2, 2022

    @dimbleby
    Contributor

    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.

  10. github-actions commented on Mar 1, 2024

    @github-actions

    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.

  11. locked as resolved and limited conversation to collaborators on Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/build-systemRelated to PEP 517 packaging (see poetry-core)kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions