Skip to content

Dependency bots依存関係ボット

It is considered best practice to regularly update dependencies, to avoid being exposed to vulnerabilities, limit incompatibilities between dependencies, and avoid complex upgrades when upgrading from a too old version. A variety of tools can help staying up-to-date by creating automated pull requests. Several of them support uv, or have work underway to support it.依存関係を定期的に更新することは、脆弱性にさらされるのを避け、依存関係間の非互換性を制限し、古すぎるバージョンからのアップグレード時に複雑なアップグレードを避けるためのベストプラクティスと考えられています。さまざまなツールが、自動化されたプルリクエストを作成することで最新の状態を維持するのに役立ちます。その中のいくつかはuvをサポートしているか、サポートするための作業が進行中です。

RenovateRenovate

uv is supported by Renovate.uvはRenovateによってサポートされています。

uv.lock outputuv.lock の出力

Renovate uses the presence of a uv.lock file to determine that uv is used for managing dependencies, and will suggest upgrades to project dependencies, optional dependencies and development dependencies. Renovate will update both the pyproject.toml and uv.lock files.Renovateは、uv.lockファイルの存在を利用して、uvが依存関係の管理に使用されていることを判断し、プロジェクト依存関係オプション依存関係、および開発依存関係のアップグレードを提案します。Renovateは、pyproject.tomluv.lockファイルの両方を更新します。

The lockfile can also be refreshed on a regular basis (for instance to update transitive dependencies) by enabling the lockFileMaintenance option:ロックファイルは、定期的に更新することも可能です(例えば、推移的依存関係を更新するために)lockFileMaintenanceオプションを有効にすることで:

renovate.json5
{
  $schema: "https://docs.renovatebot.com/renovate-schema.json",
  lockFileMaintenance: {
    enabled: true,
  },
}

Inline script metadataインラインスクリプトメタデータ

Renovate supports updating dependencies defined using script inline metadata.Renovateは、スクリプトインラインメタデータを使用して定義された依存関係の更新をサポートしています。

Since it cannot automatically detect which Python files use script inline metadata, their locations need to be explicitly defined using fileMatch, like so:スクリプトインラインメタデータを使用しているPythonファイルを自動的に検出できないため、その場所はfileMatchを使用して明示的に定義する必要があります。次のように:

renovate.json5
{
  $schema: "https://docs.renovatebot.com/renovate-schema.json",
  pep723: {
    fileMatch: [
      "scripts/generate_docs\\.py",
      "scripts/run_server\\.py",
    ],
  },
}

DependabotDependabot

Dependabot has announced support for uv, but there are some use cases that are not yet working. See astral-sh/uv#2512 for updates.Dependabotはuvのサポートを発表しましたが、まだ動作していないユースケースもあります。最新情報についてはastral-sh/uv#2512を参照してください。

Dependabot supports updating uv.lock files. To enable it, add the uv package-ecosystem to your updates list in the dependabot.yml:Dependabotはuv.lockファイルの更新をサポートしています。これを有効にするには、uvのpackage-ecosystemdependabot.ymlupdatesリストに追加してください:

dependabot.yml
version: 2

updates:
  - package-ecosystem: "uv"
    directory: "/"
    schedule:
      interval: "weekly"