You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
Issue
The extras section in the pyproject.toml file's doc page seem incorrect.
It states:
[tool.poetry.dependencies]
# These packages are mandatory and form the core of this package’s distribution.mandatory = "^1.0"# A list of all of the optional dependencies, some of which are included in the# below `extras`. They can be opted into by apps.psycopg2 = { version = "^2.7", optional = true }
mysqlclient = { version = "^1.3", optional = true }
[tool.poetry.extras]
mysql = ["mysqlclient"]
pgsql = ["psycopg2"]
But when performing a poetry add psycopg2 -E pgsql and poetry add mysqlclient -E mysql to recreate this example, it actually generates the following in the pyproject.toml file:
[tool.poetry.dependencies]
# These packages are mandatory and form the core of this package’s distribution.mandatory = "^1.0"# A list of all of the optional dependencies, some of which are included in the# below `extras`. They can be opted into by apps.psycopg2 = {version = "^2.7", extras = ["pgsql"]}
mysqlclient = {version = "^1.3", extras = ["mysql"]}
# No [tool.poetry.extras] section
If one adds manually the extras as stated in the doc, then poetry install -E psycopg2 will not work and will throw the message:
[ValueError]
Extra [psycopg2] is not specified.
Can create a PR for this if the problem is confirmed.
The text was updated successfully, but these errors were encountered:
esciara
changed the title
Example of pyproject.toml file for adding extras is incorrect
Doc example of pyproject.toml file for adding extras mismatches with behavior of poetry add <package> -E <extra>Aug 29, 2019
Closing as -E defines the extras to activate for the dependency, not to declare an extra for the package. There is no option on the cli to do that. Ongoing discussion to eventually create one.
Issue
The
extras
section in thepyproject.toml
file's doc page seem incorrect.It states:
But when performing a
poetry add psycopg2 -E pgsql
andpoetry add mysqlclient -E mysql
to recreate this example, it actually generates the following in thepyproject.toml
file:If one adds manually the extras as stated in the doc, then
poetry install -E psycopg2
will not work and will throw the message:Can create a PR for this if the problem is confirmed.
The text was updated successfully, but these errors were encountered: