diff --git a/.github/workflows/nix-ci.yml b/.github/workflows/nix-ci.yml index b3b98c307..01c37a6a4 100644 --- a/.github/workflows/nix-ci.yml +++ b/.github/workflows/nix-ci.yml @@ -5,14 +5,17 @@ name: Test nix-shell on: push: branches: - - 'doesnt_exist' + - '*' jobs: nix-shell: + continue-on-error: true strategy: matrix: - os: [macos-latest, ubuntu-latest] + os: [ubuntu-latest] + # os: [ubuntu-latest, macos-latest] + fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -27,5 +30,10 @@ jobs: # Use channel nixos-23.11 for Linux and nixpkgs-23.11-darwin for macOS nix_path: nixpkgs=channel:${{ matrix.os == 'macos-latest' && 'nixpkgs-24.05-darwin' || 'nixos-24.05' }} + - name: Disable incompatible dependency of `nuls2` + run: | + sed -i.bak '/py-ed25519-bindings/ s/^[[:space:]]*/# /' pyproject.toml + rm pyproject.toml.bak + - name: Run tests - run: nix-shell --run "hatch run testing:test -- ./src/ ./test/" + run: nix-shell --run "hatch run testing:test" diff --git a/pyproject.toml b/pyproject.toml index e06b9a39d..414094200 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ dependencies = [ "aleph-message==0.6.1", "aleph-nuls2==0.1", "aleph-p2p-client @ git+https://github.com/aleph-im/p2p-service-client-python@cbfebb871db94b2ca580e66104a67cd730c5020c", - "aleph-pytezos==3.13.4", "asyncpg==0.30", "base58>=1.0.3", "coincurve==20", @@ -50,6 +49,7 @@ dependencies = [ "pycryptodome==3.21.0", # for libp2p-stubs "pymultihash==0.8.2", # for libp2p-stubs "pynacl==1.5", + "pytezos-crypto==3.13.4.1", "python-dateutil==2.8.2", "pytz==2023.3", "pyyaml==6.0.1", @@ -62,7 +62,7 @@ dependencies = [ "sqlalchemy-utils==0.38.3", "substrate-interface==1.7.4", "types-aiofiles==23.2.0.20240403", - "ujson==5.10.0", # required by aiocache + "ujson==5.10.0", # required by aiocache "urllib3==2.3", "uvloop==0.21", "web3==6.11.2", diff --git a/shell.nix b/shell.nix index 611230b33..fc57e1ecb 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,6 @@ -{ pkgs ? import {} }: +{ }: let - unstable = import (fetchTarball https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz) {}; + pkgs = import (fetchTarball "https://nixos.org/channels/nixos-24.11/nixexprs.tar.xz") {}; in pkgs.mkShell { buildInputs = [ @@ -8,21 +8,23 @@ pkgs.mkShell { pkgs.libiconv # for macos pkgs.ps - unstable.libsodium pkgs.postgresql + pkgs.postgresql.lib pkgs.redis pkgs.kubo - unstable.hatch + pkgs.hatch pkgs.rustup - unstable.python312 - unstable.python312Packages.virtualenv - unstable.python312Packages.pip - unstable.python312Packages.setuptools + pkgs.python312 + pkgs.python312Packages.virtualenv + pkgs.python312Packages.pip + pkgs.python312Packages.setuptools + pkgs.python312Packages.distutils - unstable.python312Packages.fastecdsa - unstable.python312Packages.greenlet + pkgs.python312Packages.fastecdsa + pkgs.python312Packages.libnacl + pkgs.python312Packages.greenlet ]; shellHook = '' @@ -65,13 +67,13 @@ pkgs.mkShell { fi # Install the required Python packages - ./venv/bin/pip install -e .\[testing\] + ./venv/bin/pip install -e ".[testing]" # PyO3 requires a nightly or dev version of Rust. rustup default nightly # If config.yml does not exist, create it with the port specified in this shell. - [ -e config.yml ] || echo -e "postgres:\n port: $PG_PORT" > config.yml + echo -e "postgres:\n host: "localhost"\n port: $PG_PORT" > config.yml # bold echo -e "\e[1m" @@ -88,5 +90,8 @@ pkgs.mkShell { # Activate the virtual environment source venv/bin/activate + + # Ensure libpq.so.5 can be found. + export LD_LIBRARY_PATH=${pkgs.postgresql.lib}/lib:$LD_LIBRARY_PATH ''; } diff --git a/src/aleph/chains/tezos.py b/src/aleph/chains/tezos.py index 59f5690a2..b8a951d8b 100644 --- a/src/aleph/chains/tezos.py +++ b/src/aleph/chains/tezos.py @@ -6,9 +6,9 @@ import aiohttp from aleph_message.models import Chain -from aleph_pytezos.crypto.key import Key from configmanager import Config from nacl.exceptions import BadSignatureError +from pytezos_crypto.key import Key import aleph.toolkit.json as aleph_json from aleph.chains.abc import ChainReader, Verifier