language: python
dist: bionic  # Ubuntu 18.04
python:
- "3.10"
- "3.9"
- "3.8"
# Install dependencies through apt
before_install:
  - sudo apt-get -y -qq update
  - sudo apt-get -y -qq install openslide-tools
  - sudo apt-get -y -qq install libopenjp2-7 libopenjp2-tools
  - sudo apt list libopenjp2-7 libopenjp2-tools
install: pip install -U tox-travis
script: tox
after_success:
  # Upload coverage to codecov
  - curl -Os https://uploader.codecov.io/latest/linux/codecov
  - chmod +x codecov
  - ./codecov
  # Install deepsource CLI
  - curl https://deepsource.io/cli | sh
  # Report coverage artifact to 'test-coverage' analyzer
  - ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
deploy:
  - provider: pypi
    server: https://test.pypi.org/legacy/
    distributions: sdist bdist_wheel
    skip_existing: true
    user: __token__
    password:
      secure: NoQ7PcqB0VDF9yycRHaBGIZoOfDWXDpMVEM+M2z7zVfKxQZIaDYMZxGJ05D5fTTVw7ZYldDWKg+VX4p0RedKuVadESdubVZzLiqzuVkHH7pgX8pIsRjM2GkGPZ6tQxzCczYUTBcr8bqQ7wHy6Xu1LG1oEUAdLfCH/9gQZoAlmIEgxQN62RdZub5cRLh+T7FnlXb1GwLVjzbub0O7CVNTSkoh+F7OOtzvxicVf007i30CTtTs3ypj59OEkKQB+0Zv8wbvInAW2s9NPt2OXhXLKQ7Ltoxe+/HhBg8urfcCFhezOUIywe48LTm9j0S4K/OjgieunBLkopx2yCqYW7yO/TwjC4NLkNIXKnmuyW1TS7QCHqlFDLILitJxaBhNH8IX0ZjNCi5W1zRn6p5fdDu8o5nGq0MLYM9jm37FYydioRN3lSlqukYoOFPJL/y/xgynvigfi1jvkLczjnaNovT0+hL075qFx6Gs4jUry10/P+SnrrS9r+EcdiCcsCs8zsEW1yiOD1Rvnu8eN/Tj1QNGGqCEOXYCjqVnG/sh1BJbAvGhVQV8OHQMjzTZzRJw+SD38uqvApFRzcvXu5jvyAWd1n0t9LHxeYx8Ko7pnc5VLFl2Irp3SrHKxeCc2El7Rn/SSsbQVE9Ja9WF6DSywxsSrO7X09sxzFxlz4udMJfm6Ts=
    on:
      branch: pre-release
      repo: John-P/wsic
      python: 3.9
  - provider: pypi
    distributions: sdist bdist_wheel
    user: __token__
    password:
      secure: tmVDsyav87+v0r+yKSfGESIZ16r02v3kwyHMr+KBq5Y5j5oaFl/zo1ZA7wRoqPDPVrtyUtS/mJRJwDM3LPKdVlFwy2jSQFHQiEs52d2rPPYZjLNTYVz4BUgm7AHC2E8XB+wcYbksTj5JY+FSSLbo9k8UYZ3uZfIkkxYVlEZTLm1vwT0mmWoTBufb9blY3Xxrxa/q3AF9fO2xY14hdkiVj2InyIdp3jqE5ehh6EDk8ZXi91O7b7kxV2x82UMqv0Xgl1pBNZyQr8oSRhbkb70amc2mRDn0GWTTxrEsv87SrPBcQbtnlWNVnY9Fhfqc32JyVXXtvAW9xfktN17j8muWrUGO6vf8Q/N/VVuCkXeqSqx7BBKbQyezAhgH3rkl+QC0OsDlE2KFfsfXF+RMWQZG8kutDrDP/2/C5v7R8x9+adsM/Kl7tD8Pk9SVRSD4N8edJkvi4KxRv9cpxRcP29yspOI/Ba0usND3Oz5y5Txool+Rmh8GYe6AzEr/vKcMuzVd4CZSAMRuIJ6sWsCCHgtHj88BA1ySJARYI6EjNAirtbyPvy4sRzxIaexd6/9XjWPqZkXkncspS+YXyXJf7SPf7/CBPuf87MKvcJVrmjWlePvkWLTvZEDrksugD3P8zJdgpEGyseSX+hfWfWxmfL1w7WEKnbAHqorCSX1M776LTEg=
    on:
      tags: true
      repo: John-P/wsic
      python: 3.9
