wl_cli(wl CLI)
wl_cli 是一个 Python + Rust 混合的命令行工具,命令入口为 wl。它以 Click 构建 CLI,
以 maturin + pyo3 编译 Rust 原生扩展,面向 Python 项目的初始化、构建、测试、格式化、lint、
清理与质量门等日常开发工作流。
功能概览
| 命令 | 用途 |
|---|---|
wl init |
初始化项目环境(Git、虚拟环境、i18n、Rust 子模块等) |
wl build |
执行构建任务,支持 Python 包构建与分发 |
wl test |
运行测试(支持缓存、覆盖率、逐步模式) |
wl format |
格式化 Python 与 Rust 代码 |
wl lint |
代码质量检查(ruff/mypy 等) |
wl clean |
清理构建产物与临时文件 |
wl debug |
质量门(测试 + 格式检查) |
wl self |
自管理命令 |
命令行别名:b→build、c→clean、f→format、i→init。
完整命令参考见 CLI_COMMANDS.md。
环境要求
- Python >= 3.11
- 从源码构建 Rust 扩展时需要 Rust 工具链(maturin/pyo3)
- 包管理器推荐 uv
安装
稳定版(PyPI)
pip install wl-cli
按需安装可选 extra:pip install "wl-cli[lfs]"(LFS watch)、
pip install "wl-cli[test]"(测试套件)、pip install "wl-cli[dev]"(开发工具)。
详见安装文档。
开发版(从源码)
# 以 GitLab 为主仓(origin),GitHub 为镜像
git clone https://gitlab.gewinnrobo.com/Humuyuan/py_wlcommands.git
cd wl_cli
uv pip install -e ".[dev,test]"
GitHub 镜像:https://github.com/CharlieZi/py_wlcommands.git
快速开始
wl --help # 查看帮助
wl init # 初始化项目
wl build # 构建
wl test # 运行测试
wl format # 格式化代码
wl lint # 代码质量检查
测试与质量门
wl test # 运行全部测试
wl test --cover # 覆盖率(阈值 70%)
wl test -s # 逐个测试文件运行,首个失败即停
pytest tests/ -v # 指定文件(pytest 直跑)
提交前请确保 pre-commit 通过(ruff、codespell、lockfile 一致性等)。 开发约束详见 CLAUDE.md, 贡献流程见 CONTRIBUTING.md。
文档
- CLI_COMMANDS.md — 命令参考
- CONTEXT.md — 架构术语(Click 迁移语境)
- docs/ — 设计、ADR、章节与 CICD/发布文档
- 安装文档 — 安装细节与 shell 补全
架构速览
Click CLI(src/py_wlcommands/cli_click.py
经 setup_commands() 直接注册)→ 各命令实现(commands/<group>/)→ 业务逻辑;
Rust 原生扩展(rust/、src/wl_cli/lib/)经 maturin 编译为 wl_cli_native;
依赖注入容器集中管理共享服务(infrastructure/dependency_injection.py)。
架构演进背景见 Click 迁移设计。
许可证
MIT,见 LICENSE。
Metadata
Release files for py-wlcli 0.6.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_wlcli-0.6.13.tar.gz | 272.8 kB | Without provenance | Details for py_wlcli-0.6.13.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| py_wlcli-0.6.13-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for py_wlcli-0.6.13-cp311-abi3-win_amd64.whl |
| py_wlcli-0.6.13-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for py_wlcli-0.6.13-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| py_wlcli-0.6.13-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for py_wlcli-0.6.13-cp311-abi3-macosx_11_0_arm64.whl |
| py_wlcli-0.6.13-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details for py_wlcli-0.6.13-cp311-abi3-macosx_10_12_x86_64.whl |
Total release size: 3.4 MB
Release files / py_wlcli-0.6.13.tar.gz
| Download URL | py_wlcli-0.6.13.tar.gz |
|---|---|
| Size | 272.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41164f30510214ad00f7eb910b6583feacdf27d3bcafc6a4b37bb7f072fc0639
|
|
BLAKE2b-256 checksum How to use checksums |
b005d3d732b1f40767e93596654a11c800f4167adb81016df677051e379f3f3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / py_wlcli-0.6.13-cp311-abi3-win_amd64.whl
| Download URL | py_wlcli-0.6.13-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 488.4 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ececa76d7a3bf6af9bbab559acca4174a95d4f4b19ac04e69540d21281b3bf75
|
|
BLAKE2b-256 checksum How to use checksums |
0b9760012076cdc597a5550d1f53ed5a59b74307519bb08d5828758b4b0c6d77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / py_wlcli-0.6.13-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | py_wlcli-0.6.13-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 603.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
19aebe7fb86261f8caf48afdbe7b9254944ed9230fcd72417dcc4bd0c5815b6a
|
|
BLAKE2b-256 checksum How to use checksums |
4efdbc0981c1077ef89b3d833031501922ce5149cc7e1719570f6f3f11a987e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / py_wlcli-0.6.13-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | py_wlcli-0.6.13-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
89fcf7655168116e864ec56f97f7594c3ed44e53ad445402b445f72bb2c9c9c0
|
|
BLAKE2b-256 checksum How to use checksums |
e9e6e3eb3e6877c5be503e48b5229d0b9104c95b0656662256502dbd2d74ca28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / py_wlcli-0.6.13-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | py_wlcli-0.6.13-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
56d58814bbba622c5e3f9259212b3854e0abb47f2ac86c19d7f13a4228ac806c
|
|
BLAKE2b-256 checksum How to use checksums |
97070a0682588fdaaf63273802df4ef108012717499c379ed0ed0cc48d732b1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for py-wlcli 0.6.13
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.