PyPI

kind: pypi

sourceconditiontarget

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

NameTypeDescriptionRequired
namestringName defines the PyPI package name.
tokenstringToken defines the Bearer token for private registries.
urlstringURL defines the PyPI-compatible registry URL (defaults to https://pypi.org/).
versionstringVersion defines a specific package version for condition checks.
versionfilterobjectVersionFilter provides parameters to specify version pattern and its type.
    kindstringspecifies the version kind such as semver, regex, or latest
    patternstringspecifies the version pattern according the version kind for semver, it is a semver constraint for regex, it is a regex pattern for time, it is a date format
    regexstringspecifies the regex pattern, used for regex/semver and regex/time. Output of the first capture group will be used.
    replaceallobjectreplaceAll applies a regex replacement to version strings before filtering. This is useful for transforming versions (e.g., curl-8_15_0 to curl-8.15.0) before regex extraction.
    strictbooleanstrict enforce strict versioning rule. Only used for semantic versioning at this time

Example

# updatecli.yaml
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
Top