Skip to content

Commit

Permalink
Merge pull request #159 from Unidata/tarball_checks
Browse files Browse the repository at this point in the history
tarball checks from PR #157
  • Loading branch information
jswhit authored Mar 23, 2020
2 parents 5ac5559 + 4fff59f commit b766fe8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ build/
*.egg-info
__pycache__
.pytest_cache/
dist/
51 changes: 32 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ sudo: false # use container based build
notifications:
email: false

env:
- PYTHON_VERSION=2.7
- PYTHON_VERSION=3.7
- PYTHON_VERSION=3.8

matrix:
fast_finish: true
include:
- env: PYTHON_VERSION=3.7 BUILD_DOCS="true"
- name: "python-2.7"
env: PY=2.7
- name: "python-3.7"
env: PY=3.7
- name: "python-3.8"
env: PY=3.8
- name: "tarball"
env: PY=3
- name: "docs"
env: PY=3

before_install:
# Build the conda testing environment.
Expand All @@ -25,11 +30,8 @@ before_install:
conda update conda --yes --all;
conda config --add channels conda-forge --force;
export ENV_NAME="test-environment";
conda create --yes -n ${ENV_NAME} python=${PYTHON_VERSION} --file requirements.txt --file requirements-dev.txt;
conda create --yes -n ${ENV_NAME} python=${PY} --file requirements.txt --file requirements-dev.txt;
source activate ${ENV_NAME};
if [[ "${BUILD_DOCS}" == "true" ]]; then
conda install -qy sphinx;
fi;
# Log the conda environment and package details.
- conda list -n ${ENV_NAME}
Expand All @@ -39,24 +41,35 @@ before_install:
install:
# Install cftime.
- echo "Installing cftime..."
- CYTHON_COVERAGE=1 pip install -e .
- CYTHON_COVERAGE=1 pip install -e . --no-deps --force-reinstall

script:
- if [[ "${BUILD_DOCS}" == "true" ]]; then
- if [[ $TRAVIS_JOB_NAME == python-* ]]; then
cp -r test/ /tmp ;
pushd /tmp && pytest && popd ;
fi

- if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
pushd docs && make html linkcheck O=-W && popd;
else
pytest;
fi

- if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
python setup.py --version ;
pip wheel . -w dist --no-deps ;
check-manifest --verbose ;
twine check dist/* ;
fi

after_success:
- coveralls

before_deploy:
# Remove unused, unminified javascript from sphinx
- if [[ "${BUILD_DOCS}" == "true" ]]; then
rm -f docs/build/html/_static/jquery-*.js;
rm -f docs/build/html/_static/underscore-*.js;
rm -f docs/build/html/.buildinfo;
- |
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
rm -f docs/build/html/_static/jquery-*.js
rm -f docs/build/html/_static/underscore-*.js
rm -f docs/build/html/.buildinfo
fi
deploy:
Expand All @@ -65,4 +78,4 @@ deploy:
skip_cleanup: true
on:
branch: master
condition: '${PYTHON_VERSION} == 3.7 && ${BUILD_DOCS} == "true"'
condition: '$TRAVIS_JOB_NAME == "tarball"'
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
check-manifest
coverage
coveralls
cython
pytest
pytest-cov
sphinx
twine
wheel
13 changes: 13 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,16 @@ addopts =
--cov=cftime
--cov-report term-missing
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS

[check-manifest]
ignore =
*.yml
.coveragerc
.gitignore
README.release
ci
ci/*
docs
docs/*
test
test/*

0 comments on commit b766fe8

Please sign in to comment.