Skip to content

Consequences of optional-dependencies in pyproject.toml #3742

Answered by abravalheri
buhtz asked this question in Q&A
Discussion options

You must be logged in to vote

The example is merely illustrative. It shows a hypothetical package that can create documents using either PDF or reStructuredText. These features are considered "optional" (not part of the package's core: maybe the user does not want to generate documents, or maybe the default is generate .txt documents).

To install these additional features with pip, one can use:

pip install 'my_package[pdf]'
# OR
pip install 'my_package[rest]'
# OR
pip install 'my_package[pdf,rest]' # both

Without the [...] part the package is installed without the additional features.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@buhtz
Comment options

@abravalheri
Comment options

Answer selected by buhtz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants