Skip to content

Commit

Permalink
Merge pull request scipy#15649 from tupui/ci_doc_pdf
Browse files Browse the repository at this point in the history
DEV/DOC: remove latex/pdf documentation
  • Loading branch information
tylerjereddy authored Feb 27, 2022
2 parents 8ba609c + e2507a5 commit 60c60c6
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 273 deletions.
70 changes: 44 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1

# Aliases to reuse
_defaults: &defaults
Expand All @@ -8,19 +8,35 @@ _defaults: &defaults
- image: cimg/python:3.8
working_directory: ~/repo

_debian: &debian
name: install Debian dependencies
command: |
sudo apt-get update
sudo apt-get install libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libfreetype6-dev libpng-dev zlib1g zlib1g-dev texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-plain-generic latexmk texlive-xetex fonts-freefont-otf
commands:
check-skip:
steps:
- run:
name: Check-skip
command: |
if [ ! -d "scipy" ]; then
echo "Build was not run due to skip, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
circleci-agent step halt;
fi
jobs:
# Build SciPy from source
build_scipy:
<<: *defaults
export git_log=$(git log --max-count=1 --pretty=format:"%B" | tr "\n" " ")
echo "Got commit message:"
echo "${git_log}"
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$git_log" == *"[skip circle]"* ]] || [[ "$git_log" == *"[circle skip]"* ]]); then
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
circleci-agent step halt;
fi
apt-install:
steps:
- checkout
- run:
name: Install apt packages
command: |
sudo apt-get update
sudo apt-get install libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev
merge:
steps:
- run:
name: merge with upstream
command: |
Expand All @@ -33,15 +49,23 @@ jobs:
git fetch upstream main;
fi
jobs:
# Build SciPy from source
build_scipy:
<<: *defaults
steps:
- checkout
- check-skip
- merge

- apt-install

- run:
name: update submodules
command: |
git submodule init
git submodule update
- run:
<<: *debian

- run:
name: setup Python venv
command: |
Expand All @@ -64,7 +88,7 @@ jobs:
- persist_to_workspace:
root: ~/
paths:
- repo
- .

# Build docs
build_docs:
Expand All @@ -73,27 +97,21 @@ jobs:
- attach_workspace:
at: ~/

- run:
<<: *debian
- check-skip
- apt-install

- run:
name: build docs
no_output_timeout: 25m
command: |
. venv/bin/activate
export SHELL=$(which bash)
python -u runtests.py -g -j2 --doc html-scipyorg --doc latex
make -C doc/build/latex all-pdf LATEXOPTS="-file-line-error -halt-on-error"
cp -f doc/build/latex/scipy-ref.pdf doc/build/html-scipyorg/
python -u runtests.py -g -j2 --doc html-scipyorg
- store_artifacts:
path: doc/build/html-scipyorg
destination: html-scipyorg

- store_artifacts:
path: doc/build/latex
destination: latex

- persist_to_workspace:
root: doc/build
paths:
Expand All @@ -107,8 +125,8 @@ jobs:
- attach_workspace:
at: ~/

- run:
<<: *debian
- check-skip
- apt-install

- run:
name: run asv
Expand Down
24 changes: 2 additions & 22 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ PYTHON = python3
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = LANG=C $(PYTHON) -msphinx
PAPER =

FILES=

# Internal variables.
PAPEROPT_a4 = -D "latex_elements.papersize=a4paper"
PAPEROPT_letter = -D "latex_elements.papersize=letterpaper"
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
ALLSPHINXOPTS = -d build/doctrees $(SPHINXOPTS) source

.PHONY: help clean html web pickle htmlhelp latex changes linkcheck \
dist dist-build version-check
.PHONY: help clean html changes linkcheck dist version-check

#------------------------------------------------------------------------------

Expand All @@ -27,7 +23,6 @@ help:
@echo " html-scipyorg to make standalone HTML files with scipy.org theming"
@echo " pickle to make pickle files (usable by e.g. sphinx-web)"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " clean to clean all build files/directories"
Expand Down Expand Up @@ -84,15 +79,12 @@ dist:
doc-dist: VERSIONWARNING=-t versionwarning

doc-dist: html-scipyorg html
test -d build/latex || make latex
make -C build/latex all-pdf LATEXOPTS="-halt-on-error"
-test -d build/htmlhelp || make htmlhelp-build
-rm -rf build/dist
mkdir -p build/dist
cp -r build/html-scipyorg build/dist
touch build/dist/index.html
(cd build/html && zip -9qr ../dist/scipy-html.zip .)
cp build/latex/scipy-ref.pdf build/dist
chmod ug=rwX,o=rX -R build/dist
find build/dist -type d -print0 | xargs -0r chmod g+s
cd build/dist && tar czf ../dist.tar.gz *
Expand All @@ -105,8 +97,6 @@ upload:
scp build/dist.tar.gz $(USERNAME)@new.scipy.org:$(UPLOAD_DIR)
ssh $(USERNAME)@new.scipy.org tar xvC $(UPLOAD_DIR) \
-zf $(UPLOAD_DIR)/dist.tar.gz
ssh $(USERNAME)@new.scipy.org mv $(UPLOAD_DIR)/scipy-ref.pdf \
$(UPLOAD_DIR)/scipy-ref-$(RELEASE).pdf
ssh $(USERNAME)@new.scipy.org mv $(UPLOAD_DIR)/scipy-html.zip \
$(UPLOAD_DIR)/scipy-html-$(RELEASE).zip
ssh $(USERNAME)@new.scipy.org rm $(UPLOAD_DIR)/dist.tar.gz
Expand All @@ -129,16 +119,6 @@ html-scipyorg:
@echo
@echo "Build finished. The HTML pages are in build/html-scipyorg."

latex: version-check latex-build
latex-build:
mkdir -p build/latex build/doctrees
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex $(FILES)
$(PYTHON) postprocess.py tex build/latex/*.tex
@echo
@echo "Build finished; the LaTeX files are in build/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."

coverage: build version-check
mkdir -p build/coverage build/doctrees
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) build/coverage $(FILES)
Expand Down
22 changes: 0 additions & 22 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,6 @@ with `python -c "import scipy; print(scipy.__file__)"`.
If the build is successful, you can open it in your browser with `make show`
(which will open `build/html-scipyorg/index.html`).


## Building pdf docs

To build the pdf docs, which requires a LaTeX install and can be more fiddly
to get to work, replace the doc build commands in the section above with:
```
python3 runtests.py --doc latex
```
or:
```
make latex
```

That will use Sphinx to generate the LaTeX sources. To then produce a pdf,
navigate to `doc/build/latex/` and run:
```
make all-pdf
```

That will produce a file `scipy-ref.pdf` in `build/latex/`.


## Building documentation for a release

For building all the documentation artifacts for a release, run:
Expand Down
56 changes: 0 additions & 56 deletions doc/postprocess.py

This file was deleted.

Loading

0 comments on commit 60c60c6

Please sign in to comment.