Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use additional dependencies to allow configuration of sphinx version #1

Open
thclark opened this issue Jun 19, 2020 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@thclark
Copy link
Owner

thclark commented Jun 19, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant