Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pytest-mpl image comparison tests and update CI workflow #413

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
44 changes: 25 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Travis Continuos Integration
# Currently only tests notebook files
# Based on https://conda.pydata.org/docs/travis.html
sudo: false # use container based build
# Travis Continuous Integration
# Mamba links:
# https://mamba.readthedocs.io/en/latest/installation.html
# Sample travis file:
# https://conda.pydata.org/docs/travis.html
# Avoiding duplicate branch-pr triggers:
# https://github.com/travis-ci/travis-ci/issues/1147#issuecomment-160820262
dist: xenial
sudo: false # use container based build
language: python
dist: focal

notifications:
email: false

branches:
only:
- master

python:
- "3.7"

Expand All @@ -18,25 +27,22 @@ before_install:
echo "Only doc files were updated, not running the CI."
exit
fi
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
- conda update -q conda
- conda info -a
- curl micro.mamba.pm/install.sh | bash
- export PATH="$HOME/micromamba/bin:$PATH"
- micromamba config set always_yes true
- micromamba config set changeps1 false
- micromamba config set show_channel_urls true
- micromamba shell init --shell=bash --prefix=~/micromamba

install:
- conda env create --file ci/environment.yml
- source activate proplot-dev
- conda list
- which conda
- . ~/.bashrc
- which python
- which micromamba
- micromamba env create --file ci/environment.yml
- micromamba activate proplot-dev
- python setup.py sdist bdist_wheel
- pip install --user ./dist/*.whl
- micromamba list

script:
- ci/run-linter.sh
- pushd docs
- make html
- popd
18 changes: 5 additions & 13 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ channels:
dependencies:
- python==3.8
- numpy==1.19.5
- pandas
- xarray
- matplotlib==3.2.2
- cartopy==0.20.2
- ipykernel
- pandoc
- seaborn
- pandas
- xarray
- pint
- python-build
- setuptools
- setuptools_scm
Expand All @@ -26,14 +26,6 @@ dependencies:
- black
- doc8
- pytest
- pytest-sugar
- pyqt5
- docutils==0.16
- sphinx>=3.0
- sphinx-copybutton
- sphinx-rtd-light-dark
- jinja2==2.11.3
- markupsafe==2.0.1
- nbsphinx==0.8.1
- jupytext
- git+https://github.com/proplot-dev/sphinx-automodapi@proplot-mods
- git+https://github.com/proplot-dev/pytest-mpl@proplot-mods
3 changes: 3 additions & 0 deletions ci/run-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ flake8 proplot docs --exclude .ipynb_checkpoints --max-line-length=88 --ignore=W
echo '[isort]'
isort --recursive --check-only --line-width=88 --skip __init__.py --multi-line=3 --force-grid-wrap=0 --trailing-comma proplot

echo '[pytest]'
pytest proplot

# echo '[black]'
# black --check -S proplot

Expand Down