Skip to content

Commit

Permalink
chore: hotfixing the pkgutil.ImpImporter error when using 3.12 based …
Browse files Browse the repository at this point in the history
…pipx; adding dependabot; patching snapshot tests (#73)

* fix: testing ci

* chore: testing ci

* chore: test

* chore: test

* chore: testing ci

* chore: testing ci

* chore: test

* chore: testing

* chore: test

* chore: test

* chore: removing tmp tweak

* chore: testing ci

* chore: lockfile maintenance (poetry update); reverting ci tweaks

* chore: testing ci

* chore: testing ci

* chore: testing ci
  • Loading branch information
aorumbayev authored Apr 17, 2024
1 parent 28308a0 commit 45a7721
Show file tree
Hide file tree
Showing 7 changed files with 436 additions and 342 deletions.
38 changes: 38 additions & 0 deletions .github/actions/setup-poetry/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Python Poetry Action"
description: "An action to setup Poetry"
runs:
using: "composite"
steps:
# A workaround for pipx isn't installed on M1 runner.
# We should remove it after this issue is resolved.
# https://github.com/actions/runner-images/issues/9256
- if: ${{ runner.os == 'macOS' && runner.arch == 'ARM64' }}
run: |
pip install poetry
shell: bash

# NOTE: Below commands currently causes a faulty behaviour in pipx where
# preinstalled pipx on github worker has shared venv instantiated via python 3.10
# however 2 of the above commands are supposed to reinstall pipx and use python version
# specified in setup-python, however shared venv still uses 3.10 hence algokit fails on
# pkgutil.ImpImporter module not found error.
# To be approached as given until further clarified on corresponding issues on pipx repo.
# ------
# pip install --user pipx
# pipx ensurepath
# ------
- if: ${{ runner.os != 'macOS' || runner.arch != 'ARM64' }}
run: |
pipx install poetry ${{ runner.os == 'macOS' && '--python "$Python_ROOT_DIR/bin/python"' || '' }}
shell: bash

- name: Get full Python version
id: full-python-version
shell: bash
run: echo "full_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')" >> $GITHUB_OUTPUT

- name: Setup poetry cache
uses: actions/cache@v4
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.full-python-version.outputs.full_version }}
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore(deps)"
groups:
all:
patterns:
- "*"
update-types:
- "minor"
- "patch"
22 changes: 4 additions & 18 deletions .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,15 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install pipx
run: |
python -m pip install --upgrade pip
python -m pip install pipx
python -m pipx ensurepath
- name: Cache Poetry
uses: actions/cache@v2
with:
path: ~/.local/share/pipx/venvs/poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry
run: pipx install poetry
- name: Set up Poetry
uses: ./.github/actions/setup-poetry

- name: Install dependencies
run: poetry install --no-interaction
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Fetch entire repository history so we can determine version number from it
fetch-depth: 0

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry

- name: Install dependencies
run: poetry install --no-interaction --no-root
Expand Down Expand Up @@ -87,4 +86,4 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_USERNAME: __token__
REPOSITORY_PASSWORD: ${{ secrets.PYPI_API_KEY }}
REPOSITORY_PASSWORD: ${{ secrets.PYPI_API_KEY }}
11 changes: 5 additions & 6 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry

- name: Install dependencies
run: poetry install --no-interaction --no-root
Expand Down
Loading

1 comment on commit 45a7721

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit_utils
   _debugging.py140795%20, 41, 76, 80, 89, 129, 157
   _ensure_funded.py69199%99
   _transfer.py62395%13, 76–77
   account.py851385%14–17, 61–65, 96, 109, 136, 139, 183
   application_client.py5489782%58–59, 100, 117, 168, 173, 202, 314, 319–320, 322, 324, 407, 416, 425, 475, 483, 492, 536, 544, 553, 597, 605, 614, 671, 679, 688, 730, 738, 747, 807, 822, 840–843, 933, 973, 985, 998, 1040, 1100–1106, 1110–1115, 1117, 1153, 1160, 1273, 1303, 1317, 1355–1357, 1359, 1369–1426, 1437–1442, 1462–1465
   application_specification.py971189%92, 94, 193–202, 206
   asset.py79594%9, 27–30
   common.py13192%13
   config.py511865%38–39, 50, 55, 60, 64–69, 100–109
   deploy.py4552495%30–33, 168, 172–173, 190, 205, 246, 402, 413–421, 438–441, 451, 459, 652–653, 677
   dispenser_api.py821285%112–113, 117–120, 155–157, 176–178
   logic_error.py38295%6, 29
   models.py126794%45, 50–52, 61–62, 125
   network_clients.py66395%89–90, 121
TOTAL192520489% 

Tests Skipped Failures Errors Time
195 0 💤 0 ❌ 0 🔥 2m 6s ⏱️

Please sign in to comment.