File tree 7 files changed +436
-342
lines changed
7 files changed +436
-342
lines changed Original file line number Diff line number Diff line change
1
+ name : " Python Poetry Action"
2
+ description : " An action to setup Poetry"
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ # A workaround for pipx isn't installed on M1 runner.
7
+ # We should remove it after this issue is resolved.
8
+ # https://github.com/actions/runner-images/issues/9256
9
+ - if : ${{ runner.os == 'macOS' && runner.arch == 'ARM64' }}
10
+ run : |
11
+ pip install poetry
12
+ shell : bash
13
+
14
+ # NOTE: Below commands currently causes a faulty behaviour in pipx where
15
+ # preinstalled pipx on github worker has shared venv instantiated via python 3.10
16
+ # however 2 of the above commands are supposed to reinstall pipx and use python version
17
+ # specified in setup-python, however shared venv still uses 3.10 hence algokit fails on
18
+ # pkgutil.ImpImporter module not found error.
19
+ # To be approached as given until further clarified on corresponding issues on pipx repo.
20
+ # ------
21
+ # pip install --user pipx
22
+ # pipx ensurepath
23
+ # ------
24
+ - if : ${{ runner.os != 'macOS' || runner.arch != 'ARM64' }}
25
+ run : |
26
+ pipx install poetry ${{ runner.os == 'macOS' && '--python "$Python_ROOT_DIR/bin/python"' || '' }}
27
+ shell : bash
28
+
29
+ - name : Get full Python version
30
+ id : full-python-version
31
+ shell : bash
32
+ run : echo "full_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')" >> $GITHUB_OUTPUT
33
+
34
+ - name : Setup poetry cache
35
+ uses : actions/cache@v4
36
+ with :
37
+ path : ./.venv
38
+ key : venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.full-python-version.outputs.full_version }}
Original file line number Diff line number Diff line change
1
+ version : 2
2
+ updates :
3
+ - package-ecosystem : " pip"
4
+ directory : " /"
5
+ schedule :
6
+ interval : " weekly"
7
+ commit-message :
8
+ prefix : " chore(deps)"
9
+ groups :
10
+ all :
11
+ patterns :
12
+ - " *"
13
+ update-types :
14
+ - " minor"
15
+ - " patch"
Original file line number Diff line number Diff line change @@ -11,29 +11,15 @@ jobs:
11
11
runs-on : ${{ matrix.os }}
12
12
steps :
13
13
- name : Checkout source code
14
- uses : actions/checkout@v3
14
+ uses : actions/checkout@v4
15
15
16
16
- name : Set up Python ${{ matrix.python }}
17
- uses : actions/setup-python@v4
17
+ uses : actions/setup-python@v5
18
18
with :
19
19
python-version : ${{ matrix.python }}
20
20
21
- - name : Install pipx
22
- run : |
23
- python -m pip install --upgrade pip
24
- python -m pip install pipx
25
- python -m pipx ensurepath
26
-
27
- - name : Cache Poetry
28
- uses : actions/cache@v2
29
- with :
30
- path : ~/.local/share/pipx/venvs/poetry
31
- key : ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
32
- restore-keys : |
33
- ${{ runner.os }}-poetry-
34
-
35
- - name : Install poetry
36
- run : pipx install poetry
21
+ - name : Set up Poetry
22
+ uses : ./.github/actions/setup-poetry
37
23
38
24
- name : Install dependencies
39
25
run : poetry install --no-interaction
Original file line number Diff line number Diff line change @@ -34,19 +34,18 @@ jobs:
34
34
runs-on : ubuntu-latest
35
35
36
36
steps :
37
- - uses : actions/checkout@v3
37
+ - uses : actions/checkout@v4
38
38
with :
39
39
# Fetch entire repository history so we can determine version number from it
40
40
fetch-depth : 0
41
41
42
- - name : Install poetry
43
- run : pipx install poetry
44
-
45
42
- name : Set up Python
46
- uses : actions/setup-python@v4
43
+ uses : actions/setup-python@v5
47
44
with :
48
45
python-version : " 3.10"
49
- cache : " poetry"
46
+
47
+ - name : Set up Poetry
48
+ uses : ./.github/actions/setup-poetry
50
49
51
50
- name : Install dependencies
52
51
run : poetry install --no-interaction --no-root
87
86
env :
88
87
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89
88
REPOSITORY_USERNAME : __token__
90
- REPOSITORY_PASSWORD : ${{ secrets.PYPI_API_KEY }}
89
+ REPOSITORY_PASSWORD : ${{ secrets.PYPI_API_KEY }}
Original file line number Diff line number Diff line change 8
8
runs-on : " ubuntu-latest"
9
9
steps :
10
10
- name : Checkout source code
11
- uses : actions/checkout@v3
12
-
13
- - name : Install poetry
14
- run : pipx install poetry
11
+ uses : actions/checkout@v4
15
12
16
13
- name : Set up Python 3.10
17
- uses : actions/setup-python@v4
14
+ uses : actions/setup-python@v5
18
15
with :
19
16
python-version : " 3.10"
20
- cache : " poetry"
17
+
18
+ - name : Set up Poetry
19
+ uses : ./.github/actions/setup-poetry
21
20
22
21
- name : Install dependencies
23
22
run : poetry install --no-interaction --no-root
You can’t perform that action at this time.
0 commit comments