# Python CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-python/ for more details # version: 2 jobs: build: docker: # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ # circleci/python3.8 images come with old versions of Doxygen(1.6.x), # therefore a new base image chose instead to guarantee to # have a newer version >= 1.8.10 to avoid warnings # that related to the default behaviors or non-exist config options - image: cimg/base:2021.05 working_directory: ~/repo steps: - checkout: - run: name: Check-skip command: | 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 - run: name: pull changes from merge command: | if [[ -v CI_PULL_REQUEST ]] ; then git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge" ; fi - run: name: update submodules command: | git submodule init git submodule update - run: name: create virtual environment, install dependencies command: | sudo apt-get update sudo apt-get install -y python3.8 python3.8-dev python3-venv graphviz texlive-fonts-recommended texlive-latex-recommended \ texlive-latex-extra latexmk texlive-xetex doxygen python3.8 -m venv venv . venv/bin/activate - run: name: build numpy command: | . venv/bin/activate pip install --progress-bar=off --upgrade pip 'setuptools<49.2.0' pip install --progress-bar=off -r test_requirements.txt pip install --progress-bar=off -r doc_requirements.txt pip install . - run: name: create release notes command: | . venv/bin/activate VERSION=$(python -c "import setup; print(setup.VERSION)") towncrier build --version $VERSION --yes ./tools/ci/test_all_newsfragments_used.py - run: name: run doctests on documentation command: | . venv/bin/activate (cd doc ; git submodule update --init) python tools/refguide_check.py --rst - run: name: build devdocs w/ref warnings command: | . venv/bin/activate cd doc # Don't use -q, show warning summary" SPHINXOPTS="-j4 -n" make -e html || echo "ignoring errors for now, see gh-13114" - run: name: build devdocs no_output_timeout: 30m command: | . venv/bin/activate cd doc make clean SPHINXOPTS="-j4 -q" make -e html - run: name: build neps command: | . venv/bin/activate cd doc/neps SPHINXOPTS="-j4 -q" make -e html - store_artifacts: path: doc/build/html/ - store_artifacts: path: doc/neps/_build/html/ # destination: neps - add_ssh_keys: fingerprints: - "9f:8c:e5:3f:53:40:0b:ee:c9:c3:0f:fd:0f:3c:cc:55" - run: name: deploy devdocs command: | if [ "${CIRCLE_BRANCH}" == "main" ]; then touch doc/build/html/.nojekyll ./tools/ci/push_docs_to_repo.py doc/build/html \ git@github.com:numpy/devdocs.git \ --committer "numpy-circleci-bot" \ --email "numpy-circleci-bot@nomail" \ --message "Docs build of $CIRCLE_SHA1" \ --force else echo "Not on the main branch; skipping deployment" fi - add_ssh_keys: fingerprints: - "11:fb:19:69:80:3a:6d:37:9c:d1:ac:20:17:cd:c8:17" - run: name: select SSH key for neps repo command: | cat <<\EOF > ~/.ssh/config Host github.com IdentitiesOnly yes IdentityFile /home/circleci/.ssh/id_rsa_11fb1969803a6d379cd1ac2017cdc817 EOF - run: name: deploy neps command: | if [ "${CIRCLE_BRANCH}" == "main" ]; then touch doc/neps/_build/html/.nojekyll ./tools/ci/push_docs_to_repo.py doc/neps/_build/html \ git@github.com:numpy/neps.git \ --committer "numpy-circleci-bot" \ --email "numpy-circleci-bot@nomail" \ --message "Docs build of $CIRCLE_SHA1" \ --force else echo "Not on the main branch; skipping deployment" fi