Skip to content

Update how to install test and doc dependencies #141

Description

@ttimbers

As @flor14 mentioned in #122, --group is now used to install dev dependencies. However, I don't think how we are currently doing this is really taking advantage of this new feature. The idea here is that we can use --group to create different dependency tables in pyproject.toml that allows us to install the package with or without certain dependency groups (see docs here).

Thus, I think we should update the book further so we do take advantage of this feature. In particular, the two groups that I think that would be the most beneficial would be docs and test. The commands to create these tables and add dependencies under the groups would be something like this:

poetry add pytest --group test

That would create a table like this in pyproject.toml

[tool.poetry.group.test.dependencies]
pytest = "^6.0.0"

Then you can use poetry install --without test to install the package without installing all the test infrastructure, for example. A similar thing could be done for the docs. You can also make groups optional, and then they would only be installed if you ran poetry install --with GROUPNAME (see examples here).

What do you think @TomasBeuzen ? Do you think this is worthwhile? If we don't do this, and explain all this, it makes some commonly used commands in some files seem quite mysterious, for example this command in the recommended Poetry readthedocs.yml file (from the RTD docs page):

poetry install --with docs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions