-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Build the docs using Docker #22655
Comments
@skieffer So that folks can build the documentation easily, does it make sense to:
|
Well, I could be misunderstanding the setup/goals you have in mind, but off the top of my head I would think that none of these steps should be necessary. The Dockerfile builds an image that is self-sufficient and operates independently of your local dev environment. In other words, you never needed to install any Sphinx packages etc. on your own computer in order for this to work (and building the image doesn't install anything on your computer either). The volume mount
in the |
That being said, if the file is going to live under the So, maybe the full file should live at ###############################################################################
# This Dockerfile can be used to build an image where the HTML docs for SymPy
# can be built.
#
# If SYMPY_ROOT is the directory where the sympy repository lives, then you can
# build the image with
#
# $ cd SYMPY_ROOT
# $ docker build -f doc/Dockerfile.htmldoc -t sympy_htmldoc ./release
#
# Once the image is built, you can build the docs at any time (and from any
# directory) using
#
# $ docker run --rm -v /absolute/path/to/SYMPY_ROOT:/sympy sympy_htmldoc
#
# (substitute the actual absolute filesystem path to SYMPY_ROOT).
#
###############################################################################
FROM python:3.8.12-slim-buster
RUN apt-get update
RUN apt-get install -y make librsvg2-bin imagemagick graphviz git
COPY requirements.txt /tmp
RUN egrep "phinx|mpmath|matplotlib" /tmp/requirements.txt > /tmp/req_min.txt
RUN pip install --upgrade pip
RUN pip install -r /tmp/req_min.txt
CMD cd /sympy/doc; make html
|
@skieffer ah, forgive my ignorance, I've never used Docker before. Great! I'd just suggest adding (to the
Would you, as the Dockerfile author, like to create the pull request? I'm also happy to, or someone else could. |
Yes, definitely agree the last sentence should be added! Could maybe even offer a helpful tip about Okay, I'll open a PR. |
@skieffer the Dockerfile now gives an error after merge of #22472:
FYI, |
Thanks for the heads-up! I've pushed an updated version. If you rerun the |
Maybe we should just create a separate docs/requirements.txt. That would be more generally useful. |
Sounds good. Also updated commented instructions in Dockerfile accordingly. |
@skieffer Thanks! It worked when I used your new doc/Dockerfile.htmldoc and reran the It will definitely make building the documentation easier when your code changes are merged into the master branch! |
Okay, sounds like we're in agreement, so I'm setting it to merge after tests pass. |
By the way, |
FWIW, if building just the HTML docs is enough, then the following Dockerfile seems to work:
If you saved this as
release/Dockerfile.htmldoc
, then you could build the image withand once you had the image you could build the docs at any time with
The image weighs in at 679MB. If you wanted to also build LaTeX docs I think the image might be 5 to 10 times as large. But I find HTML docs are enough, if I just want to check that things are looking about right.
Originally posted by @skieffer in #22629 (comment)
I think it would make more sense to put the Docker file in the doc directory. The instructions for building the docs could be updated to suggest using it as an option.
Originally posted by @oscarbenjamin in #22629 (comment)
The text was updated successfully, but these errors were encountered: