解析 pyproject.toml 依赖并查询最新稳定版本,输出升级建议与 uv add 命令
Project description
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/并发布
- 更新版本号:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uv_lens-0.2.0.tar.gz.
File metadata
- Download URL: uv_lens-0.2.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eebd977bda33ec313656157affddf3cbd849b756a8ba8be6ff9a735d3cb7eb62
|
|
| MD5 |
1afde9284d04a6422a7b4fb9d4bc28e6
|
|
| BLAKE2b-256 |
53207a48e0aee58e17778b82e46b52f7942ce815e36ed0629239c5787f9c3054
|
Provenance
The following attestation bundles were made for uv_lens-0.2.0.tar.gz:
Publisher:
publish.yaml on star-plan/uv-lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uv_lens-0.2.0.tar.gz -
Subject digest:
eebd977bda33ec313656157affddf3cbd849b756a8ba8be6ff9a735d3cb7eb62 - Sigstore transparency entry: 844877915
- Sigstore integration time:
-
Permalink:
star-plan/uv-lens@2a536f484881e9deb3b36cd66f3be35b1f4147dd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/star-plan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2a536f484881e9deb3b36cd66f3be35b1f4147dd -
Trigger Event:
push
-
Statement type:
File details
Details for the file uv_lens-0.2.0-py3-none-any.whl.
File metadata
- Download URL: uv_lens-0.2.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31d4045ad072681b798c7b7f53c5496768da7beaced2f7424e3330ca00bf051b
|
|
| MD5 |
d9af5be6353073b0f31cfd64b165b406
|
|
| BLAKE2b-256 |
47f8787193c085f4a2b727dd611b0ca5297afa587580fc1281d21244ca85334c
|
Provenance
The following attestation bundles were made for uv_lens-0.2.0-py3-none-any.whl:
Publisher:
publish.yaml on star-plan/uv-lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uv_lens-0.2.0-py3-none-any.whl -
Subject digest:
31d4045ad072681b798c7b7f53c5496768da7beaced2f7424e3330ca00bf051b - Sigstore transparency entry: 844877928
- Sigstore integration time:
-
Permalink:
star-plan/uv-lens@2a536f484881e9deb3b36cd66f3be35b1f4147dd -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/star-plan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@2a536f484881e9deb3b36cd66f3be35b1f4147dd -
Trigger Event:
push
-
Statement type: