-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #643 from geopython/tox_modernisation
Modernize CI using Tox, add a "[dev]" recipe, re-enable coveralls
- Loading branch information
Showing
7 changed files
with
127 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,55 @@ | ||
name: build ⚙️ | ||
|
||
on: [ push, pull_request ] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
main: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_SERVICE_NAME: github | ||
include: | ||
- tox-env: py37-extra | ||
python-version: 3.7 | ||
- tox-env: py38-extra | ||
python-version: 3.8 | ||
- tox-env: py39-extra | ||
python-version: 3.9 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install packages | ||
- name: Install packages 📦 | ||
run: | | ||
sudo apt-get update && sudo apt-get -y install libnetcdf-dev libhdf5-dev | ||
sudo apt-get update | ||
sudo apt-get -y install libnetcdf-dev libhdf5-dev | ||
- uses: actions/setup-python@v2 | ||
name: Setup Python ${{ matrix.python-version }} | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install requirements 📦 | ||
- name: Run flake8 ⚙️ | ||
run: | | ||
pip3 install pip --upgrade | ||
pip3 install -r requirements.txt | ||
pip3 install -r requirements-dev.txt | ||
pip3 install -r requirements-extra.txt | ||
- name: run tests ⚙️ | ||
run: pytest -v tests | ||
- name: run coveralls ⚙️ | ||
run: coveralls | ||
pip install flake8 | ||
flake8 pywps | ||
if: matrix.python-version == 3.7 | ||
- name: build docs 🏗️ | ||
run: | | ||
pip3 install -e . | ||
cd docs && make html | ||
if: matrix.python-version == 3.7 | ||
- name: run flake8 ⚙️ | ||
run: flake8 pywps | ||
- name: Install tox 📦 | ||
run: pip install tox | ||
- name: Run tests with tox ⚙️ | ||
run: tox -e ${{ matrix.tox-env }} | ||
- name: Run coveralls ⚙️ | ||
if: matrix.python-version == 3.7 | ||
uses: AndreMiras/coveralls-python-action@develop | ||
|
||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
name: Setup Python 3.7 | ||
with: | ||
python-version: 3.7 | ||
- name: Build docs 🏗️ | ||
run: | | ||
pip install -e .[dev] | ||
cd docs && make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
coverage | ||
coveralls | ||
pytest | ||
pytest-cov | ||
flake8 | ||
pylint | ||
Sphinx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
[tox] | ||
envlist=py36 | ||
envlist = py{37,38,39}{-extra,} | ||
requires = pip >= 20.0 | ||
opts = --verbose | ||
|
||
[testenv] | ||
|
||
pip_pre=True | ||
deps= | ||
lxml | ||
flask | ||
owslib | ||
simplejson | ||
jsonschema | ||
geojson | ||
shapely | ||
unipath | ||
werkzeug | ||
SQLAlchemy | ||
jinja2 | ||
|
||
commands= | ||
# check first which version is installed "gdal-config --version" | ||
pip install GDAL==2.1.0 --global-option=build_ext --global-option="-I/usr/include/gdal" | ||
python -m unittest tests | ||
setenv = | ||
PYTEST_ADDOPTS = "--color=yes" | ||
PYTHONPATH = {toxinidir} | ||
COV_CORE_SOURCE = | ||
passenv = CI GITHUB_* LD_LIBRARY_PATH | ||
download = True | ||
install_command = | ||
python -m pip install --no-user {opts} {packages} | ||
extras = dev | ||
deps = | ||
extra: -rrequirements-extra.txt | ||
commands = | ||
; # magic for gathering the GDAL version within tox | ||
; sh -c 'pip install GDAL=="$(gdal-config --version)" --global-option=build_ext --global-option="-I/usr/include/gdal"' | ||
pytest --cov |