Skip to content

Commit

Permalink
Update test run (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored May 30, 2024
1 parent d6cbacf commit 0cdbd43
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 135 deletions.
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

14 changes: 0 additions & 14 deletions .github/codecov.yml

This file was deleted.

62 changes: 2 additions & 60 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ jobs:
conda activate test-environment
python -c "import numba; print('Numba', numba.__version__)"
python -c "import numpy; print('Numpy', numpy.__version__)"
- name: doit test_lint
if: runner.os == 'Linux'
run: |
conda activate test-environment
doit test_lint
- name: download data
run: |
conda activate test-environment
Expand All @@ -182,59 +177,6 @@ jobs:
run: |
conda activate test-environment
doit test_examples
- name: codecov
run: |
conda activate test-environment
codecov
test_pip:
name: Pip tests on ${{ matrix.os }} with Python ${{ matrix.python-version }}
needs: [pre_commit]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
python-version: ["3.12"]
steps:
- name: Checkout source
uses: actions/checkout@v3
- uses: codecov/codecov-action@v4
with:
fetch-depth: 0
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update setuptools
run: |
pip install --upgrade setuptools
- name: Install pyctdev
run: |
pip install pyctdev
- name: doit develop_install
run: |
doit ecosystem=pip develop_install -o tests -o examples
- name: download data
run: |
python scripts/download_data.py
- name: doit env_capture
run: |
doit ecosystem=pip env_capture
- name: doit test_lint
if: runner.os == 'Linux'
run: |
doit ecosystem=pip test_lint
- name: doit test_unit
run: |
doit ecosystem=pip test_unit
- name: doit test_unit_nojit
run: |
doit ecosystem=pip test_unit_nojit
env:
NUMBA_DISABLE_JIT: 1
- name: doit test_examples
run: |
doit ecosystem=pip test_examples
- name: codecov
run: |
codecov
token: ${{ secrets.CODECOV_TOKEN }}
20 changes: 0 additions & 20 deletions examples/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from importlib.util import find_spec

import platform

collect_ignore_glob = [
"tiling.ipynb",
]
Expand All @@ -16,21 +14,3 @@
"user_guide/7_Networks.ipynb",
"user_guide/8_Polygons.ipynb",
]

# 2023-07-21 with following error:
# nbclient.exceptions.CellTimeoutError: A cell timed out while it was being executed, after 300 seconds.
# Here is a preview of the cell contents:
# -------------------
# import holoviews.operation.datashader as hd
# import holoviews as hv
# hv.extension("bokeh")
# circle = hv.Graph(edges, label='Bokeh edges').opts(node_size=5)
# hnodes = circle.nodes.opts(size=5)
# dscirc = (hd.spread(hd.datashade(circle))*hnodes).relabel("Datashader edges")
# circle + dscirc
# ------------------------------ Captured log call ------------------------------
# ERROR traitlets:client.py:841 Timeout waiting for execute reply (300s).
if platform.system() == "Windows":
collect_ignore_glob += [
"user_guide/7_Networks.ipynb",
]
14 changes: 2 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,13 @@
# 'spatialpandas',

# [tests]
'codecov',
'geodatasets',
'flake8',
'nbconvert',
'nbformat',
'nbsmoke[verify] >0.5',
'netcdf4',
'nbval',
'psutil',
'pytest-xdist',
# 'pyarrow',
'pytest <8', # Fails lint with IPynbFile is deprecated
'pytest',
'pytest-benchmark',
'pytest-cov',
# 'rasterio',
Expand All @@ -88,16 +83,11 @@

extras_require = {
'tests': geopandas + [
'codecov',
'geodatasets',
'flake8',
'nbconvert',
'nbformat',
'nbsmoke[verify] >0.5',
'nbval',
'netcdf4',
'pyarrow',
'pytest <8', # Fails lint with IPynbFile is deprecated
'pytest',
'pytest-benchmark',
'pytest-cov',
'psutil',
Expand Down
29 changes: 5 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@

[tox]
# python version test group extra envs extra commands
envlist = {py39,py310,py311,py312}-{lint,unit,unit_nojit,unit_deploy,examples,all,examples_extra}-{default}-{dev,pkg}
envlist = {py39,py310,py311,py312}-{unit,unit_nojit,unit_deploy,examples,all,examples_extra}-{default}-{dev,pkg}
build = wheel

[_lint]
description = Flake check python and notebooks, and verify notebooks
deps = .[tests]
# verify takes quite a long time - maybe split into flakes and lint?
commands = flake8
pytest --nbsmoke-lint -k ".ipynb" examples
pytest --nbsmoke-verify -k ".ipynb" examples

[_unit]
description = Run unit tests
deps = .[tests]
commands = pytest datashader -n logical --dist loadgroup --cov=./datashader --cov-append --benchmark-skip
pytest datashader --benchmark --cov=./datashader --cov-append
commands = pytest datashader -n logical --dist loadgroup --cov=./datashader --cov-report=xml --cov-append --benchmark-skip
pytest datashader --benchmark --cov=./datashader --cov-report=xml --cov-append

[_unit_deploy]
description = Run unit tests without coverage
Expand All @@ -28,7 +20,7 @@ commands = pytest datashader
[_unit_nojit]
description = Run select unit tests with numba jit disabled
deps = .[tests]
commands = pytest datashader -k "not test_tiles" -n logical --dist loadgroup --cov=./datashader --cov-append --benchmark-skip
commands = pytest datashader -k "not test_tiles" -n logical --dist loadgroup --cov=./datashader --cov-report=xml --cov-append --benchmark-skip

[_examples]
description = Test that default examples run
Expand All @@ -44,8 +36,7 @@ commands = pytest --nbsmoke-run -k ".ipynb" --ignore-nbsmoke-skip-run
[_all]
description = Run all tests (but only including default examples)
deps = .[examples, tests]
commands = {[_lint]commands}
{[_unit_deploy]commands}
commands = {[_unit_deploy]commands}
{[_examples]commands}

[_pkg]
Expand All @@ -58,23 +49,13 @@ commands = pkg: {[_pkg]commands}
unit: {[_unit]commands}
unit_nojit: {[_unit_nojit]commands}
unit_deploy: {[_unit_deploy]commands}
lint: {[_lint]commands}
examples: {[_examples]commands}
examples_extra: {[_examples_extra]commands}
all: {[_all]commands}

deps = unit: {[_unit]deps}
unit_nojit: {[_unit_nojit]deps}
unit_deploy: {[_unit_deploy]deps}
lint: {[_lint]deps}
examples: {[_examples]deps}
examples_extra: {[_examples_extra]deps}
all: {[_all]deps}

[flake8]
include = *.py
# run_tests.py is generated by conda build, which appears to have a
# bug resulting in code being duplicated a couple of times.
exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,.ipynb_checkpoints,run_test.py
ignore = E,
W

0 comments on commit 0cdbd43

Please sign in to comment.