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

Add separate conf.py for the different docs types #12900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 31, 2024

  1. Add separate conf.py for the different docs types

    The goal here is to allow building the `man` pages without all the
    additional requirements needed for the `html` docs, so that e.g.
    developers packaging `pip` can also package the man pages with minimal
    dependencies.
    
    Specifically, this should have no impact on the build output of `nox -s
    docs`, but does allow:
    
        sphinx-build \
            -c docs/man \
            -d docs/build/doctrees/man \
            -b man \
            docs/man \
            docs/build/man
    
    to run with only `sphinx` dependency (in addition to `pip`s
    dependencies). While doing this I also used long-opts to `sphinx-build`
    in the `noxfile` since I found this more understandable at a glance
    
    An `__init__.py` was added under `docs/man` to satisfy `mypy`. If this
    wasn't added it would error:
    
        docs/man/conf.py: error: Duplicate module named "conf" (also at
        "docs/html/conf.py")
        docs/man/conf.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
        docs/man/conf.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH
        Found 1 error in 1 file (errors prevented further checking)
    
    Adding an extra `__init__.py` under `docs/html` would result in a
    separate error since then the `html` module is local (and not the stdlib
    one) resulting in a error from `sphinx-build`:
    
        Extension error:
        Could not import extension sphinx.builders.linkcheck (exception: No module named 'html.parser')
    
    Issue: pypa#12881
    matthewhughes934 committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    326638d View commit details
    Browse the repository at this point in the history