Skip to content

Optional dependencies are getting built as required dependencies #24

@monkeez

Description

@monkeez

Given this pyproject.toml file:

[tool.poetry]
name = "example"
version = "0.1.0"
authors = [ "My Name <[email protected]>",]
description = "Example package"

[tool.poetry.dependencies]
python = "^2.7"
pytest = { version = "^3.4", optional = true }

[tool.poetry.dev-dependencies]

[tool.poetry.extras]
test = ["pytest"]

When I run poetry build, if I then go and inspect the sdist that was built, the setup.py file looks like this:

# -*- coding: utf-8 -*-
from distutils.core import setup

packages = \
['example']

package_data = \
{'': ['*']}

install_requires = \
['pytest (>=3.4.0.0,<4.0.0.0)']

setup_kwargs = {
    'name': 'example',
    'version': '0.1.0',
    'description': 'Example package',
    'long_description': None,
    'author': 'My Name',
    'author_email': '[email protected]',
    'url': None,
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>= 2.7.0.0, < 3.0.0.0',
}


setup(**setup_kwargs)

As you can see pytest has been added to install_requires and not extras_require.

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