@@ -5,6 +5,7 @@ PYTEST_OPTS=
55RUN_DOCTEST=false
66RUN_MYPY=false
77RUN_PYTEST=false
8+ RUN_PYREFLY=false
89RUN_PYTYPE=false
910GH_VENV=false
1011
@@ -30,6 +31,9 @@ case $flag in
3031 --only-mypy)
3132 RUN_MYPY=true
3233 ;;
34+ --only-pyrefly)
35+ RUN_PYREFLY=true
36+ ;;
3337 --use-venv)
3438 GH_VENV=true
3539 ;;
@@ -40,12 +44,13 @@ case $flag in
4044esac
4145done
4246
43- # if neither --only-doctest, --only-pytest, --only-pytype, --only-mypy is set, run all tests
44- if ! $RUN_DOCTEST && ! $RUN_PYTEST && ! $RUN_PYTYPE && ! $RUN_MYPY ; then
47+ # if neither --only-doctest, --only-pytest, --only-pytype, --only-mypy, --only-pyrefly is set, run all tests
48+ if ! $RUN_DOCTEST && ! $RUN_PYTEST && ! $RUN_PYTYPE && ! $RUN_MYPY && ! $RUN_PYREFLY ; then
4549 RUN_DOCTEST=true
4650 RUN_PYTEST=true
4751 RUN_PYTYPE=true
4852 RUN_MYPY=true
53+ RUN_PYREFLY=true
4954fi
5055
5156# Activate cached virtual env for github CI
@@ -58,6 +63,7 @@ echo "PYTEST_OPTS: $PYTEST_OPTS"
5863echo " RUN_DOCTEST: $RUN_DOCTEST "
5964echo " RUN_PYTEST: $RUN_PYTEST "
6065echo " RUN_MYPY: $RUN_MYPY "
66+ echo " RUN_PYREFLY: $RUN_PYREFLY "
6167echo " RUN_PYTYPE: $RUN_PYTYPE "
6268echo " GH_VENV: $GH_VENV "
6369echo " WHICH PYTHON: $( which python) "
@@ -155,5 +161,11 @@ if $RUN_MYPY; then
155161 mypy --config pyproject.toml flax/ --show-error-codes
156162fi
157163
164+ if $RUN_PYREFLY ; then
165+ echo " === RUNNING PYREFLY ==="
166+ # Type-check using pyrefly.toml (currently scoped to flax/linen/linear.py).
167+ pyrefly check
168+ fi
169+
158170# Return error code 0 if no real failures happened.
159171echo " finished all tests."
0 commit comments