diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7c0ecfc..1524218b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,13 @@ jobs: run: | python -m pip install --upgrade pip pip install -e ".[dev,visualize]" + - name: Run lint + run: ruff check . + - name: Run type check (non-blocking) + continue-on-error: true + run: pyright + - name: Smoke check + run: python -c "import delphi; print(delphi.__version__)" - name: Run tests run: pytest - name: build diff --git a/pyproject.toml b/pyproject.toml index 554e8036..f3103854 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ dev = [ "pytest", "pyright==1.1.378", - "pytest-beartype", "pytest-asyncio", "setuptools", "pre-commit" + "pytest-beartype", "pytest-asyncio", "setuptools", "pre-commit", "ruff" ] visualize = [ "kaleido==0.2.1", @@ -54,14 +54,16 @@ include = ["delphi*"] [tool.ruff] # TODO: Clean up or remove experiments folder. exclude = ["experiments", "**/prompts/*", "**/prompts.py","**/simulator.py"] +# Same as Black. +line-length = 88 + +[tool.ruff.lint] # Avoid automatically removing unused imports in __init__.py files. # Such imports will be flagged with a dedicated message suggesting # that the import is either added to the module's __all__ symbol ignore-init-module-imports = true # Ignore F821 (undefined name) errors, as they are common in type annotations. ignore = ["F722", "F821"] -# Same as Black. -line-length = 88 # Enable pycodestyle (`E`), Pyflakes (`F`), and isort (`I`) codes # See https://beta.ruff.rs/docs/rules/ for more possible rules select = ["E", "F", "I"] @@ -135,3 +137,4 @@ upload_to_vcs_release = true [tool.pytest.ini_options] beartype_packages = "delphi" +testpaths = ["tests"]