poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Packages included in an Extra

Open BeRT2me opened this issue 1 year ago • 2 comments

  • Poetry version: Poetry (version 1.5.1)
  • Python version: Python: 3.10.10
  • OS version and name: macOS 13.5
  • pyproject.toml:
[tool.poetry.dependencies]
package =  {version = "^1.4.49", optional = false}

[tool.poetry.extras]
extra = ["package"]
  • [x] I am on the latest stable Poetry version, installed using a recommended method.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have consulted the FAQ and blog for any relevant entries or release notes.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

If I run poetry install, package installs as expected.

However,

  • If I add this project to another project poetry add <path_to_project>, then package doesn't install. (It should!)
  • If I publish the project and then do pip install my_project, then package doesn't install. (It should!)
    • But if I do pip install my_project[extra] then package does install.

Summary:

package =  {version = "^1.4.49", optional = false}

Should not have the same result as:

package =  {version = "^1.4.49", optional = true}

When it comes to installing a project externally. Just because it's included in one of the extras... especially when it installs as expected within a project.

BeRT2me avatar Aug 16 '23 19:08 BeRT2me