Skip to content

Commit

Permalink
Testing in Github Actions for 3 OSs (ActivitySim#2)
Browse files Browse the repository at this point in the history
* fix for using mamba
* self install to get _version
* strategy on three os
* matrix test
* require dask
* require networkx
* required libs for tests only
* required zarr for tests only
* remove version flag in doctests
* get missing DIST skims into zarr
  • Loading branch information
jpn-- authored Feb 18, 2022
1 parent a01814b commit f1a076a
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 10 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ on:

jobs:
build:

runs-on: ubuntu-latest
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]

os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -23,13 +26,20 @@ jobs:
- name: Install dependencies
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: testing-env
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: envs/testing.yml
python-version: ${{ matrix.python-version }}
activate-environment: testing-env
auto-activate-base: false
auto-update-conda: false
- name: Install sharrow
run: |
python -m pip install --no-deps -e .
- name: Conda checkup
run: |
conda info
conda info -a
conda list
- name: Lint with flake8
run: |
Expand All @@ -39,4 +49,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
python -m pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json
_version.py
.idea
.vscode

# Sharrow
!sharrow/example_data/skims.zarr/**
1 change: 0 additions & 1 deletion docs/walkthrough/encoding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"source": [
"# check versions\n",
"import packaging\n",
"assert packaging.version.parse(sh.__version__) >= packaging.version.parse(\"1.0.0\")\n",
"assert packaging.version.parse(xr.__version__) >= packaging.version.parse(\"0.20.2\")"
]
},
Expand Down
1 change: 0 additions & 1 deletion docs/walkthrough/one-dim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"source": [
"# check versions\n",
"import packaging\n",
"assert packaging.version.parse(sh.__version__) >= packaging.version.parse(\"1.0.0\")\n",
"assert packaging.version.parse(xr.__version__) >= packaging.version.parse(\"0.20.2\")"
]
},
Expand Down
1 change: 0 additions & 1 deletion docs/walkthrough/two-dim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"source": [
"# TEST check versions\n",
"import packaging\n",
"assert packaging.version.parse(sh.__version__) >= packaging.version.parse(\"1.0.0\")\n",
"assert packaging.version.parse(xr.__version__) >= packaging.version.parse(\"0.20.2\")"
]
},
Expand Down
9 changes: 9 additions & 0 deletions envs/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ dependencies:
- pandas>=1.2
- pyarrow
- xarray
- dask
- networkx
- numba>=0.53
- numexpr
- filelock
- flake8
# required for testing
- pytest
- pytest-cov
- pytest-regressions
- pytest-xdist
- nbmake
- openmatrix
- zarr
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ install_requires =
numba >= 0.53
numexpr
filelock
dask
networkx

[flake8]
exclude =
Expand Down
22 changes: 22 additions & 0 deletions sharrow/example_data/skims.zarr/DIST/.zarray
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"chunks": [
25,
25
],
"compressor": {
"blocksize": 0,
"clevel": 5,
"cname": "lz4",
"id": "blosc",
"shuffle": 1
},
"dtype": "<f4",
"fill_value": "NaN",
"filters": null,
"order": "C",
"shape": [
25,
25
],
"zarr_format": 2
}
6 changes: 6 additions & 0 deletions sharrow/example_data/skims.zarr/DIST/.zattrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"_ARRAY_DIMENSIONS": [
"otaz",
"dtaz"
]
}
Binary file added sharrow/example_data/skims.zarr/DIST/0.0
Binary file not shown.

0 comments on commit f1a076a

Please sign in to comment.