mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Update docs dependencies for local build (#151796)
Fixes #151786 - Changed requirements.txt to a symlink to .ci/docker/requirements-docs.txt - Updated README.md with better doc build instructions. Pull Request resolved: https://github.com/pytorch/pytorch/pull/151796 Approved by: https://github.com/malfet
This commit is contained in:
parent
81c4369d81
commit
ff075d0815
37
README.md
37
README.md
|
|
@ -423,8 +423,19 @@ make -f docker.Makefile
|
||||||
|
|
||||||
### Building the Documentation
|
### Building the Documentation
|
||||||
|
|
||||||
To build documentation in various formats, you will need [Sphinx](http://www.sphinx-doc.org) and the
|
To build documentation in various formats, you will need [Sphinx](http://www.sphinx-doc.org)
|
||||||
readthedocs theme.
|
and the pytorch_sphinx_theme2.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Before you build the documentation locally, ensure `torch` is
|
||||||
|
installed in your environment. For small fixes, you can install the
|
||||||
|
nightly version as described in [Getting Started](https://pytorch.org/get-started/locally/).
|
||||||
|
|
||||||
|
For more complex fixes, such as adding a new module and docstrings for
|
||||||
|
the new module, you might need to install torch [from source](#from-source).
|
||||||
|
See [Docstring Guidelines](https://github.com/pytorch/pytorch/wiki/Docstring-Guidelines)
|
||||||
|
for docstring conventions.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd docs/
|
cd docs/
|
||||||
|
|
@ -438,12 +449,22 @@ Run `make` to get a list of all available output formats.
|
||||||
If you get a katex error run `npm install katex`. If it persists, try
|
If you get a katex error run `npm install katex`. If it persists, try
|
||||||
`npm install -g katex`
|
`npm install -g katex`
|
||||||
|
|
||||||
> Note: if you installed `nodejs` with a different package manager (e.g.,
|
> [!NOTE]
|
||||||
`conda`) then `npm` will probably install a version of `katex` that is not
|
> If you installed `nodejs` with a different package manager (e.g.,
|
||||||
compatible with your version of `nodejs` and doc builds will fail.
|
> `conda`) then `npm` will probably install a version of `katex` that is not
|
||||||
A combination of versions that is known to work is `node@6.13.1` and
|
> compatible with your version of `nodejs` and doc builds will fail.
|
||||||
`katex@0.13.18`. To install the latter with `npm` you can run
|
> A combination of versions that is known to work is `node@6.13.1` and
|
||||||
```npm install -g katex@0.13.18```
|
> `katex@0.13.18`. To install the latter with `npm` you can run
|
||||||
|
> ```npm install -g katex@0.13.18```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> If you see a numpy incompatibility error, run:
|
||||||
|
> ```
|
||||||
|
> pip install 'numpy<2'
|
||||||
|
> ```
|
||||||
|
|
||||||
|
When you make changes to the dependencies run by CI, edit the
|
||||||
|
`.ci/docker/requirements-docs.txt` file.
|
||||||
|
|
||||||
### Previous Versions
|
### Previous Versions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
sphinx==5.3.0
|
|
||||||
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git@pytorch_sphinx_theme2#egg=pytorch_sphinx_theme2
|
|
||||||
# TODO: sphinxcontrib.katex 0.9.0 adds a local KaTeX server to speed up pre-rendering
|
|
||||||
# but it doesn't seem to work and hangs around idly. The initial thought is probably
|
|
||||||
# something related to Docker setup. We can investigate this later
|
|
||||||
sphinxcontrib.katex==0.8.6
|
|
||||||
matplotlib==3.6.0
|
|
||||||
tensorboard==2.10.0
|
|
||||||
# required to build torch.distributed.elastic.rendezvous.etcd* docs
|
|
||||||
python-etcd==0.4.5
|
|
||||||
sphinx-copybutton==0.5.0
|
|
||||||
myst-parser==0.18.1
|
|
||||||
sphinx-design==0.4.0
|
|
||||||
sphinxcontrib-mermaid==1.0.0
|
|
||||||
sphinxext-opengraph==0.9.1
|
|
||||||
1
docs/requirements.txt
Symbolic link
1
docs/requirements.txt
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../.ci/docker/requirements-docs.txt
|
||||||
Loading…
Reference in New Issue
Block a user