[pre-commit.ci] pre-commit autoupdate #325
This file contains hidden or 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
| name: sharrow testing | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| tags: | |
| - 'v[0-9]+.[0-9]+**' | |
| pull_request: | |
| branches: [ main, develop ] | |
| workflow_dispatch: | |
| jobs: | |
| fmt: | |
| name: formatting quality | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Code Quality Check with Ruff | |
| # code quality check, stop the build for any errors | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| version: "latest" | |
| args: "check . --show-fixes --exit-non-zero-on-fix" | |
| test-minimal: | |
| needs: fmt | |
| name: minimal tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.6" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| python-version: '3.11' | |
| - name: Initial simple tests | |
| # tests that sharrow can be imported and that categorical tests can be run | |
| run: | | |
| uv run pytest sharrow/tests/test_categorical.py | |
| - name: Dataset tests | |
| # tests that the datasets can be read and that the tests can be run | |
| run: | | |
| uv run pytest sharrow/tests/test_datasets.py | |
| - name: More complete test with pytest | |
| run: | | |
| uv run pytest -v --disable-warnings sharrow/tests | |
| test: | |
| needs: fmt | |
| name: ${{ matrix.os }} py${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-latest", "windows-latest"] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.6" | |
| python-version: ${{ matrix.python-version }} | |
| - name: File contents | |
| run: | | |
| cat sharrow/example_data.py | |
| - name: UV sync | |
| run: | | |
| uv self version | |
| uv cache clean | |
| uv sync --locked | |
| - name: Syntax Check with Ruff | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: "check . --select=E9,F63,F7,F82 --no-fix" | |
| - name: Code Quality Check with Ruff | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: "check . --show-fixes --exit-non-zero-on-fix" | |
| - name: Test with pytest | |
| run: | | |
| uv run --locked pytest | |
| deploy-docs: | |
| needs: test | |
| # only on pushes tagged with v... | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| environment: asim | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| environment-file: envs/testing.yml | |
| python-version: "3.10" | |
| activate-environment: testing-env | |
| auto-activate-base: false | |
| auto-update-conda: false | |
| - name: Install Jupyterbook and ruamel.yaml | |
| run: | | |
| conda install jupyter-book ruamel.yaml sphinx-autosummary-accessors -c conda-forge | |
| - name: Install sharrow | |
| run: | | |
| python -m pip install --no-deps . | |
| - name: Conda checkup | |
| run: | | |
| conda info -a | |
| conda list | |
| - name: Install pip build | |
| run: | | |
| python -m pip install --upgrade build | |
| - name: Build wheel | |
| run: | | |
| python -m build | |
| - name: Build the docs | |
| run: | | |
| python docs/_script/run_all.py | |
| jupyter-book build ./docs | |
| - name: Push to GitHub Pages | |
| uses: peaceiris/[email protected] | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| # Token is created automatically by Github Actions, no other config needed | |
| publish_dir: ./docs/_build/html | |
| # now send to PyPI | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| if: github.repository_owner == 'ActivitySim' | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| activitysim-examples: | |
| # test that updates to sharrow will not break the activitysim canonical examples | |
| needs: fmt | |
| env: | |
| python-version: "3.10" | |
| label: linux-64 | |
| strategy: | |
| matrix: | |
| include: | |
| - region: ActivitySim 1-Zone Example (MTC) | |
| region-org: ActivitySim | |
| region-repo: activitysim-prototype-mtc | |
| region-branch: extended | |
| - region: ActivitySim 2-Zone Example (SANDAG) | |
| region-org: ActivitySim | |
| region-repo: sandag-abm3-example | |
| region-branch: main | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| name: ${{ matrix.region }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 720 # Sets the timeout to 12 hours | |
| steps: | |
| - name: Checkout Sharrow | |
| uses: actions/checkout@v4 | |
| with: | |
| path: 'sharrow' | |
| - name: Checkout ActivitySim | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'ActivitySim/activitysim' | |
| ref: 'main' | |
| path: 'activitysim' | |
| - name: Setup UV | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.6" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| python-version: ${{ env.python-version }} | |
| - name: Set cache date for year and month | |
| run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV | |
| - name: Create Virtual Env | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install "black==22.12.0" "coveralls==3.3.1" \ | |
| "cytoolz==0.12.2" "dask==2023.11.*" "isort==5.12.0" \ | |
| "multimethod<2.0" "nbmake==1.4.6" "numba==0.57.*" \ | |
| "numpy==1.24.*" "openmatrix==0.3.5.0" "orca==1.8" \ | |
| "pandera>=0.15,<0.18.1" "pandas==2.2.*" "platformdirs==3.2.*" \ | |
| "psutil==5.9.*" "pyarrow==11.*" "pydantic==2.6.*" "pypyr==5.8.*" \ | |
| "tables>=3.9" "pytest==7.2.*" "pytest-cov" "pytest-regressions" \ | |
| "pyyaml==6.*" "requests==2.28.*" "ruff" "scikit-learn==1.2.*" \ | |
| "sharrow>=2.9.1" "simwrapper>1.7" "sparse" "xarray==2025.01.*" \ | |
| "zarr>=2,<3" "zstandard" \ | |
| ./sharrow ./activitysim | |
| - name: UV checkup | |
| run: | | |
| source .venv/bin/activate | |
| uv pip list | |
| - name: Checkout Example | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: '${{ matrix.region-org }}/${{ matrix.region-repo }}' | |
| ref: '${{ matrix.region-branch }}' | |
| path: '${{ matrix.region-repo }}' | |
| - name: Test ${{ matrix.region }} | |
| run: | | |
| source .venv/bin/activate | |
| cd ${{ matrix.region-repo }} | |
| python -m pytest ./test |