uv-lens
解析 pyproject.toml 里的依赖项,并从(私有)PyPI JSON API 查询最新稳定版本,生成升级建议与 uv add 命令。
运行方式
- 发布后(推荐,无需 clone):
uvx uv-lens
uvx uv-lens check
uvx uv-lens check --format json
uvx uv-lens check --format md --output report.md
uvx uv-lens export-uv
uvx uv-lens update
uvx uv-lens update --write
-
从源码运行(开发/本地测试):
-
直接进入 TUI(无参数):
uvx --from . uv-lens
- CLI 检查(表格/JSON/Markdown):
uvx --from . uv-lens check
uvx --from . uv-lens check --format json
uvx --from . uv-lens check --format md --output report.md
- 生成可执行的
uv add命令列表:
uvx --from . uv-lens export-uv
- 更新
pyproject.toml(默认只预览;加--write才写回):
uvx --from . uv-lens update
uvx --from . uv-lens update --write
解析范围
- 项目依赖:
[project].dependencies - 开发依赖:
[dependency-groups](PEP 735,含dev) - 可选依赖:
[project.optional-dependencies] - 构建依赖:
[build-system].requires
私有索引与认证
- 主索引与回退索引:
--index-url https://pypi.org/pypi--extra-index-url https://your.index/pypi(可重复)
- 环境变量:
UV_LENS_INDEX_URLUV_LENS_EXTRA_INDEX_URLS(逗号分隔)UV_LENS_BEARER_TOKEN或UV_LENS_BASIC_USERNAME/UV_LENS_BASIC_PASSWORD
缓存
- 默认使用“用户目录全局 SQLite 缓存”,避免每个项目创建数据库文件。
- 可通过
--no-cache禁用,或用--cache-ttl调整 TTL,--refresh强制重新查询。
配置文件
在项目根目录放置 .uv-lens.toml:
[uv_lens]
index_url = "https://pypi.org/pypi"
extra_index_urls = []
max_concurrency = 20
cache_ttl_s = 86400
pin = "compatible"
exclude = ["setuptools"]
发布到 PyPI
本仓库包含 GitHub Actions 工作流,会在打 tag(v*)时自动构建并发布到 PyPI。
-
PyPI Trusted Publishing(推荐):
- 在 PyPI 项目设置里添加 Trusted Publisher,指向本仓库与工作流文件:
.github/workflows/publish.yml - 无需在 GitHub Secrets 里保存 PyPI Token
- 在 PyPI 项目设置里添加 Trusted Publisher,指向本仓库与工作流文件:
-
发版步骤:
- 更新版本号:
pyproject.toml的version与src/uv_lens/__init__.py的__version__ - 创建并推送 tag:
vX.Y.Z(例如v0.1.0) - Actions 自动跑测试、构建
dist/并发布
- 更新版本号:
Metadata
Release files for uv-lens 0.2.0
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 |
|---|---|---|---|---|
| uv_lens-0.2.0.tar.gz | 17.0 kB | With provenance | Details for uv_lens-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uv_lens-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for uv_lens-0.2.0-py3-none-any.whl |
Total release size: 42.3 kB
Release files / uv_lens-0.2.0.tar.gz
| Download URL | uv_lens-0.2.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eebd977bda33ec313656157affddf3cbd849b756a8ba8be6ff9a735d3cb7eb62
|
|
BLAKE2b-256 checksum How to use checksums |
53207a48e0aee58e17778b82e46b52f7942ce815e36ed0629239c5787f9c3054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.
Transparency logRelease files / uv_lens-0.2.0-py3-none-any.whl
| Download URL | uv_lens-0.2.0-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31d4045ad072681b798c7b7f53c5496768da7beaced2f7424e3330ca00bf051b
|
|
BLAKE2b-256 checksum How to use checksums |
47f8787193c085f4a2b727dd611b0ca5297afa587580fc1281d21244ca85334c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.
Transparency logSecurity for uv-lens 0.2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for uv_lens-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 22, 2026.
Transparency logA 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.