diff --git a/.gitignore b/.gitignore index 45d9715e..40d52855 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build/ *.egg-info __pycache__ .pytest_cache/ +dist/ diff --git a/.travis.yml b/.travis.yml index f0a33d9a..5b6352dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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. @@ -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} @@ -39,13 +41,23 @@ 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: @@ -53,10 +65,11 @@ after_success: 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: @@ -65,4 +78,4 @@ deploy: skip_cleanup: true on: branch: master - condition: '${PYTHON_VERSION} == 3.7 && ${BUILD_DOCS} == "true"' + condition: '$TRAVIS_JOB_NAME == "tarball"' diff --git a/requirements-dev.txt b/requirements-dev.txt index 3f53d35d..92f83417 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,9 @@ +check-manifest coverage coveralls cython pytest pytest-cov +sphinx +twine +wheel diff --git a/setup.cfg b/setup.cfg index bbc27113..8605cd63 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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/* \ No newline at end of file