diff --git a/.travis.yml b/.travis.yml index 3f6319fa6..8161c6e2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,8 @@ jobs: script: - coveralls # Build docs - - mamba install sphinx numpydoc sphinx_rtd_theme + - mamba install sphinx numpydoc + - conda install -c conda-forge 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..fda4ab0bc 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