Skip to content
Merged
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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ jobs:
test_command: pytest --pyargs test_package
```

## Custom Python version

By default, the [`actions/setup-python`](https://github.com/actions/setup-python) action will install the latest Python 3 version for building and testing, however, the `OpenAstronomy/build-python-dist` action accepts a `python-version` string input to select a specific version,

```yaml
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: build
uses: OpenAstronomy/build-python-dist@v1
with:
test_extras: test
test_command: pytest --pyargs test_package
python-version: '3.9'
```

## Notes

If you want to use the latest available version of this action instead
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ inputs:
required: false
default: false
type: string
python-version:
description: The Python version to use for building and testing
required: false
default: '3.x'
type: string
runs:
using: "composite"
steps:
Expand All @@ -29,7 +34,7 @@ runs:

- uses: actions/setup-python@v2
with:
python-version: 3.x
python-version: ${{ inputs.python-version }}

- name: Install python-build and twine
shell: bash
Expand Down