diff --git a/.github/workflows/code-cov.yml b/.github/workflows/code-cov.yml new file mode 100644 index 00000000..0f46cc3c --- /dev/null +++ b/.github/workflows/code-cov.yml @@ -0,0 +1,36 @@ +name: Codecov +on: [push] +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + env: + OS: ${{ matrix.os }} + PYTHON: '3.7' + steps: + - uses: actions/checkout@master + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: 3.7 + - name: Generate coverage report + run: | + pip install pytest + pip install pytest-cov + pip install -e . + pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + files: ./coverage1.xml,./coverage2.xml + directory: ./coverage/reports/ + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: true + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml new file mode 100644 index 00000000..36edbada --- /dev/null +++ b/.github/workflows/lint-docs.yml @@ -0,0 +1,43 @@ +# This workflow only runs linting and builds the documentation + +name: Docs & Linting - Matrix OS / Python Version + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + setup-build: + name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest"] + python-version: [3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r dev-requirements.txt + pip install black flake8 + pip install -e . + - name: Build Docs + run: | + make docs -B + - name: Run Black + run: | + flake8 matplotcheck + - name: Run Flake8 + run: | + flake8 matplotcheck diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 00000000..4e1ef42d --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..6e951d18 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,53 @@ +# This workflow runs tests for matplotcheck +# Because we want a conda environment - and that builds slower, +# we divided up tests from linting and docs to make for simpler install envts + +name: Run Tests - Matrix OS / Python Version + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + example-1: + name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Setup Conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + conda-channels: conda-forge + python-version: ${{ matrix.python-version }} + + - name: Install Env + shell: bash + run: | + python --version + #conda env create -f ci/environment.yml + conda install -c conda-forge matplotlib \ + pytest requests \ + geopandas rasterio scikit-image \ + seaborn descartes + + - name: Check Environment + shell: bash + run: | + conda list + python --version + - name: Run Tests + shell: bash + run: | + pytest -v --color=yes + python --version diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0102a669..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: python -matrix: - include: - - os: linux - dist: xenial - python: 3.6 - env: TOXENV=py36 - - os: linux - dist: xenial - python: 3.7 - env: TOXENV=py37 - - os: linux - dist: xenial - python: 3.8 - env: TOXENV=py38,black,docs - - os: osx - language: generic -install: -- chmod +x .travis/install.sh -- "./.travis/install.sh" -script: -- chmod +x .travis/test.sh -- "./.travis/test.sh" -after_success: -- codecov -deploy: - provider: pypi - user: lwasser - password: - secure: imOBXR7U5VDOUZ9g4ZdMVl1ybO/bn2eHODHO6Fh2nAD9YoQ09njbNoS3nPgih5l1mCU3SW40d9t1OuEQ26qthHCt4U+AVm/BVjdMmC/qe2et4spf8ITmUd+AasiduvTsrnevsQMgzEHAEXhPTVSD+ZO2+0MqH/2Z9YHi+yzhMYFbw0HZSp0qnm837jtQQwjEwtX61BxWnB5Shdoqg8BKIzT1Hv0ME7sj/Ho4Q0Zh2YfHD+0mGGET0QQjMfI+0Xhql+D63n0W3JG6dPT/UPNAx/ywgqRANcrxwCKA9QRpgEg0a2gx0CZC8hD6bH182M/BVxTavJsM1GFVv+RYyHu3jy7JtIjSx0F8saHc+aAGB4UTaSeAf6YLlTXWTeSNdaPsPK6qEsAitk+Z8SkdENU2OzoPwqnBAFuXHjIhDDQb7raqNM17eUMRrSkABnD3134t87AVzZo2wA474nCUEH5h1zOvStGKP+twLKcyl7t+G2M409CAlvZ3mG7GU586DjIZU/J1SafNZ0ooNE5I7WLadvZuVhvX4hUPvfhNaD385SYI/dBtFHS0x4O8sNn96XXXAu9Bwl6Y3FuteRvY5uAT1MS0+rhJPnjBvQdcKTRhqRzENcIBetJdTpzHem1OTFhQYQEivf20ZuLnZrQRd4J4pfKnPrvj/Iof9OfOsidqdLc= - on: - tags: true - repo: earthlab/matplotcheck - python: 3.6 diff --git a/.travis/install.sh b/.travis/install.sh deleted file mode 100644 index 12963f60..00000000 --- a/.travis/install.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then - - # install conda and the matplotcheck-dev environment - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh - bash ~/miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - echo "conda activate base" >> ~/.bashrc - source $HOME/miniconda/bin/activate - conda config --set always_yes yes --set show_channel_urls true --set changeps1 no - conda update -q conda - conda config --add channels conda-forge - conda info -a - conda init bash - conda env create -f environment.yml - conda activate matplotcheck-dev - python setup.py install - pip install -r dev-requirements.txt - -else - sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable --yes - sudo apt-get update - sudo apt-get install -y libspatialindex-dev libgdal-dev python3-tk - pip install tox-travis -fi diff --git a/.travis/test.sh b/.travis/test.sh deleted file mode 100644 index 5b6c294c..00000000 --- a/.travis/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -if [[ $TRAVIS_OS_NAME == 'osx' ]]; then - source $HOME/miniconda/bin/activate - export PATH="$HOME/miniconda/bin:$PATH" - conda activate matplotcheck-dev - python -m pytest -v - make -B docs -else - tox -fi diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f1387f5c..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Adapted from geopandas and earthpy setup -# https://github.com/geopandas/geopandas/blob/master/appveyor.yml -# https://github.com/earthlab/earthpy/blob/master/appveyor.yml - -matrix: - fast_finish: true # immediately finish build once one of the jobs fails. - -environment: - matrix: - - PYTHON_VERSION: "3.6" - MINICONDA: C:\Miniconda36-x64 - -build: false - -init: - - "ECHO %PYTHON_VERSION% %MINICONDA%" - -install: - # cancel older builds for the same PR - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - throw "There are newer queued builds for this pull request, failing early." } - - # set up environment - - "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%" - - conda config --set always_yes yes --set show_channel_urls true --set changeps1 no - - conda update -q conda - - conda config --add channels conda-forge - - conda info -a - - conda env create -f environment.yml - - activate matplotcheck-dev - - pip install -e . --no-deps - - pip install -r dev-requirements.txt - -test_script: - - conda list - - conda info -a - - pytest diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b4f80221..00000000 --- a/tox.ini +++ /dev/null @@ -1,30 +0,0 @@ -[tox] -envlist = py36, py37, py38, black, docs - -[travis] -python = - 3.6: py36 - 3.7: py37 - 3.8: py38, docs, black - -[testenv] -passenv = * -deps = - -r{toxinidir}/dev-requirements.txt -whitelist_externals = pytest -commands = - pytest -v --basetemp={envtmpdir} --cov=matplotcheck - codecov -e TOXENV - -[testenv:black] -deps = - pip>=19.0 - black - flake8 -basepython = python3 -commands = black --check --verbose matplotcheck - flake8 matplotcheck - -[testenv:docs] -whitelist_externals = make -commands = make -B docs