Skip to main content

解析 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_URL
    • UV_LENS_EXTRA_INDEX_URLS(逗号分隔)
    • UV_LENS_BEARER_TOKENUV_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
  • 发版步骤:

    • 更新版本号:pyproject.tomlversionsrc/uv_lens/__init__.py__version__
    • 创建并推送 tag:vX.Y.Z(例如 v0.1.0
    • Actions 自动跑测试、构建 dist/ 并发布

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uv_lens-0.2.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uv_lens-0.2.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

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

Hashes for uv_lens-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eebd977bda33ec313656157affddf3cbd849b756a8ba8be6ff9a735d3cb7eb62
MD5 1afde9284d04a6422a7b4fb9d4bc28e6
BLAKE2b-256 53207a48e0aee58e17778b82e46b52f7942ce815e36ed0629239c5787f9c3054

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_lens-0.2.0.tar.gz:

Publisher: publish.yaml on star-plan/uv-lens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for uv_lens-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31d4045ad072681b798c7b7f53c5496768da7beaced2f7424e3330ca00bf051b
MD5 d9af5be6353073b0f31cfd64b165b406
BLAKE2b-256 47f8787193c085f4a2b727dd611b0ca5297afa587580fc1281d21244ca85334c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page