Skip to content

Poetry doesn't install extra dependencies when the extra is capitalised #6321

@bacon1664

Description

@bacon1664
  • 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).

  • Arch Linux x86_64 and python 3.7.9:

  • Poetry version 1.2.0:

  • I cannot disclose the contents of my pyproject file.

Issue

We have a sub-project which defines extras with a capital like so:

[tool.poetry]
name="foo"
version="1.0.0"

[tool.poetry.dependencies]
XlsxWriter = { version = "^1.2.8", optional = true }

[tool.poetry.extras]
XlsxWriter = ["XlsxWriter"]

When attempting to install this sub-project as a dependency as follows:

[tool.poetry.dependencies]
foo = {extras = ["XlsxWriter"], version="1.0.0"}

The optional dependency (XlsxWriter here) is not installed at all.

If the dependency's extra name is updated to be in low-case only like so:

[tool.poetry.extras]
xlsxwriter = ["XlsxWriter"]

And the dependent's definition is updated to match:

[tool.poetry.dependencies]
foo = {extras = ["xlsxwriter"], version="1.0.0"}

Then the optional dependency now gets installed by poetry 1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/depsRelated to representing and locking dependencieskind/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