Skip to content

Commit

Permalink
Update dependencies and supported systems in CI (#122)
Browse files Browse the repository at this point in the history
Fix: Latest OS and Python were not tested

Add comment regarding eciespy
  • Loading branch information
hoh authored Jun 13, 2024
1 parent fd1b0e1 commit 1197d24
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-11, macos-12, ubuntu-20.04, ubuntu-22.04]
os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -52,17 +53,22 @@ jobs:
- name: Install Hatch
run: |
python3 -m pip install --upgrade hatch
python3 -m venv /tmp/venv
/tmp/venv/bin/python3 -m pip install --upgrade hatch
- name: Build source and wheel packages
run: |
python3 -m hatch build
/tmp/venv/bin/python3 -m hatch build
- name: Install the Python wheel
run: |
python3 -m pip install dist/aleph_sdk_python-*.whl
/tmp/venv/bin/python3 -m pip install dist/aleph_sdk_python-*.whl
- name: Install `setuptools` on systems where it is missing by default
run: /tmp/venv/bin/python3 -m pip install --upgrade setuptools
if: matrix.os == 'ubuntu-24.04'

- name: Import and use the package
run: |
python3 -c "import aleph.sdk"
python3 -c "from aleph.sdk.chains.ethereum import get_fallback_account; get_fallback_account()"
/tmp/venv/bin/python3 -c "import aleph.sdk"
/tmp/venv/bin/python3 -c "from aleph.sdk.chains.ethereum import get_fallback_account; get_fallback_account()"
15 changes: 8 additions & 7 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ on:

jobs:
code-quality:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Workaround github issue https://github.com/actions/runner-images/issues/7192
run: sudo echo RESET grub-efi/install_devices | sudo debconf-communicate grub-pc

- name: Install pip and hatch
- name: Install system dependencies
run: |
sudo apt-get install -y python3-pip
pip3 install hatch
sudo apt-get install -y python3-pip libsecp256k1-dev
- name: Cache dependencies
uses: actions/cache@v4
Expand All @@ -29,8 +28,10 @@ jobs:
restore-keys: |
${{ runner.os }}-code-quality-
- name: Install required system packages only for Ubuntu Linux
run: sudo apt-get install -y libsecp256k1-dev
- name: Install python dependencies
run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/pip install hatch
- name: Run Hatch lint
run: hatch run linting:all
run: /tmp/venv/bin/hatch run linting:all
22 changes: 15 additions & 7 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ name: Test/Coverage with Python

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Run every night at 04:00 (GitHub Actions timezone)
# Run every night at 04:00 (GitHub Actions timezone)
# in order to catch when unfrozen dependency updates
# break the use of the library.
- cron: '4 0 * * *'
Expand All @@ -17,20 +15,30 @@ jobs:
build:
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- run: sudo apt-get install -y python3-pip libsecp256k1-dev
- run: python -m pip install --upgrade pip hatch coverage
- run: hatch run testing:test

- run: |
python3 -m venv /tmp/venv
/tmp/venv/bin/python -m pip install --upgrade pip hatch coverage
- run: |
/tmp/venv/bin/pip freeze
/tmp/venv/bin/hatch run testing:pip freeze
/tmp/venv/bin/hatch run testing:test
if: matrix.python-version != '3.11'
- run: hatch run testing:cov
- run: /tmp/venv/bin/hatch run testing:cov
if: matrix.python-version == '3.11'

- uses: codecov/[email protected]
if: matrix.python-version == '3.11'
with:
Expand Down
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies = [
"aiohttp>=3.8.3",
"aleph-message~=0.4.4",
"coincurve; python_version<\"3.11\"",
"coincurve>=17.0.0; python_version>=\"3.11\"",
"coincurve>=19.0.0; python_version>=\"3.11\"",
"eth_abi>=4.0.0; python_version>=\"3.11\"",
"eth_account>=0.4.0,<0.11.0",
"python-magic",
Expand Down Expand Up @@ -67,13 +67,18 @@ tezos = [
"pynacl",
]
encryption = [
"eciespy; python_version<\"3.11\"",
"eciespy>=0.3.13; python_version>=\"3.11\"",
# Blocked by https://github.com/ecies/py/issues/356
# "eciespy; python_version<'3.11'",
# "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; python_version>='3.11'"
"eciespy@git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy"
]
all = [
"aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,polkadot,solana,tezos,encryption]",
]

[tool.hatch.metadata]
allow-direct-references = true

[project.urls]
Documentation = "https://aleph.im/"
Homepage = "https://github.com/aleph-im/aleph-sdk-python"
Expand Down

0 comments on commit 1197d24

Please sign in to comment.