Skip to main content

lazy-fix

Check and fix Python imports into PEP 810 lazy imports.

PEP 810 adds a lazy soft keyword to Python 3.15: lazy import json and lazy from pathlib import Path defer the import until the name is first used. lazy-fix is a LibCST-based check/fix CLI that finds eligible module-level imports and rewrites them to that syntax.

Install

uv add --dev lazy-fix

Usage

lazy-fix check .   # report non-lazy imports, exit 1 if any are found
lazy-fix fix .      # rewrite them in place
lazy-fix fix . --diff   # preview the changes without writing

Recurses by default, considers .py files only, and skips dot-prefixed paths and anything .gitignore excludes. Which modules are eligible is configured via [tool.lazy-fix] in pyproject.toml or a standalone lazy-fix.toml — see the docs.

On projects whose requires-python doesn't allow 3.15 yet, fix inserts a __lazy_modules__ marker list instead of the lazy import syntax itself — PEP 810's own documented forward-compatibility mechanism.

Documentation

https://herogold.github.io/lazy-fix/

License

MIT

Metadata

Release files for lazy-fix 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lazy-fix 0.1.0
File Size Uploaded Provenance Actions
lazy_fix-0.1.0.tar.gz 51.9 kB Without provenance Details for lazy_fix-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lazy-fix 0.1.0
File Interpreter ABI Platform Actions
lazy_fix-0.1.0-py3-none-any.whl Python 3 none any Details for lazy_fix-0.1.0-py3-none-any.whl

Total release size: 64.7 kB

Release files / lazy_fix-0.1.0.tar.gz

Download URL lazy_fix-0.1.0.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bda6632f3247f7256da2b1a2e5e7d78f6e07fcf55886dee6983e764d2c3095d1
BLAKE2b-256 checksum
How to use checksums
f3df1376d440fdbf6ee90e21774ed96122b280f9cd9c6bd29954b8917c1e22c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lazy_fix-0.1.0-py3-none-any.whl

Download URL lazy_fix-0.1.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7401d8b3bdb2e9651e57c6e4f6a073812bcc7fe239e8f4340f98e47ccf0f2621
BLAKE2b-256 checksum
How to use checksums
4bbcf0d9ad9c721a019f1717bdb6ea4af5ee0fa05736b7e5579b7f691d8aa823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lazy-fix 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page