PrefectHQ
prefect
BlogDocsChangelog

chore: enforce top-level imports with ruff PLC0415

#20141
Comparing
chore/enforce-top-level-imports
(
14abbad
) with
main
(
956ecab
)
CodSpeed Performance Gauge
0%
Untouched
2
Ignored
6

Benchmarks

Passed

bench_import_prefect_flow
benches/bench_import.py
CodSpeed Performance Gauge
0%
1.4 s1.4 s
bench_task_decorator
benches/bench_tasks.py
CodSpeed Performance Gauge
0%
599.7 µs602.1 µs

Ignored

bench_flow_call[options1]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
107.7 ms107.7 ms
bench_task_call
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
+2%
33.8 ms33 ms
bench_flow_call[options0]
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
0%
164 ms164.3 ms
bench_import_prefect
benches/bench_import.py
Ignored
CodSpeed Performance Gauge
0%
1.1 s1.1 s
bench_flow_decorator
benches/bench_flows.py
Ignored
CodSpeed Performance Gauge
-2%
5.5 ms5.6 ms
bench_task_submit
benches/bench_tasks.py
Ignored
CodSpeed Performance Gauge
-7%
9.6 ms10.3 ms

Commits

Click on a commit to change the comparison range
Base
main
956ecab
-0.17%
chore: enforce top-level imports with ruff PLC0415 enable the import-outside-top-level lint rule to catch deferred imports. existing legitimate uses (circular imports, optional deps) are marked with # noqa: PLC0415. this creates an "electric fence" - new deferred imports will fail the lint unless explicitly marked, while documenting all existing exceptions.
14abbad
2 days ago
by zzstoatzz
© 2026 CodSpeed Technology
Home Terms Privacy Docs