From 62e482fc7c3d66785f5180231242f3fef30995a0 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 15:58:18 +0200 Subject: [PATCH 01/25] Fix: Latest OS and Python were not tested --- .github/workflows/build-wheels.yml | 2 +- .github/workflows/code-quality.yml | 2 +- .github/workflows/pytest.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5155bc7e..5976537a 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -12,7 +12,7 @@ jobs: build: strategy: 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: diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 79a3ac5b..ee5a2376 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -8,7 +8,7 @@ on: jobs: code-quality: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 89c3dabd..d3f3ed61 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -8,7 +8,7 @@ on: 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 * * *' @@ -17,7 +17,7 @@ jobs: build: strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] runs-on: ubuntu-latest steps: From 3d2b2e5ece6685bce19b0f95d53e2fc598f01021 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:02:04 +0200 Subject: [PATCH 02/25] Fix: Latest OS and Python were not tested --- .github/workflows/build-wheels.yml | 11 ++++++----- .github/workflows/code-quality.yml | 5 +++-- .github/workflows/pytest.yml | 13 ++++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5976537a..8bcc6856 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -52,17 +52,18 @@ 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: 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()" diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ee5a2376..019fc935 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -19,7 +19,8 @@ jobs: - name: Install pip and hatch run: | sudo apt-get install -y python3-pip - pip3 install hatch + python3 -m venv /tmp/venv + /tmp/venv/pip3 install hatch - name: Cache dependencies uses: actions/cache@v4 @@ -33,4 +34,4 @@ jobs: run: sudo apt-get install -y libsecp256k1-dev - name: Run Hatch lint - run: hatch run linting:all + run: /tmp/venv/hatch run linting:all diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index d3f3ed61..01e11ae5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -25,12 +25,19 @@ jobs: - 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/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/codecov-action@v4.0.1 if: matrix.python-version == '3.11' with: From 979b332e7959c890f5d17291c8de868dc29761a2 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:04:06 +0200 Subject: [PATCH 03/25] Fix: Latest OS and Python were not tested --- .github/workflows/code-quality.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 019fc935..864a2eac 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -16,11 +16,9 @@ jobs: - 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 - python3 -m venv /tmp/venv - /tmp/venv/pip3 install hatch + sudo apt-get install -y python3-pip libsecp256k1-dev - name: Cache dependencies uses: actions/cache@v4 @@ -30,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/pip install hatch - name: Run Hatch lint run: /tmp/venv/hatch run linting:all From d210cfc2142220f47a8278fb4c3efa0421da9652 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:05:41 +0200 Subject: [PATCH 04/25] fixup! Fix: Latest OS and Python were not tested --- .github/workflows/code-quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 864a2eac..16ec4e91 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -31,7 +31,7 @@ jobs: - name: Install python dependencies run: | python3 -m venv /tmp/venv - /tmp/venv/pip install hatch + /tmp/venv/bin/pip install hatch - name: Run Hatch lint - run: /tmp/venv/hatch run linting:all + run: /tmp/venv/bin/hatch run linting:all From 9141b63ade8a69b68301cc4b649c6188675f2269 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:07:38 +0200 Subject: [PATCH 05/25] fixup! Fix: Latest OS and Python were not tested --- .github/workflows/pytest.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 01e11ae5..2893f78a 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -2,8 +2,6 @@ name: Test/Coverage with Python on: push: - branches: - - main pull_request: branches: - main From 6a43be2771a807eddd19357966ce990a18bf84e2 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:15:17 +0200 Subject: [PATCH 06/25] fixup! --- .github/workflows/build-wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8bcc6856..c96c44e3 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -12,7 +12,8 @@ jobs: build: strategy: matrix: - os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [ macos-14, ubuntu-24.04] + # FIXME os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: From 801019a06188860313f84c7d2f03e7072f30b957 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:18:47 +0200 Subject: [PATCH 07/25] fixup: pip freeze --- .github/workflows/pytest.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2893f78a..0699b720 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -30,7 +30,9 @@ jobs: python3 -m venv /tmp/venv /tmp/venv/bin/python -m pip install --upgrade pip hatch coverage - - run: /tmp/venv/bin/hatch run testing:test + - run: | + /tmp/venv/bin/pip freeze + /tmp/venv/bin/hatch run testing:test if: matrix.python-version != '3.11' - run: /tmp/venv/bin/hatch run testing:cov From 7514c242351a1a580724adb67075af372735b091 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:21:37 +0200 Subject: [PATCH 08/25] fixup! Fix: Latest OS and Python were not tested --- .github/workflows/pytest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0699b720..acab19c0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -32,6 +32,7 @@ jobs: - 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' From cfccf2ad521f067f4385174001e4b4fa8d70a454 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:25:39 +0200 Subject: [PATCH 09/25] fixup: bump coincurve --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f21f7ece..6ad24b91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ dependencies = [ "aiohttp>=3.8.3", "aleph-message~=0.4.4", - "coincurve; python_version<\"3.11\"", + "coincurve>=20.0.0; python_version<\"3.11\"", "coincurve>=17.0.0; python_version>=\"3.11\"", "eth_abi>=4.0.0; python_version>=\"3.11\"", "eth_account>=0.4.0,<0.11.0", @@ -231,4 +231,4 @@ exclude_lines = [ # Don't complain about ineffective code: "pass", -] \ No newline at end of file +] From b0a701a30b36bbb1889e6bd05c280a21d30305cc Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:29:00 +0200 Subject: [PATCH 10/25] fixup: bump coincurve --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ad24b91..f3b45d4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,9 @@ classifiers = [ dependencies = [ "aiohttp>=3.8.3", "aleph-message~=0.4.4", - "coincurve>=20.0.0; python_version<\"3.11\"", + "coincurve; python_version<\"3.11\"", "coincurve>=17.0.0; python_version>=\"3.11\"", + "coincurve>=20.0.0; python_version>=\"3.12\"", "eth_abi>=4.0.0; python_version>=\"3.11\"", "eth_account>=0.4.0,<0.11.0", "python-magic", From 37eeede4276aa6c349c5597a216cb11d6a3a5207 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:31:42 +0200 Subject: [PATCH 11/25] fixup: bump coincurve --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f3b45d4b..4df245f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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>=17.0.0; python_version~=\"3.11\"", "coincurve>=20.0.0; python_version>=\"3.12\"", "eth_abi>=4.0.0; python_version>=\"3.11\"", "eth_account>=0.4.0,<0.11.0", From 1f55d03d90702a6422f327ec95eaa4305ac6c738 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 16:32:06 +0200 Subject: [PATCH 12/25] fixup: bump coincurve --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4df245f9..9f512e71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +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>=20.0.0; python_version>=\"3.12\"", + "coincurve>=20.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", From 496e32856c4e9c89dd66a9a4da1875ec5fda50eb Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:13:17 +0200 Subject: [PATCH 13/25] fixup versions... --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9f512e71..cd05cfd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "aiohttp>=3.8.3", "aleph-message~=0.4.4", "coincurve; python_version<\"3.11\"", - "coincurve>=20.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", @@ -68,7 +68,7 @@ tezos = [ ] encryption = [ "eciespy; python_version<\"3.11\"", - "eciespy>=0.3.13; python_version>=\"3.11\"", + "eciespy>=0.4.1; python_version>=\"3.11\"", ] all = [ "aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,polkadot,solana,tezos,encryption]", From 7384084362257163aa1bcc0dea7fb87a5e374ac1 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:16:07 +0200 Subject: [PATCH 14/25] fixup versions... --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cd05cfd0..6e32478b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "aiohttp>=3.8.3", "aleph-message~=0.4.4", "coincurve; python_version<\"3.11\"", - "coincurve>=19.0.0; python_version>=\"3.11\"", + "coincurve>=18.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", From 66276aa72d6a15655528465f96eeb19069d172ed Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:45:43 +0200 Subject: [PATCH 15/25] test upstream eciespy --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e32478b..40c4a844 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "aiohttp>=3.8.3", "aleph-message~=0.4.4", "coincurve; python_version<\"3.11\"", - "coincurve>=18.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", @@ -68,7 +68,7 @@ tezos = [ ] encryption = [ "eciespy; python_version<\"3.11\"", - "eciespy>=0.4.1; python_version>=\"3.11\"", + "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; python_version>=\"3.11\"", ] all = [ "aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,polkadot,solana,tezos,encryption]", From e3695562e38d9d3942030466d928e22be716306a Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:49:46 +0200 Subject: [PATCH 16/25] test upstream eciespy --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 40c4a844..2d60ecc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,8 +67,8 @@ tezos = [ "pynacl", ] encryption = [ - "eciespy; python_version<\"3.11\"", - "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; python_version>=\"3.11\"", + "eciespy; python_version<'3.11'", + "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; python_version>='3.11'" ] all = [ "aleph-sdk-python[cosmos,dns,docs,ledger,mqtt,nuls2,polkadot,solana,tezos,encryption]", From 23015534b6a0fb1c654af3d7a5ea38fce3b5c2c3 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:52:56 +0200 Subject: [PATCH 17/25] test upstream eciespy --- pyproject.toml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2d60ecc1..d3be9e4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,13 +67,18 @@ tezos = [ "pynacl", ] encryption = [ - "eciespy; python_version<'3.11'", - "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; python_version>='3.11'" +# "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" From 8a8d81754f85633c6aa26d1ddd8bde1e69de0808 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 17:58:43 +0200 Subject: [PATCH 18/25] update testing systems --- .github/workflows/build-wheels.yml | 3 +-- .github/workflows/pytest.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index c96c44e3..8bcc6856 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -12,8 +12,7 @@ jobs: build: strategy: matrix: - os: [ macos-14, ubuntu-24.04] - # FIXME os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index acab19c0..efe667ea 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -15,7 +15,7 @@ jobs: build: strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] runs-on: ubuntu-latest steps: From de373ef367ff461413ce2f55eb575f89efd80c6e Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:03:57 +0200 Subject: [PATCH 19/25] Fix: 'called_once' is not a valid assertion. AttributeError: 'called_once' is not a valid assertion. Use a spec for the mock if 'called_once' is meant to be an attribute. --- tests/unit/test_asynchronous.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/test_asynchronous.py b/tests/unit/test_asynchronous.py index f31274fd..0fa0df38 100644 --- a/tests/unit/test_asynchronous.py +++ b/tests/unit/test_asynchronous.py @@ -33,7 +33,7 @@ async def test_create_post(mock_session_with_post_success): sync=False, ) - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(post_message, PostMessage) assert message_status == MessageStatus.PENDING @@ -47,7 +47,7 @@ async def test_create_aggregate(mock_session_with_post_success): channel="TEST", ) - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(aggregate_message, AggregateMessage) @@ -83,7 +83,7 @@ async def test_create_store(mock_session_with_post_success): storage_engine=StorageEnum.storage, ) - assert mock_session_with_post_success.http_session.post.called + assert mock_session_with_post_success.http_session.post.assert_called assert isinstance(store_message, StoreMessage) @@ -98,7 +98,7 @@ async def test_create_program(mock_session_with_post_success): metadata={"tags": ["test"]}, ) - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(program_message, ProgramMessage) @@ -118,7 +118,7 @@ async def test_create_instance(mock_session_with_post_success): hypervisor=HypervisorType.qemu, ) - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(instance_message, InstanceMessage) @@ -139,7 +139,7 @@ async def test_create_instance_no_payment(mock_session_with_post_success): assert instance_message.content.payment.type == PaymentType.hold assert instance_message.content.payment.chain == Chain.ETH - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(instance_message, InstanceMessage) @@ -159,7 +159,7 @@ async def test_create_instance_no_hypervisor(mock_session_with_post_success): assert instance_message.content.environment.hypervisor == HypervisorType.firecracker - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(instance_message, InstanceMessage) @@ -172,7 +172,7 @@ async def test_forget(mock_session_with_post_success): channel="TEST", ) - assert mock_session_with_post_success.http_session.post.called_once + assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(forget_message, ForgetMessage) From 8fc63e55925b9e5c3b895efd8b65d17723825588 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:09:03 +0200 Subject: [PATCH 20/25] fixup: setuptools/pkg-resources --- .github/workflows/build-wheels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 8bcc6856..7488e7b2 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -11,6 +11,7 @@ on: jobs: build: strategy: + fail-fast: false matrix: os: [macos-11, macos-12, macos-13, macos-14, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} @@ -50,6 +51,10 @@ jobs: sudo apt-get -y upgrade sudo apt-get install -y libsecp256k1-dev + - name: Install `setuptools` on systems where it is missing by default + run: sudo apt-get install --reinstall python-pkg-resources + if: matrix.is == 'ubuntu-24.04' + - name: Install Hatch run: | python3 -m venv /tmp/venv From 59364d93a0a79a31d363dc5c1b3843722a006a78 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:11:24 +0200 Subject: [PATCH 21/25] fixup: setuptools/pkg-resources --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 7488e7b2..57c28702 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -53,7 +53,7 @@ jobs: - name: Install `setuptools` on systems where it is missing by default run: sudo apt-get install --reinstall python-pkg-resources - if: matrix.is == 'ubuntu-24.04' + if: matrix.os == 'ubuntu-24.04' - name: Install Hatch run: | From 6c3d4b0717ae127717e0d6feae8a334eae47e70a Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:15:23 +0200 Subject: [PATCH 22/25] fixup: setuptools/pkg-resources --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 57c28702..ac37d8fe 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -52,7 +52,7 @@ jobs: sudo apt-get install -y libsecp256k1-dev - name: Install `setuptools` on systems where it is missing by default - run: sudo apt-get install --reinstall python-pkg-resources + run: sudo apt-get install python3-setuptools python3-pkg-resources if: matrix.os == 'ubuntu-24.04' - name: Install Hatch From fc606ee3f4ff59a5f1121c403fa528ad2cb198ad Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:18:56 +0200 Subject: [PATCH 23/25] fixup: setuptools/pkg-resources --- .github/workflows/build-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index ac37d8fe..62d14049 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -52,7 +52,7 @@ jobs: sudo apt-get install -y libsecp256k1-dev - name: Install `setuptools` on systems where it is missing by default - run: sudo apt-get install python3-setuptools python3-pkg-resources + run: sudo apt-get install --reinstall python3-setuptools python3-pkg-resources if: matrix.os == 'ubuntu-24.04' - name: Install Hatch From ccb5ec129950afd27a81144113ce755d92f7b664 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:24:43 +0200 Subject: [PATCH 24/25] fixup: setuptools/pkg-resources --- .github/workflows/build-wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 62d14049..c07479e8 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -51,10 +51,6 @@ jobs: sudo apt-get -y upgrade sudo apt-get install -y libsecp256k1-dev - - name: Install `setuptools` on systems where it is missing by default - run: sudo apt-get install --reinstall python3-setuptools python3-pkg-resources - if: matrix.os == 'ubuntu-24.04' - - name: Install Hatch run: | python3 -m venv /tmp/venv @@ -68,6 +64,10 @@ jobs: run: | /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: | /tmp/venv/bin/python3 -c "import aleph.sdk" From 41bc12f4adfd17cf54d4710d658669ad0d524780 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Mon, 10 Jun 2024 18:24:43 +0200 Subject: [PATCH 25/25] Fix: Add comment regarding eciespy --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d3be9e4b..b7d7abc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,10 +67,10 @@ tezos = [ "pynacl", ] encryption = [ -# "eciespy; python_version<'3.11'", -# "eciespy @ git+https://github.com/ecies/py.git@4b4256cde1d8acd773dff76fd8ab855a8e9faa4f#egg=eciespy; 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]",