Skip to content

Commit

Permalink
MAINT: Use travis cache and optimize build times
Browse files Browse the repository at this point in the history
Use travis cache to save notebook execution
Move linting to faster builds
  • Loading branch information
bashtage committed Feb 5, 2020
1 parent 693c22e commit a5127dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dist: bionic
language: python
cache:
- directories:
- $TRAVIS_BUILD_DIR/docs/source/datasets/generated
- $HOME/.cache/pip
- $TRAVIS_BUILD_DIR/docs/source/examples/notebooks


Expand Down Expand Up @@ -35,6 +35,7 @@ env:
- secure: "AzwB23FWdilHKVcEJnj57AsoY5yKTWT8cQKzsH2ih9i08wIXvZXP/Ui8XRDygV9tDKfqGVltC7HpBBDE3C4ngeMlis4uuKWlkp0O1757YQe+OdDnimuDZhrh3ILEk7xW3ab5YizjLeyv3iiBW7cNS5z8W3Yu8HeJPkr6Ck30gAA="
- SM_CYTHON_COVERAGE=false # Run takes > 1 hour and so not feasible
- PYTEST_OPTIONS=--skip-slow # skip slow on travis since tested on azure
- XDIST_OPTS=""

matrix:
fast_finish: true
Expand All @@ -45,6 +46,7 @@ matrix:
- BUILD_INIT=tools/ci/travis_pip.sh
- USE_MATPLOTLIB=false
- USE_CVXOPT=false
- LINT=true
- python: 3.7
env:
- PYTHON=3.7
Expand All @@ -56,7 +58,6 @@ matrix:
- PANDAS=0.25
- NUMPY=1.17
- SCIPY=1.3
- LINT=true
- COVERAGE=true
- PYTEST_OPTIONS=
# Python 3.6 + legacy blas + older pandas
Expand Down Expand Up @@ -139,21 +140,21 @@ install:

before_script:
- if [ ${DOCBUILD} = true ]; then source tools/ci/docbuild_install.sh; fi;
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export XDIST_OPTS="-n 2"; fi

script:
# Show versions
- python -c 'import statsmodels.api as sm; sm.show_versions();'
# docbuild and exit, if required
- if [ ${DOCBUILD} = true ]; then cd ${SRCDIR}/docs; source ${SRCDIR}/tools/ci/docbuild.sh; exit 0; fi;
# Run tests
# docbuild or run tests
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export XDIST_OPTS="-n2"
if [ ${DOCBUILD} = true ]; then
cd ${SRCDIR}/docs
source ${SRCDIR}/tools/ci/docbuild.sh;
else
export XDIST_OPTS=""
echo pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
fi
- echo pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
- pytest -r a ${COVERAGE_OPTS} statsmodels --skip-examples ${XDIST_OPTS} ${PYTEST_OPTIONS}
- cd $SRCDIR
- ./lint.sh

after_success:
Expand Down
4 changes: 0 additions & 4 deletions tools/ci/docbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ cd "$SRCDIR"/docs
pytest ../statsmodels/examples/tests

set -e
# Clean up
echo '================================= Clean ================================='
make clean
git clean -xdf

# Build documentation
echo '========================================================================'
Expand Down
8 changes: 3 additions & 5 deletions tools/nbgenerate.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ def do_one(nb, to=None, execute=None, timeout=None, kernel_name=None,
with io.open(nb, mode="rb") as f:
current_hash = hashlib.sha512(f.read()).hexdigest()
update_needed = existing_hash != current_hash

if skip_existing and os.path.exists(dst) and not update_needed:
update_needed = (os.path.getmtime(dst) <= os.path.getmtime(nb))
if not update_needed:
print('Skipping {0}'.format(nb))
update_needed = update_needed or not skip_existing
if not update_needed:
print('Skipping {0}'.format(nb))

if execute and update_needed:
print("Executing %s to %s" % (nb, dst))
Expand Down

0 comments on commit a5127dc

Please sign in to comment.