From 7fddac59a9c2968ef1a6e0047bd0c5de84612ccc Mon Sep 17 00:00:00 2001 From: Moul <moul@moul.re> Date: Thu, 2 Jan 2025 14:49:42 +0100 Subject: [PATCH] Bump pre-commit hooks, pytest-cov Apply mkdocs and Ruff new reports --- .pre-commit-config.yaml | 6 +++--- docs/changelog.md | 2 +- docs/contributing/container_usage.md | 12 ++++++++++++ docs/contributing/install_poetry.md | 2 ++ docs/install.md | 12 ++++++++++++ pyproject.toml | 2 +- silkaj/blockchain/blocks.py | 4 ++-- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8390fcce..7497ee95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.8.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -20,7 +20,7 @@ repos: hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.14.1 hooks: - id: mypy - repo: https://gitlab.com/devopshq/gitlab-ci-linter @@ -41,7 +41,7 @@ repos: - --license-filepath - license_header.txt - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.21 hooks: - id: mdformat additional_dependencies: diff --git a/docs/changelog.md b/docs/changelog.md index c443621e..d0e97c33 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -479,7 +479,7 @@ Thanks to @matograine for this bugfix and the release! - #153: Install on Windows, Scrypt issue - #154: net: can’t get screen size on Windows -- !92: Document Windows installation with pip +- !92: Document Windows installation with pip #### Project diff --git a/docs/contributing/container_usage.md b/docs/contributing/container_usage.md index f1d0bd73..1ef92f15 100644 --- a/docs/contributing/container_usage.md +++ b/docs/contributing/container_usage.md @@ -9,11 +9,13 @@ In case you use `docker`, you can [add your user into the `docker` group, so you Pull the image: === "Podman" + ``` podman pull registry.duniter.org/clients/python/silkaj/release/pip:latest ``` === "Docker" + ``` sudo docker pull registry.duniter.org/clients/python/silkaj/release/pip:latest ``` @@ -21,11 +23,13 @@ Pull the image: Run Silkaj from outside the image: === "Podman" + ``` podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest silkaj info ``` === "Docker" + ``` sudo docker run -it registry.duniter.org/clients/python/silkaj/release/pip:latest silkaj info ``` @@ -33,11 +37,13 @@ Run Silkaj from outside the image: Go into the image: === "Podman" + ``` podman run -it registry.duniter.org/clients/python/silkaj/release/pip:latest bash ``` === "Docker" + ``` sudo docker run -it registry.duniter.org/clients/python/silkaj/release/pip:latest bash ``` @@ -58,11 +64,13 @@ This is fine for doing small editions. For bigger editions, it is adviced to use Pull the image: === "Podman" + ``` podman pull registry.duniter.org/clients/python/silkaj/release/poetry:latest ``` === "Docker" + ``` sudo docker pull registry.duniter.org/clients/python/silkaj/release/poetry:latest ``` @@ -70,11 +78,13 @@ Pull the image: Run Silkaj from ouside the image: === "Podman" + ``` podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest silkaj info ``` === "Docker" + ``` sudo docker run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest silkaj info ``` @@ -82,11 +92,13 @@ Run Silkaj from ouside the image: Go into the image: === "Podman" + ``` podman run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest bash ``` === "Docker" + ``` sudo docker run -it registry.duniter.org/clients/python/silkaj/release/poetry:latest bash ``` diff --git a/docs/contributing/install_poetry.md b/docs/contributing/install_poetry.md index a4e465ad..051b85d4 100644 --- a/docs/contributing/install_poetry.md +++ b/docs/contributing/install_poetry.md @@ -7,11 +7,13 @@ ### Install libsodium === "Debian" + ``` sudo apt install libsodium23 ``` === "Fedora" + ``` sudo dnf install libsodium ``` diff --git a/docs/install.md b/docs/install.md index dc4e123f..f7c6ed29 100644 --- a/docs/install.md +++ b/docs/install.md @@ -19,16 +19,19 @@ On a Unix system, run in your shell following commands: ### Install libsodium === "Debian" + ``` sudo apt install libsodium23 ``` === "Fedora" + ``` sudo dnf install libsodium-devel ``` === "macOS" + ``` brew install libsodium ``` @@ -38,16 +41,19 @@ On a Unix system, run in your shell following commands: Check [`pipx` documentation](https://pipx.pypa.io/stable/) for an extended installation tutorial. === "Debian" + ``` sudo apt install pipx python3-dev ``` === "Fedora" + ``` sudo dnf install pipx python3-devel ``` === "macOS" + ``` brew install python3 pipx ``` @@ -98,16 +104,19 @@ ______________________________________________________________________ ### Install `pip` === "Debian" + ``` sudo apt install python3-pip ``` === "Fedora" + ``` sudo dnf install python3-pip ``` === "macOS" + Already installed with `python3` ### Completing `PATH` @@ -148,16 +157,19 @@ silkaj Set up the shell completion by adding following line in your shell configuration depending on your shell: === "Bash" + ```title="$HOME/.bashrc" eval "$(_SILKAJ_COMPLETE=bash_source silkaj)" ``` === "Zsh" + ```title="$HOME/.zshrc" eval "$(_SILKAJ_COMPLETE=zsh_source silkaj)" ``` === "Fish" + ```title="$HOME/.config/fish/completions/silkaj.fish" _SILKAJ_COMPLETE=fish_source silkaj | source ``` diff --git a/pyproject.toml b/pyproject.toml index f693c993..86fc39dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ pydiscourse = { version = "^1.7.0", optional = true } [tool.poetry.group.test.dependencies] pytest = "^8.1.1" -pytest-cov = "^5.0" +pytest-cov = "^6.0" pytest-sugar = "^1.0.0" pytest-clarity = "^1.0.1" diff --git a/silkaj/blockchain/blocks.py b/silkaj/blockchain/blocks.py index 9225fa1c..d49e4fa9 100644 --- a/silkaj/blockchain/blocks.py +++ b/silkaj/blockchain/blocks.py @@ -58,8 +58,8 @@ def list_blocks(number: int, detailed: bool) -> None: issuer["powMin"] = block["powMin"] issuers_dict[issuer["pubkey"]] = issuer issuers.append(issuer) - for pubkey in issuers_dict: - issuer = issuers_dict[pubkey] + for pubkey in issuers_dict.items(): + issuer = issuers_dict[pubkey[0]] time.sleep(BMA_SLEEP) try: idty = identity_of(issuer["pubkey"]) -- GitLab