ci: use ruff 0.16.x #36051

pull fanquake wants to merge 3 commits into bitcoin:master from fanquake:ruff_16 changing 2 files +3 −3
  1. fanquake commented at 8:32 AM on August 21, 2026: member

    Also use mypy 2.3.1 and pyzmq 27.2.0.

  2. ci: use ruff 16 f29f076f3c
  3. ci: use pyzmq 27.2.0 7a53beca06
  4. ci: use mypy 2.3.1 9d0c38db74
  5. fanquake requested review from willcl-ark on Aug 21, 2026
  6. DrahtBot added the label Tests on Aug 21, 2026
  7. DrahtBot commented at 8:32 AM on August 21, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36051.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK willcl-ark, janb84, maflcko

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  8. willcl-ark approved
  9. willcl-ark commented at 9:08 AM on August 21, 2026: member

    ACK 9d0c38db74668b0383daadbff5093910b269a860

    Checked out the release notes for all three: https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md https://pyzmq.readthedocs.io/en/latest/changelog.html https://mypy.readthedocs.io/en/stable/changelog.html

    And there doesn't look to be anything of concern to us. CI also seems happy (so far).

  10. janb84 commented at 10:32 AM on August 21, 2026: contributor

    ACK 9d0c38db74668b0383daadbff5093910b269a860

    Seems like a nice update to get into 32.

    Ran the updated packages locally with no issues , also scanned the releasenotes linked in comment of Will, CI looks good, so LGTM!

  11. in ci/lint_imagefile:13 in 9d0c38db74
       9 | @@ -10,7 +10,7 @@ FROM mirror.gcr.io/ubuntu:26.04
      10 |  # https://docs.astral.sh/uv/reference/policies/versioning/
      11 |  # https://docs.astral.sh/ruff/versioning/
      12 |  COPY --from=ghcr.io/astral-sh/uv:0.11 /uv /uvx /bin/
      13 | -COPY --from=ghcr.io/astral-sh/ruff:0.15 /ruff /bin/
      14 | +COPY --from=ghcr.io/astral-sh/ruff:0.16 /ruff /bin/
    


    maflcko commented at 11:00 AM on August 21, 2026:

    This is pretty unrleated, but from the recent "pinning discussion". One could use nix here for a full pin, and only having to modify one line to update all tools, with something like (untested, and the python3.10 install fails):

    Also, the uv pip installs remain un-pinned, but maybe this can be done later.

    edit: Also, seems to eat 4GB of storage instead of 1GB....

    diff --git a/ci/lint/01_install.sh b/ci/lint/01_install.sh
    index 9c2020a..86e1e74 100755
    --- a/ci/lint/01_install.sh
    +++ b/ci/lint/01_install.sh
    @@ -8,19 +8,17 @@ export LC_ALL=C
     
     set -o errexit -o pipefail -o xtrace
     
    -export DEBIAN_FRONTEND=noninteractive
     export CI_RETRY_EXE="/ci_retry"
     
     pushd "/"
     
    -${CI_RETRY_EXE} apt-get update
     # Lint dependencies:
     # - cargo (used to run the lint tests)
    -# - curl/xz-utils (to install shellcheck)
    +# - curl (used to install mlc)
     # - git (used in many lint scripts)
     # - gpg (used by verify-commits)
     # - moreutils (used by scripted-diff)
    -${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg moreutils
    +# These packages are installed via ci/lint/packages.nix.
     
     # Install Python and create venv using uv (reads version from .python-version)
     uv venv /python_env
    @@ -31,11 +29,6 @@ python3 --version
     
     uv pip install --python /python_env --requirements /ci/lint/requirements.txt
     
    -SHELLCHECK_VERSION=v0.11.0
    -curl --fail -L "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.$(uname --machine).tar.xz" | \
    -    tar --xz -xf - --directory /tmp/
    -mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/
    -
     MLC_VERSION=v1.2.0
     curl --fail -L "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/mlc-$(uname --machine)-linux" -o "/usr/bin/mlc"
     chmod +x /usr/bin/mlc
    diff --git a/ci/lint/packages.nix b/ci/lint/packages.nix
    new file mode 100644
    index 0000000..94defe0
    --- /dev/null
    +++ b/ci/lint/packages.nix
    @@ -0,0 +1,17 @@
    +let
    +  nixpkgs = builtins.fetchTarball {
    +    url = "https://github.com/NixOS/nixpkgs/archive/07e1d92cdc0ed416cfa11ff3ca40d17e61cfba7a.tar.gz";
    +    sha256 = "1jxgz2l7qpq16aclvd40bzy7rzkph50wb93mwm2fkh6srr5p6a1x";
    +  };
    +  pkgs = import nixpkgs {};
    +in with pkgs; [
    +  bash
    +  cargo
    +  curl
    +  git
    +  gnupg
    +  moreutils
    +  ruff
    +  shellcheck
    +  uv
    +]
    diff --git a/ci/lint_imagefile b/ci/lint_imagefile
    index cc4986a..45a8647 100644
    --- a/ci/lint_imagefile
    +++ b/ci/lint_imagefile
    @@ -4,20 +4,17 @@
     
     # See test/lint/README.md for usage.
     
    -FROM mirror.gcr.io/ubuntu:26.04
    -
    -# Pin uv and ruff to minor version to avoid breaking changes
    -# https://docs.astral.sh/uv/reference/policies/versioning/
    -# https://docs.astral.sh/ruff/versioning/
    -COPY --from=ghcr.io/astral-sh/uv:0.11 /uv /uvx /bin/
    -COPY --from=ghcr.io/astral-sh/ruff:0.15 /ruff /bin/
    +FROM docker.io/nixos/nix:2.34.3
     
     COPY ./ci/retry/retry /ci_retry
    +COPY ./ci/lint/packages.nix /ci/lint/packages.nix
     COPY ./.python-version /.python-version
     COPY ./ci/lint/requirements.txt /ci/lint/requirements.txt
     COPY ./ci/lint/01_install.sh /install.sh
     
    -RUN /install.sh && \
    -  rm -rf /var/lib/apt/lists/*
    +RUN nix-env --uninstall git-minimal && nix-env \
    +      --file /ci/lint/packages.nix \
    +      --install && \
    +    /install.sh
     
     WORKDIR /bitcoin
    

    fanquake commented at 12:38 PM on August 21, 2026:

    Looks interesting. Lets discuss in a followup? Some tradeoffs to pinning everything under 1 hash, and it requiring 4x the storage.


    willcl-ark commented at 3:37 PM on August 21, 2026:

    I don't think this will be worth it unfortunately. the "nix way" of doing this is to build the actual image itself directly from a nix expression (or flake) using pkgs.dockerTools.buildLayeredImage. I have an example:

    https://github.com/willcl-ark/bitcoin-core-docker/blob/master/master/flake.nix https://github.com/willcl-ark/bitcoin-core-docker/blob/master/master/nix/docker.nix

    This precisely builds the exact closure. It could be nice-ish, but it would require lint-runners to have nix installed to build the image, which I presume we don't want.

    We could have a builder which pushed an image to dockerhub, which would work OK for CI (where we can install nix anyway and rebuild on changes to lint things), but it would require that devs making changes to any lint stuff have nix installed...

    Also, we'll inevitably find at some point we want newer or older packages, then have to use multiple nix revisions resulting in ... multiple places to touch when updating package versions!

  12. maflcko commented at 11:00 AM on August 21, 2026: member

    lgtm ACK 9d0c38db74668b0383daadbff5093910b269a860

    Seems fine

  13. fanquake merged this on Aug 21, 2026
  14. fanquake closed this on Aug 21, 2026

  15. fanquake deleted the branch on Aug 21, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-26 12:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me