Skip to content

Use additional dependencies to allow configuration of sphinx version #1

@thclark

Description

@thclark

We have install_requires like:

install_requires =
    Sphinx>=2.0.0
    sphinx-rtd-theme>=0.4.2
    sphinx-tabs>=1.1.10
    breathe>=4.11.1
    exhale>=0.2.1

But the versions people use might vary wildly.

Proposed solution

Take a leaf out of flake8's book, and use additional installs in the pre-commit config:

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.8.1
    hooks:
      - id: flake8
        additional_dependencies: [flake8-isort]
        language_version: python3

So people's config files would look like:

  - repo: https://github.com/thclark/pre-commit-sphinx
    rev: 0X.Y.Z
    hooks:
      - id: build-docs
         additional_dependencies: [
            Sphinx>=2.0.0
            sphinx-rtd-theme>=0.4.2
            sphinx-tabs>=1.1.10
            breathe>=4.11.1
            exhale>=0.2.1
        ]
        language_version: python3

This has the extra benefit of avoiding the need to set up sphinx dependencies in the developer environment. After a first run of pre-commit, developers will have local docs built.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions