Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PyPI resource example
sources:
requests:
name: Get latest requests version from PyPI
kind: pypi
spec:
name: requests
flask:
name: Get latest flask version matching >=3.0
kind: pypi
spec:
name: flask
versionfilter:
kind: semver
pattern: ">=3.0.0"
conditions:
requests:
name: Test that requests version 2.31.0 exists on PyPI
kind: pypi
disablesourceinput: true
spec:
name: requests
version: 2.31.0
targets:
# Targets are not supported
78 changes: 78 additions & 0 deletions content/en/docs/plugins/autodiscovery/pyproject.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: "Pyproject"
description: "Discover Python dependency updates from pyproject.toml"
lead: "kind: pyproject"
draft: false
images: []
menu:
docs:
parent: "plugin-autodiscovery"
weight: 131
toc: true
plugins:
- autodiscovery
---

== Description

The pyproject crawler looks recursively for all Python dependencies from `pyproject.toml` files.
It detects the package manager in use via lock files (currently `uv.lock` is supported) and generates manifests to update dependencies using the appropriate tool.

Dependencies are discovered from both `[project.dependencies]` and `[project.optional-dependencies]` sections. PEP 508 dependency strings are parsed to extract package names and version constraints. Environment markers are stripped.

Generated manifests use the `pypi` resource as a source and `uv add` as a shell target, which atomically updates both `pyproject.toml` and `uv.lock`.

== Manifest
=== Parameters

{{< autodiscoveryparameters "pyproject" >}}

==== Example

===== Basic Example

[source,yaml]
----
# updatecli.d/pyproject.yaml
autodiscovery:
crawlers:
pyproject:
rootdir: "."
versionfilter:
kind: semver
pattern: minor
----

===== Filter to Specific Packages

[source,yaml]
----
# updatecli.d/pyproject-only.yaml
autodiscovery:
crawlers:
pyproject:
only:
- packages:
"requests": ""
"flask": ""
----

===== Private PyPI Registry

[source,yaml]
----
# updatecli.d/pyproject-private.yaml
autodiscovery:
crawlers:
pyproject:
rootdir: "."
# Custom PyPI index URL propagated to all generated pypi source specs
indexurl: "https://pypi.example.com/"
versionfilter:
kind: semver
pattern: ">=1.0.0"
----

NOTE: The `indexurl` parameter is propagated to all generated pypi resource specs, allowing consistent registry configuration across all discovered dependencies. For private registry authentication, the `pypi` resource supports a `token` field for Bearer token auth.

NOTE: The alias `python/uv` can also be used instead of `pyproject`.
49 changes: 49 additions & 0 deletions content/en/docs/plugins/resource/pypi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "PyPI"
description: "Interact with the PyPI registry"
lead: "kind: pypi"
date: 2026-03-25T00:00:00+00:00
draft: false
images: []
menu:
docs:
parent: "plugin-resource"
toc: true
plugins:
- source
- condition
---
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

[cols="1^,1^,1^",options=header]
|===
| source | condition | target
| &#10004; | &#10004; | &#10007;
|===

**source**

The PyPI "source" retrieves the latest version of a Python package from a PyPI-compatible registry matching a specific version filter. PEP 440 pre-release versions (alpha, beta, rc) are automatically normalized to semver for filtering.

**condition**

The PyPI "condition" tests that a specific version exists on a PyPI-compatible registry.

**target**

The PyPI "target" is not supported.

== Parameter

{{< resourceparameters "sources" "pypi" >}}

== Example

[source,yaml]
----
# updatecli.yaml
{{<include "assets/code_example/docs/plugins/resources/pypi/updatecli.d/default.yaml">}}
----
Loading