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.1.0.tar.gz (16.5 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.1.0-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file uv_lens-0.1.0.tar.gz.

File metadata

  • Download URL: uv_lens-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 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.1.0.tar.gz
Algorithm Hash digest
SHA256 9191132044c0ea738cef942a8fbe8eebdeea56bc017dd95c2e301a8bef57d6ef
MD5 0241a34b99595f4dc8afdc3574f723b3
BLAKE2b-256 3eccf5ac75ca7c0a05fbd44fd560e1de8a611d98aae7b92bdd66aaf7bb6a557f

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_lens-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: uv_lens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c7a5fe785d8c30cf7ad607adfbac0257e7a5b64f04cfb6b0b7b52d8cb001b4c
MD5 d36c84b28ad6ff89db69b3b0a090b692
BLAKE2b-256 4d62bce86ca0e1907617d6edd5a8e533ea46e5b29a13c245ce7bdbf4027ab4de

See more details on using hashes here.

Provenance

The following attestation bundles were made for uv_lens-0.1.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