An open API service indexing awesome lists of open source software.

https://github.com/lfreleng-actions/pypi-version-check-action

Checks the Python package index for the presence of a package
https://github.com/lfreleng-actions/pypi-version-check-action

pypi python release-automation release-engineering

Last synced: 8 months ago
JSON representation

Checks the Python package index for the presence of a package

Awesome Lists containing this project

README

          

# 📦 PyPI Package Check

Checks the Python package index for the presence of a package (and
optionally a specific release/version).

## pypi-version-check-action

## Usage Example

Pass the index query URL, along with Python package name and optionally the
package release/version to check.

```yaml
- name: "Checking package index for build/release"
id: check-package-index
uses: lfreleng-actions/pypi-version-check-action@main
with:
index_url: "https://pypi.org/simple"
package_name: "ITR"
package_version: "1.1.10"
```

Query URL examples:

- PyPI
- TestPyPI

## Inputs

| Variable Name | Required | Default | Description |
| --------------- | -------- | ------------------------- | -------------------------------------------- |
| PACKAGE_NAME | True | | Name of Python package to check |
| PACKAGE_VERSION | False | | Optional release/version to check |
| INDEX_URL | False | | The Python package index server URL to query |
| PRE_RELEASE | False | False | Also checks pre-release/development versions |
| EXIT_ON_FAIL | False | False | Set true to exit with error on failure |

Note: Leading "v" characters are automatically stripped, as the Python package
index uses purely numerical versioning.

## Outputs

| Variable Name | Mandatory | Description |
| ------------- | --------- | ---------------------------------------------- |
| PACKAGE_MATCH | True | Always reports the presence of the project |
| VERSION_MATCH | False | Reports a match when specific version provided |

## Implementation Details

This action uses the "pip index" command, which is an experimental command.
It may get removed/changed in a future release without prior warning.

To query development and pre-release packages, the action implementation uses
the "--pre" command-line flag to gather the required versioning information.