From 70e9db0c26a24000688e20a7b0ea29f85ade6318 Mon Sep 17 00:00:00 2001 From: bstabler Date: Thu, 11 Nov 2021 12:54:54 -0800 Subject: [PATCH 1/3] fix website template formatting issue --- .travis.yml | 2 +- bin/build_docs.sh | 62 ----------------------------------------- docs/development.rst | 38 +++++-------------------- docs/gettingstarted.rst | 2 +- 4 files changed, 9 insertions(+), 95 deletions(-) delete mode 100755 bin/build_docs.sh diff --git a/.travis.yml b/.travis.yml index 3f6319fa6..c733c001f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ jobs: script: - coveralls # Build docs - - mamba install sphinx numpydoc sphinx_rtd_theme + - mamba install sphinx numpydoc sphinx-rtd-theme==0.5.2 - cd docs - make clean - make html diff --git a/bin/build_docs.sh b/bin/build_docs.sh deleted file mode 100755 index b46c86e0a..000000000 --- a/bin/build_docs.sh +++ /dev/null @@ -1,62 +0,0 @@ -#! /usr/bin/env bash - -# Copied from github.com/sympy/sympy -# -# This file automatically deploys changes to http://activitysim.github.io/activitysim/. -# This will only happen when building a non-pull request build on the master -# branch of ActivitySim. -# It requires an access token which should be present in .travis.yml file. -# -# Following is the procedure to get the access token: -# -# $ curl -X POST -u -H "Content-Type: application/json" -d\ -# "{\"scopes\":[\"public_repo\"],\"note\":\"token for pushing from travis\"}"\ -# https://api.github.com/authorizations -# -# It'll give you a JSON response having a key called "token". -# -# $ gem install travis -# $ travis encrypt -r sympy/sympy GH_TOKEN= env.global -# -# This will give you an access token("secure"). This helps in creating an -# environment variable named GH_TOKEN while building. -# -# Add this secure code to .travis.yml as described here http://docs.travis-ci.com/user/encryption-keys/ - -# Exit on error -set -e - -ACTUAL_TRAVIS_JOB_NUMBER=`echo $TRAVIS_JOB_NUMBER| cut -d'.' -f 2` - -if [ "$TRAVIS_REPO_SLUG" == "ActivitySim/activitysim" ] && \ - [ "$TRAVIS_BRANCH" == "master" ] && \ - [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ - [ "$ACTUAL_TRAVIS_JOB_NUMBER" == "1" ]; then - - # assume these are installed already - # echo "Installing dependencies" - # pip install sphinx numpydoc sphinx_rtd_theme - - echo "Building docs" - cd docs - make clean - make html - - cd ../../ - echo "Setting git attributes" - git config --global user.email "toliwaga@gmail.com" - git config --global user.name "Jeff Doyle" - - echo "Cloning repository" - git clone --quiet --single-branch --branch=gh-pages https://${GH_TOKEN}@github.com/ActivitySim/activitysim.git gh-pages > /dev/null 2>&1 - - cd gh-pages - rm -rf * - cp -R ../activitysim/docs/_build/html/* ./ - touch .nojekyll - git add -A . - - git commit -am "Update dev doc after building $TRAVIS_BUILD_NUMBER" - echo "Pushing commit" - git push -fq origin gh-pages > /dev/null 2>&1 -fi diff --git a/docs/development.rst b/docs/development.rst index 00a7dac22..3a27da440 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -203,19 +203,12 @@ ActivitySim testing is done with three tools: * `pytest `__, a Python testing tool * `coveralls `__, a tool for measuring code coverage and publishing code coverage stats online -To run the tests locally, first make sure the required packages are installed: +To run the tests locally, first make sure the required packages are installed. Next, run the tests with the following commands: :: - pip install pytest pytest-cov coveralls pycodestyle - - -Next, run the tests with the following commands: - -:: - - pycodestyle activitysim - py.test --cov activitysim --cov-report term-missing + pycodestyle + py.test These same tests are run by Travis with each push to the repository. These tests need to pass in order to merge the revisions into master. @@ -247,29 +240,12 @@ them into html as well. ActivitySim's docstrings are written in `numpydoc forma `__ since it is easier to use than standard rst format. -To build the documentation, first make sure the required packages are installed: - -:: - - pip install sphinx numpydoc sphinx_rtd_theme - -Next, build the documentation in html format with the following command run from the ``docs`` folder: - -:: - - make html +To build the documentation, first make sure the required packages are installed. Next, build the +documentation in html format with the "make html" command run from the ``docs`` folder. If the activitysim package is installed, then the documentation will be built from that version of -the source code instead of the git repo version. Make sure to ``pip uninstall activitysim`` before -building the documentation if needed. - -When pushing revisions to the repo, the documentation is automatically built by Travis after -successfully passing the tests. The documents are built with the ``bin/build_docs.sh`` script. -The script does the following: - -* installs the required python packages -* runs ``make html`` -* copies the ``master`` branch ``../activitysim/docs/_build/html/*`` pages to the ``gh-pages`` branch +the source code instead of the git repo version. When pushing revisions to the repo, the documentation +is automatically built by Travis after successfully passing the tests. GitHub automatically publishes the gh-pages branch at https://activitysim.github.io/activitysim. diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rst index 6e2370062..7b5ebcc6a 100644 --- a/docs/gettingstarted.rst +++ b/docs/gettingstarted.rst @@ -65,7 +65,7 @@ tools for certain development tasks:: conda install pytest pytest-cov coveralls pycodestyle pytest-regressions -c conda-forge --override-channels -n asim # packages for building documentation - conda install sphinx numpydoc sphinx_rtd_theme -c conda-forge --override-channels -n asim + conda install sphinx numpydoc sphinx_rtd_theme==0.5.2 -c conda-forge --override-channels -n asim # packages for estimation integration conda install larch -c conda-forge --override-channels -n asim From 707a903e5d36e14998d464ca657cc0d8ca0deaf0 Mon Sep 17 00:00:00 2001 From: bstabler Date: Thu, 11 Nov 2021 12:57:18 -0800 Subject: [PATCH 2/3] formatting --- docs/development.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.rst b/docs/development.rst index 3a27da440..fda4ab0bc 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -241,7 +241,7 @@ them into html as well. ActivitySim's docstrings are written in `numpydoc forma than standard rst format. To build the documentation, first make sure the required packages are installed. Next, build the -documentation in html format with the "make html" command run from the ``docs`` folder. +documentation in html format with the ``make html`` command run from the ``docs`` folder. If the activitysim package is installed, then the documentation will be built from that version of the source code instead of the git repo version. When pushing revisions to the repo, the documentation From 2193fdeef6d70349b4106be6826bb67129ee907d Mon Sep 17 00:00:00 2001 From: bstabler Date: Thu, 11 Nov 2021 13:10:04 -0800 Subject: [PATCH 3/3] get package --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c733c001f..8161c6e2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,8 @@ jobs: script: - coveralls # Build docs - - mamba install sphinx numpydoc sphinx-rtd-theme==0.5.2 + - mamba install sphinx numpydoc + - conda install -c conda-forge sphinx_rtd_theme==0.5.2 - cd docs - make clean - make html