Skip to content

Commit

Permalink
Use pipx for installing Poetry (#51)
Browse files Browse the repository at this point in the history
[pipx is a pre-installed package
manager](https://github.com/actions/runner-images/blob/266f9413d39fc77ade974757b633ef98873c9c21/images/ubuntu/Ubuntu2204-Readme.md#package-management)
in the latest Ubuntu GHA runner images.
Since it is a recommended way of installing Poetry, because it creates a
separate environment, I changed the workflows to install Poetry through
pipx.
In order to leverage `poetry.lock`-dependent [caching
feature](https://github.com/actions/setup-python/blob/e9d6f990972a57673cdb72ec29e19d42ba28880f/docs/advanced-usage.md#caching-packages)
offered by
[actions/setup-python](https://github.com/actions/setup-python), I moved
the Poetry setups before the `setup-python` step is performed.
Additionally, I bumped actions/setup-python to the latest v5 version
(see
[release](https://github.com/actions/setup-python/releases/tag/v5.0.0)
for details on what's changed).
  • Loading branch information
bswck authored Jan 3, 2024
1 parent 508fabf commit 0c82e7c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Poetry
run: |
pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"

- name: Set up Poetry
run: |
pip install poetry==${{ env.POETRY_VERSION }}
cache: poetry

- name: Install packages
run: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Poetry
run: |
pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
run: |
pip install poetry==${{ env.POETRY_VERSION }}
cache: poetry

- name: Install zsh
run: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Poetry
run: |
pipx install poetry==${{ env.POETRY_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Poetry
run: |
pip install poetry==${{ env.POETRY_VERSION }}
cache: poetry

- name: Install packages
run: |
Expand Down

0 comments on commit 0c82e7c

Please sign in to comment.