8000 Fix CI issue with python version used by pipx to install poetry (#831) · python-kasa/python-kasa@5d08a4c · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 5d08a4c

Browse files
authored
Fix CI issue with python version used by pipx to install poetry (#831)
1 parent 0f3b291 commit 5d08a4c

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,23 @@ jobs:
1919

2020
steps:
2121
- uses: "actions/checkout@v4"
22-
- name: Install poetry
23-
run: pipx install poetry
2422
- uses: "actions/setup-python@v5"
2523
id: setup-python
2624
with:
2725
python-version: "${{ matrix.python-version }}"
28-
cache: 'poetry'
26+
- name: Install poetry
27+
run: pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
28+
- name: Read poetry cache location
29+
id: poetry-cache-location
30+
shell: bash
31+
run: |
32+
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
33+
- uses: actions/cache@v3
34+
name: Poetry cache
35+
with:
36+
path: |
37+
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}
38+
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}-extras-false
2939
- name: "Install dependencies"
3040
run: |
3141
poetry install
@@ -34,6 +44,7 @@ jobs:
3444
run: >-
3545
echo "PRE_COMMIT_VERSION=$(poetry run pre-commit -V | awk '{print $2}')" >> $GITHUB_OUTPUT
3646
- uses: actions/cache@v3
47+
name: Pre-commit cache
3748
with:
3849
path: ~/.cache/pre-commit/
3950
key: ${{ runner.os }}-pre-commit-${{ steps.pre-commit-version.outputs.PRE_COMMIT_VERSION }}-python-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -97,18 +108,19 @@ jobs:
97108

98109
steps:
99110
- uses: "actions/checkout@v4"
100-
- name: Install poetry
101-
run: pipx install poetry
102111
- uses: "actions/setup-python@v5"
103112
id: setup-python
104113
with:
105114
python-version: "${{ matrix.python-version }}"
115+
- name: Install poetry
116+
run: pipx install poetry --python "${{ steps.setup-python.outputs.python-path }}"
106117
- name: Read poetry cache location
107118
id: poetry-cache-location
108119
shell: bash
109120
run: |
110121
echo "POETRY_VENV_LOCATION=$(poetry config virtualenvs.path)" >> $GITHUB_OUTPUT
111122
- uses: actions/cache@v3
123+
name: Poetry cache
112124
with:
113125
path: |
114126
${{ steps.poetry-cache-location.outputs.POETRY_VENV_LOCATION }}

0 commit comments

Comments
 (0)
0