@@ -447,34 +447,57 @@ be ambiguous in the face of ``[project.scripts]`` and
447447
448448
449449.. _pyproject-toml-dependencies :
450- .. _pyproject-toml-optional-dependencies :
451450
452- ``dependencies ``/`` optional-dependencies ``
453- ------------------------------------------
451+ ``dependencies ``
452+ ----------------
454453
455- - TOML _ type: Array of :pep: `508 ` strings (``dependencies ``), and a
456- table with values of arrays of :pep: `508 ` strings
457- (``optional-dependencies ``)
454+ - TOML _ type: Array of :ref: `dependency specifier <dependency-specifiers >`
455+ strings (``dependencies ``)
458456- Corresponding :ref: `core metadata <core-metadata >` field:
459- :ref: `Requires-Dist <core-metadata-requires-dist >` and
460- :ref: `Provides-Extra <core-metadata-provides-extra >`
457+ :ref: `Requires-Dist <core-metadata-requires-dist >`
461458
462- The (optional) dependencies of the project.
459+ ``dependencies `` lists the expected dependencies of the project as an
460+ array of strings.
463461
464- For ``dependencies ``, it is a key whose value is an array of strings.
465462Each string represents a dependency of the project and MUST be
466- formatted as a valid :pep: `508 ` string. Each string maps directly to
467- a :ref: `Requires-Dist <core-metadata-requires-dist >` entry.
463+ formatted as a valid :ref: `dependency specifier <dependency-specifiers >`.
464+
465+ Each string maps directly to a
466+ :ref: `Requires-Dist <core-metadata-requires-dist >` entry.
467+
468+ Dependencies listed in this array are always considered
469+ for installation, but may still contain environment markers that cause them
470+ to be skipped in some environments.
471+
472+
473+ .. _pyproject-toml-optional-dependencies :
474+
475+ ``optional-dependencies ``
476+ -------------------------
477+
478+ - TOML _ type: table with string keys mapping to arrays of
479+ :ref: `dependency specifier <dependency-specifiers >` strings (``optional-dependencies ``)
480+ - Corresponding :ref: `core metadata <core-metadata >` fields:
481+ :ref: `Requires-Dist <core-metadata-requires-dist >` and
482+ :ref: `Provides-Extra <core-metadata-provides-extra >`
483+
484+ ``optional-dependencies `` is a table where each key specifies
485+ an extra and whose value is an array of strings using the same format as the
486+ ``dependencies `` array (the strings in the
487+ arrays must be valid :ref: `dependency specifiers <dependency-specifiers >`).
468488
469- For ``optional-dependencies ``, it is a table where each key specifies
470- an extra and whose value is an array of strings. The strings of the
471- arrays must be valid :pep: `508 ` strings. The keys MUST be valid values
489+ The keys MUST be valid values
472490for :ref: `Provides-Extra <core-metadata-provides-extra >`. Each value
473491in the array thus becomes a corresponding
474492:ref: `Requires-Dist <core-metadata-requires-dist >` entry for the
475493matching :ref: `Provides-Extra <core-metadata-provides-extra >`
476494metadata.
477495
496+ The optionality of these dependencies is recorded by modifying the environment
497+ marker clause on the related ``Requires-Dist `` entries to check the extra name.
498+ Optional dependencies are thus only considered for installation if installation
499+ if the associated extra name is requested.
500+
478501
479502.. _pyproject-toml-import-names :
480503
@@ -647,4 +670,7 @@ History
647670- October 2025: The ``import-names `` and ``import-namespaces `` keys were added
648671 through :pep: `794 `.
649672
673+ - January 2026: Replaced outdated direct reference to :pep: `508 ` with a
674+ reference to :ref: `dependency-specifiers `.
675+
650676.. _TOML : https://toml.io
0 commit comments