Skip to content

Commit

Permalink
doc: move the configuration to its own section
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Sep 6, 2023
1 parent ddc33ca commit 0b61a6c
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,47 @@ But it is still not obvious and it is a pain for developers to properly build th

## Usage

Include the action in your workflow yaml file with the following arguments:
Include the action in your workflow yaml:

```yaml
steps:
...
- uses: pdm-project/setup-pdm@v3
name: Setup PDM
with:
python-version: 3.9 # Version range or exact version of a Python version to use, the same as actions/setup-python
architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python
version: 2.7.4 # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub
prerelease: false # Allow prerelease versions of PDM to be installed
enable-pep582: false # Enable PEP 582 package loading globally
allow-python-prereleases: false # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fallback to 3.12-dev
update-python: true # Update the environment with the requested python version
- uses: actions/checkout@v3
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
# You are now able to use PDM in your workflow
- name: Install dependencies
run: pdm install # Then you can use pdm in the following steps.
...
run: pdm install
```
You don't need `actions/setup-python` actually.

## Action Inputs

This action supports the following inputs:

| Input | Default | Description |
| -------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `python-version` | `3.x` | Version range or exact version of a Python version to use, using SemVer's version range syntax. |
| `architecture` | `x64` | The target architecture (x86, x64) of the Python interpreter. |
| `allow-python-prereleases` | `false` | Allow prerelease versions of Python to be installed. |
| `token` | `${{ github.token }}` | Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. |
| `version` | Not specified | The version of PDM to install, or 'head' to install from the main branch. |
| `prerelease` | `false` | Allow prerelease versions of PDM to be installed |
| `enable-pep582` | `false` | Enable PEP 582 package loading globally. |
| `cache` | `false` | Cache PDM installation. |
| `cache-dependency-path` | `pdm.lock` | The dependency file(s) to cache. |
| `update-python` | `true` | Whether to update the environment with the requested Python |

## Action Outputs

This action also exposes the following outputs:

```yaml
outputs:
python-version:
description: "The installed Python or PyPy version. Useful when given a version range as input."
python-path:
description: "The absolute path to the Python or PyPy executable."
pdm-version:
description: "The installed PDM version."
pdm-bin:
description: "The absolute path to the PDM executable."
```
| Output | Description |
| ---------------- | --------------------------------------------------------------------------------- |
| `python-version` | The installed Python or PyPy version. Useful when given a version range as input. |
| `python-path` | The absolute path to the Python or PyPy executable. |
| `pdm-version` | The installed PDM version. |
| `pdm-bin` | The absolute path to the PDM executable. |

## Caches

Expand Down

0 comments on commit 0b61a6c

Please sign in to comment.