You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypedPython 1b: run the gate as a default Gradle build step #20
A Gradle task in python-multiplatform-gradle-plugin runs python -m typedpython check over the project's own Python sources on every build, with those sources as task inputs so incremental builds re-run it. The build fails on errors. Warnings are printed. Dependencies are not checked. The gate package ships inside the python-multiplatform-ksp artefact.
Why
INTENT §1.4: checking is PythonMultiplatform's default behaviour.
Coordination
This overlaps the PMM build supporter's area and is agreed with that session before work starts.
Done when
A fixture build fails on an injected Any leak and passes when it is removed.
Changing only a .py file re-runs the task.
The gate's error count on sample/ and pythonx-compose consumer code is recorded as a baseline.
Paired with #183 (import-time gate in development mode), decided 2026-10-04: the build gate (this issue) covers builds; #183 covers notebook cells, hot reload and debug runs.
Implemented in toolchain (toolchain #34, toolchain SPEC 1.18):
What is in place:
typedpythonCheck runs before every buildPython*.
.py/.pyi files are inputs, so changing only a .py re-runs the check, and other files leave it UP-TO-DATE; toolchain's own tests cover both.
A failed check fails the build.
Criterion 1 (a fixture build fails on an injected Any leak) is not covered by a toolchain test I could find.
Gap, the reason this issue stays open: the check is skipped with a warning unless -Ptypedpython.wheelDir=<dir> is passed. The typedpython wheel is not on PyPI, and toolchain refuses index installs on purpose (the name is unclaimed). So checking is not yet on by default for a consumer.
Baseline (criterion 3), gate from develop de8f94f, --mode checked, CPython 3.15.0rc1t, no Kotlin stubs on the search path, so androidx imports are untyped and inflate any-flow:
source
result
sample/src/commonMain/python/example_py (1 file)
clean (exit 0)
pythonx-compose/pythonx (pythonx-compose 7490751)
253 errors, 7 warnings
pythonx-compose by rule:
rule
count
any-flow
178
pyrefly/unannotated-return
36
pyrefly/implicit-any-parameter
32
forbidden/dynamic-attr
6
pyrefly/unknown-variable-type
3
pyrefly/unknown-name
1
pyrefly/no-any-return-implicit
1
pyrefly/missing-import
1
pyrefly/bad-return
1
forbidden/rebinding
1
The gap needs a decision; options are in the next comment from the coordinating session.
typedpython is a direct file reference, so its name is never looked up on an index.
pyrefly is pinned by version plus 11 hashes.
Criteria:
an Any leak fails buildPython with the gate's diagnostic, and fixing it passes (toolchain TypedpythonCheckTaskTest).
A changed .py re-runs the check, and other files leave it UP-TO-DATE (same test class).
The baseline is recorded above: sample is clean; pythonx-compose has 253 errors and 7 warnings without Kotlin stubs, handed to the pythonx-compose designer for a re-run with stubs.
A gate artifact missing from the repositories is a skip with a warning (TypedpythonGateArtifactTest), and a pyrefly matching none of the hashes fails the task.
Activity
Build: Package the TypedPython gate as a typedpython wheel
b-re-w commentedon Oct 3, 2026
Paired with #183 (import-time gate in development mode), decided 2026-10-04: the build gate (this issue) covers builds; #183 covers notebook cells, hot reload and debug runs.
b-re-w commentedon Oct 17, 2026
Status (2026-10-17).
Implemented in toolchain (toolchain #34, toolchain SPEC 1.18):
typedpythonCheckruns before everybuildPython*..py/.pyifiles are inputs, so changing only a.pyre-runs the check, and other files leave it UP-TO-DATE; toolchain's own tests cover both.Gap, the reason this issue stays open: the check is skipped with a warning unless
-Ptypedpython.wheelDir=<dir>is passed. Thetypedpythonwheel is not on PyPI, and toolchain refuses index installs on purpose (the name is unclaimed). So checking is not yet on by default for a consumer.Baseline (criterion 3), gate from develop de8f94f,
--mode checked, CPython 3.15.0rc1t, no Kotlin stubs on the search path, soandroidximports are untyped and inflate any-flow:sample/src/commonMain/python/example_py(1 file)pythonx-compose/pythonx(pythonx-compose 7490751)pythonx-compose by rule:
The gap needs a decision; options are in the next comment from the coordinating session.
Merge pull request #212 from thisisthepy/feat/tp-gate-artifact
b-re-w commentedon Oct 17, 2026
Done. The gate runs by default for consumers:
python-multiplatform-ksp:<version>:typedpython-gate@zip.-Ptypedpython.wheelDirand installs with--require-hashes.Criteria:
an Any leak fails buildPython with the gate's diagnostic, and fixing it passes(toolchain TypedpythonCheckTaskTest)..pyre-runs the check, and other files leave it UP-TO-DATE (same test class).A gate artifact missing from the repositories is a skip with a warning (TypedpythonGateArtifactTest), and a pyrefly matching none of the hashes fails the task.