Given this pyproject.toml file:
[tool.poetry]
name = "example"
version = "0.1.0"
authors = [ "My Name <example@gmail.com>",]
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': 'example@gmail.com',
'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.
Given this
pyproject.tomlfile:When I run
poetry build, if I then go and inspect the sdist that was built, thesetup.pyfile looks like this:As you can see
pytesthas been added toinstall_requiresand notextras_require.