Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ jobs:
fi
done

- name: Run pyrefly
run: |
poetry run pyrefly check --output-format min-text

Comment thread
tkislan marked this conversation as resolved.
gitleaks:
name: Gitleaks check
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions deepnote_toolkit/sql/sql_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@

if TYPE_CHECKING:
try:
# pyrefly (unlike mypy) ignores the except-ImportError fallback;
# these are missing on SQLAlchemy 1.x (3.10/3.11)
# pyrefly: ignore[missing-module-attribute]
from sqlalchemy.engine.interfaces import DBAPIConnection, DBAPICursor
except ImportError:
# Not available in SQLAlchemy < 2.0. We use them only for typing, so replace with Any
Expand Down
20 changes: 20 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ dev = [
"pytest-cov>=6.0.0,<7.0.0",
"coverage[toml]>=7.10.0,<8.0.0",
"mypy>=1.13.0,<2.0.0",
"pyrefly>=1.0.0,<2.0.0",
"pre-commit>=3.6.0,<4.0.0",
"responses>=0.25.7,<0.26.0",
"parameterized>=0.9.0,<0.10.0",
Expand Down Expand Up @@ -312,6 +313,46 @@ exclude = [
"(^|[\\/])deepnote_core[\\/]resources[\\/]"
]

[tool.pyrefly]
# Match the CI mypy scope, which only checks `deepnote_toolkit/`.
project-includes = ["deepnote_toolkit"]
# Equivalent of mypy's `exclude` above (pyrefly uses path globs, not regexes).
project-excludes = [
"**/tests/",
"**/.nox/",
"**/.pytest_cache/",
"**/__pycache__/",
"**/deepnote_core/resources/",
]
# The "legacy" preset emulates mypy-style gradual typing (only high-confidence
# errors, untyped code is checked leniently). Chosen automatically by
# `pyrefly init` for mypy migrations. Tighten to "default"/"strict" over time.
preset = "legacy"
# Untyped third-party libs (no py.typed). mypy treats these as `Any`; this makes
# pyrefly do the same instead of resolving them to `Unknown` and cascading
# errors (e.g. subclassing `wrapt.ObjectProxy`). Matches mypy's effective scope.
replace-imports-with-any = ["wrapt", "wrapt.*"]
# Pyrefly is stricter than this (heavily suppressed) mypy config and surfaces
# ~25 pre-existing latent issues mypy hides. They are recorded in a baseline so
# CI only fails on NEW regressions, not the existing backlog. Regenerate after
# fixing issues: `pyrefly check --update-baseline`.
baseline = "pyrefly-baseline.json"

# Pyrefly equivalents of mypy's `disable_error_code` (above). Mapping produced
# by `pyrefly init`; mypy codes with no pyrefly equivalent (var-annotated,
# misc, no-any-return, unreachable) simply have no entry here.
[tool.pyrefly.errors]
untyped-import = "ignore" # mypy: import-untyped
invalid-annotation = "ignore" # mypy: valid-type
missing-attribute = "ignore" # mypy: union-attr, attr-defined
bad-argument-count = "ignore" # mypy: call-arg
no-matching-overload = "ignore" # mypy: call-overload
bad-assignment = "ignore" # mypy: assignment
bad-argument-type = "ignore" # mypy: arg-type
bad-return = "ignore" # mypy: return-value
unsupported-operation = "ignore" # mypy: operator, index
bad-index = "ignore" # mypy: index

[tool.coverage.run]
branch = true
source = ["deepnote_toolkit", "installer", "deepnote_core"]
Expand Down
Loading
Loading