@@ -449,36 +449,57 @@ be ambiguous in the face of ``[project.scripts]`` and
449449
450450
451451.. _pyproject-toml-dependencies :
452- .. _pyproject-toml-optional-dependencies :
453452
454- ``dependencies ``/`` optional-dependencies ``
455- ------------------------------------------
453+ ``dependencies ``
454+ ----------------
456455
457- - TOML _ type: Array of :ref: `dependency-specifiers ` strings (``dependencies ``),
458- and a table with values of arrays of :ref: `dependency-specifiers ` strings
459- (``optional-dependencies ``)
456+ - TOML _ type: Array of :ref: `dependency specifier <dependency-specifiers >`
457+ strings (``dependencies ``)
460458- Corresponding :ref: `core metadata <core-metadata >` field:
461- :ref: `Requires-Dist <core-metadata-requires-dist >` and
462- :ref: `Provides-Extra <core-metadata-provides-extra >`
459+ :ref: `Requires-Dist <core-metadata-requires-dist >`
463460
464- The (optional) dependencies of the project.
461+ ``dependencies `` lists the expected dependencies of the project as an
462+ array of strings.
465463
466- For ``dependencies ``, it is a key whose value is an array of strings.
467464Each string represents a dependency of the project and MUST be
468- formatted as a valid :ref: `dependency-specifiers ` string.
465+ formatted as a valid :ref: `dependency specifier <dependency-specifiers >`.
466+
469467Each string maps directly to a
470468:ref: `Requires-Dist <core-metadata-requires-dist >` entry.
471469
472- For ``optional-dependencies ``, it is a table where each key specifies
473- an extra and whose value is an array of strings. The strings of the
474- arrays must be valid :ref: `dependency-specifiers ` strings.
470+ Dependencies listed in this array are always considered
471+ for installation, but may still contain environment markers that cause them
472+ to be skipped in some environments.
473+
474+
475+ .. _pyproject-toml-optional-dependencies :
476+
477+ ``optional-dependencies ``
478+ -------------------------
479+
480+ - TOML _ type: table with string keys mapping to arrays of
481+ :ref: `dependency specifier <dependency-specifiers >` strings (``optional-dependencies ``)
482+ - Corresponding :ref: `core metadata <core-metadata >` fields:
483+ :ref: `Requires-Dist <core-metadata-requires-dist >` and
484+ :ref: `Provides-Extra <core-metadata-provides-extra >`
485+
486+ ``optional-dependencies `` is a table where each key specifies
487+ an extra and whose value is an array of strings using the same format as the
488+ ``dependencies `` array (the strings in the
489+ arrays must be valid :ref: `dependency specifiers <dependency-specifiers >`).
490+
475491The keys MUST be valid values
476492for :ref: `Provides-Extra <core-metadata-provides-extra >`. Each value
477493in the array thus becomes a corresponding
478494:ref: `Requires-Dist <core-metadata-requires-dist >` entry for the
479495matching :ref: `Provides-Extra <core-metadata-provides-extra >`
480496metadata.
481497
498+ The optionality of these dependencies is recorded by modifying the environment
499+ marker clause on the related ``Requires-Dist `` entries to check the extra name.
500+ Optional dependencies are thus only considered for installation if installation
501+ if the associated extra name is requested.
502+
482503
483504.. _pyproject-toml-import-names :
484505
0 commit comments