Skip to content

Commit

Permalink
Merge branch 'main' into nicolai/multi-apply-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
n-io committed Dec 17, 2024
2 parents e662fb4 + 3725f40 commit 3f94a4a
Show file tree
Hide file tree
Showing 59 changed files with 4,106 additions and 1,114 deletions.
5 changes: 3 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ branch = True
omit =
# Autogenerated missed code handles other VCSes.
xdsl/_version.py
tests/filecheck/frontend/*
concurrency = multiprocessing
parallel = True
source =
xdsl/
tests/
docs/



[report]
# Regexes for lines to exclude from consideration
exclude_lines =
Expand All @@ -23,3 +22,5 @@ exclude_lines =
raise ValueError
raise TypeError
raise RuntimeError
format = markdown
ignore_errors = True
20 changes: 8 additions & 12 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install the package and dev dependencies locally
run: pip install -e ".[dev]"
- name: Install the project
run: VENV_EXTRAS="--extra dev" make venv

- name: Run all tests
run: |
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/ci-lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI - Lockfile

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- main
pull_request:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install the package locally and check for lockfile mismatch
run: |
# Install all default extras.
# Fail if the lockfile dependencies are out of date with pyproject.toml.
XDSL_VERSION_OVERRIDE="0+dynamic" uv sync --extra gui --extra dev --extra jax --extra riscv --locked
35 changes: 17 additions & 18 deletions .github/workflows/ci-mlir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,23 @@ jobs:
packages: mesa-vulkan-drivers
version: 1.0

- name: Python Setup
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
enable-cache: true
cache-dependency-glob: "xdsl/uv.lock"

- name: Upgrade pip
- name: Set up Python ${{ matrix.python-version }}
run: |
pip install --upgrade pip
# Change directory so that xdsl-opt can be found during installation.
cd xdsl
uv python install ${{ matrix.python-version }}
- name: Install the package locally and nbval
run: |
# Change directory so that xdsl-opt can be found during installation.
cd xdsl
pip install -r requirements.txt
VENV_EXTRAS="--all-extras" make venv
- name: Cache binaries
id: cache-binary
Expand Down Expand Up @@ -99,36 +98,36 @@ jobs:
- name: Test with pytest and generate code coverage
run: |
cd xdsl
pytest -W error --cov --cov-config=.coveragerc .
uv run pytest -W error --cov --cov-config=.coveragerc .
- name: Execute lit tests
run: |
cd xdsl
# Add mlir-opt to the path
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
lit -v tests/filecheck/ -DCOVERAGE
lit -v docs/Toy/examples/ -DCOVERAGE
uv run lit -v tests/filecheck/ -DCOVERAGE
uv run lit -v docs/Toy/examples/ -DCOVERAGE
- name: Test MLIR dependent examples/tutorials
run: |
cd xdsl
# Add mlir-opt to the path
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
pytest --nbval docs/mlir_interoperation.ipynb --maxfail 1 -vv
uv run pytest --nbval docs/mlir_interoperation.ipynb --maxfail 1 -vv
- name: Test ONNX-dependent marimo notebooks
run: |
cd xdsl
# Add mlir-opt to the path
export PATH=$PATH:${GITHUB_WORKSPACE}/llvm-project/build/bin/
make tests-marimo-onnx
uv run make tests-marimo-onnx
- name: Combine coverage data
run: |
cd xdsl
coverage combine --append
coverage report
coverage xml
uv run coverage combine --append
uv run coverage report
uv run coverage xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/ci-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Install the package locally
run: pip install -r requirements.txt
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install the project
run: make venv

- name: Run examples/tutorials
run: |
# mlir_interoperation.ipynb is dependent on MLIR, and is tested in the MLIR-enabled workflow.
pytest -W error --nbval -vv docs --ignore=docs/mlir_interoperation.ipynb
uv run pytest -W error --nbval -vv docs --ignore=docs/mlir_interoperation.ipynb
- name: Test marimo notebooks
run: |
make tests-marimo
26 changes: 16 additions & 10 deletions .github/workflows/ci-pyright-fails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,26 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
- name: Install the package locally
run:
pip install -r requirements.txt
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install the project and activate its virtual environment
run: |
make venv
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Generate IRDL stubs
run: xdsl-stubgen

- name: Pyright
uses: jakebailey/pyright-action@v2
with:
version: PATH
venv-path: .venv
18 changes: 7 additions & 11 deletions .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
- name: Upgrade pip
run: |
pip install --upgrade pip
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Run code formatting checks with pre-commit
uses: pre-commit/[email protected]
18 changes: 7 additions & 11 deletions .github/workflows/jupyterlite.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Deploy JupyterLite Page

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
# Trigger the workflow every day at 4:15am
schedule:
- cron: '15 4 * * *'

Expand All @@ -15,18 +14,15 @@ jobs:
with:
path: xdsl

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: |
python -m pip install jupyterlite-core==0.2.3 jupyterlite-pyodide-kernel==0.2.1 libarchive-c build pyodide-build==0.24.1 jupyter-server
uv tool install jupyterlite-core==0.2.3 jupyterlite-pyodide-kernel==0.2.1 libarchive-c build pyodide-build==0.24.1 jupyter-server
- name: Build xDSL source distribution
run: |
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'pip' # caching pip dependencies
cache-dependency-path: |
setup.py
requirements.txt
run: uv python install 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
uv tool install setuptools wheel twine
- name: Build and publish
run: |
python setup.py sdist bdist_wheel
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/update-lockfile-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Lockfile Bot

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
run: uv python install 3.12

- name: Install the package locally and update lockfile
run: |
# Install all default extras.
XDSL_VERSION_OVERRIDE="0+dynamic" make venv
- uses: EndBug/add-and-commit@v9
with:
add: uv.lock
Loading

0 comments on commit 3f94a4a

Please sign in to comment.