Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] MAINT moving to modern way of building docs. #9402

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

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
debugging attempt
  • Loading branch information
NelleV committed Oct 19, 2017
commit 11568d47b1822725e43f0a34b8c7fd6f18f9ca53
56 changes: 44 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,33 @@ apt-run: &apt-install
libgeos-dev \
otf-freefont

conda-run: &conda-install
conda36-run: &conda36-install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why switch to conda? It looks like all we are using is python and then pip installing everything else.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switch to conda only for the environment: we now need to access the scripts "sphinx-build", and not only the library as before. When installing with --user, we either need to change the PYTHONPATH manually, or use conda.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use python -msphinx instead? AFAIK sphinx-build is a strict synonym to it, except that python -msphinx looks up PYTHONPATH (which is the same as what we did before in make.py) whereas sphinx-build uses PATH (which may be set differently).

This relates to my earlier point about using the shorter/newer makefile generated by recent versions of sphinx.

name: Install conda
command: |
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
export PATH="$MINICONDA_PATH/bin:$PATH"
chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
echo $PATH
conda update --yes --quiet conda

# Configure the conda environment and put it in the path using the
# provided versions
conda create -n $CONDA_ENV_NAME --yes --quiet python
conda create -n testenv --yes --quiet python
source activate testenv

conda27-run: &conda27-install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these are templated so you don't need to write out two copies for Python 3 and 2. There should not be a separate 36 and 27 template. You can use an environment variable to differentiate if necessary (see the NUMPY variable for example).

name: Install conda
command: |
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda update --yes --quiet conda

# Configure the conda environment and put it in the path using the
# provided versions
conda create -n testenv --yes --quiet python
source activate testenv

fonts-run: &fonts-install
Expand All @@ -66,23 +81,40 @@ pip-run: &pip-install
# Upgrade pip and setuptools and wheel to get as clean an install as possible
name: Upgrade pip, setuptools, wheel
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate testenv
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools

deps-run: &deps-install
name: Install Python dependencies
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate testenv
pip install python-dateutil numpy${NUMPY_VERSION} pyparsing!=2.1.6 cycler codecov coverage sphinx pillow
pip install -r doc-requirements.txt

mpl-run: &mpl-install
name: Install Matplotlib
command: pip install -ve .
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate testenv
pip install -ve .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the docs build with a non-editable installation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should. I can switch to pip install -v . if you prefer.


linkchecker-run: &linkchecker-install
name: Install linkchecker
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate testenv
pip install $PRE requests==2.9.2 linkchecker

doc-run: &doc-build
name: Build documentation
command: make
command: |
export PATH="$HOME/miniconda/bin:$PATH"
source activate testenv
make
working_directory: doc

doc-bundle-run: &doc-bundle
Expand All @@ -96,14 +128,14 @@ doc-bundle-run: &doc-bundle
#

jobs:
docs-python35:
docs-python36:
docker:
- image: circleci/python:3.5
- image: circleci/python:3.6
steps:
- checkout

- run: *apt-install
- run: *conda-install
- run: *conda36-install
- run: *fonts-install
- run: *pip-install

Expand Down Expand Up @@ -137,7 +169,7 @@ jobs:
- checkout

- run: *apt-install
- run: *conda-install
- run: *conda27-install
- run: *fonts-install
- run: *pip-install

Expand All @@ -147,7 +179,7 @@ jobs:
NUMPY_VERSION: "==1.7.1"
# Linkchecker only works with python 2.7 for the time being.
# Linkchecker is currently broken with requests 2.10.0 so force an earlier version.
- run: pip install $PRE requests==2.9.2 linkchecker
- run: *linkchecker-install
- run: *mpl-install

- run: *doc-build
Expand Down Expand Up @@ -181,5 +213,5 @@ workflows:
version: 2
build:
jobs:
- docs-python35
- docs-python36
- docs-python27
2 changes: 1 addition & 1 deletion doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ipython
mock
numpydoc
pillow
sphinx-gallery>=0.1.12
sphinx-gallery
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why drop the pinning on this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a mistake… putting it back.