From fde1ef4d168b156bb848ca170df51cd198a0e0b4 Mon Sep 17 00:00:00 2001 From: Kyle Into Date: Wed, 2 Dec 2026 09:44:20 -0800 Subject: [PATCH] Add all stable Pyrefly releases and use 1.5.1 in the examples The checked-in release metadata only includes Pyrefly 1.2.0. To use a newer Pyrefly, users must pass the SHA-256 of every release asset to pyrefly.toolchain(sha256 = ...). Add the checksums of every stable release from 1.2.1 to 1.5.1 to pyrefly/private/versions.bzl. Pyrefly 1.2.0 is the first stable release with bazel-check, so older releases are not useful here. Prereleases stay on the sha256 path. Use 1.5.1 in the demo, the README, the docs, and the toolchain resolution test. --- CHANGELOG.md | 2 + README.md | 8 +-- docs/integration.md | 5 +- docs/users.md | 2 +- examples/demo/MODULE.bazel | 2 +- pyrefly/private/versions.bzl | 80 ++++++++++++++++++++++++++++ tests/verify_toolchain_resolution.py | 2 +- 7 files changed, 93 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b683fb1..4e1026c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,5 +7,7 @@ All notable user-facing changes to `rules_pyrefly` are documented in this file. ### Added - Support for Bazel 8.x alongside Bazel 9.x. +- Checked-in release metadata for every stable Pyrefly release from 1.2.1 to + 1.5.1, in addition to 1.2.0. The examples and docs now use Pyrefly 1.5.1. [Unreleased]: https://github.com/facebook/rules_pyrefly/compare/v0.1.0...HEAD diff --git a/README.md b/README.md index 985cdac..cdec836 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,10 @@ checking over `py_*` targets. run Pyrefly through a registered Bzlmod toolchain or through a direct `pyrefly_cli` executable override. -Pyrefly `1.2.0` is the checked-in supported version and the first stable Pyrefly -release that includes the experimental `bazel-check` command. +Pyrefly `1.5.1` is the recommended version. The checked-in release metadata +includes every stable Pyrefly release from `1.2.0` to `1.5.1`. Pyrefly `1.2.0` +is the first stable release that includes the experimental `bazel-check` +command. For more detail, see the [design](docs/design.md), [integration notes](docs/integration.md), and [user notes](docs/users.md). @@ -23,7 +25,7 @@ Add the ruleset and register a Pyrefly toolchain in `MODULE.bazel`: bazel_dep(name = "rules_pyrefly", version = "") pyrefly = use_extension("@rules_pyrefly//pyrefly:extensions.bzl", "pyrefly") -pyrefly.toolchain(version = "1.2.0") +pyrefly.toolchain(version = "1.5.1") use_repo(pyrefly, "pyrefly_toolchains") register_toolchains("@pyrefly_toolchains//:all") ``` diff --git a/docs/integration.md b/docs/integration.md index 1195024..2a696ff 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -160,8 +160,9 @@ string. The current implementation targets Bazel 8.x and 9.x with `rules_python` 1.7.0 or newer. The `bazel-check` interface it depends on remains experimental in -Pyrefly. Pyrefly `1.2.0` is the checked-in supported baseline and the first -stable Pyrefly release that includes this interface. +Pyrefly. Pyrefly `1.2.0` is the first stable Pyrefly release that includes this +interface. The checked-in release metadata includes every stable release from +`1.2.0` to `1.5.1`; the examples use `1.5.1`. The main v1 action path is implemented: target filtering, input JSON emission, Pyrefly invocation, action inputs, output groups, executable resolution, target diff --git a/docs/users.md b/docs/users.md index c48526f..60c99c6 100644 --- a/docs/users.md +++ b/docs/users.md @@ -6,7 +6,7 @@ Bazel Python project. ## Getting Started - Add `rules_pyrefly` alongside the existing Python rules, then pin a Pyrefly - version explicitly. The current supported baseline is Pyrefly `1.2.0`. + version explicitly. The recommended version is Pyrefly `1.5.1`. - Define a separate `pyrefly_aspect` instead of replacing an existing `mypy_aspect` immediately. This makes it easy to compare results. - If the existing mypy aspect loads generated type dependencies, put the diff --git a/examples/demo/MODULE.bazel b/examples/demo/MODULE.bazel index 83a9384..7f36291 100644 --- a/examples/demo/MODULE.bazel +++ b/examples/demo/MODULE.bazel @@ -28,6 +28,6 @@ local_path_override( ) pyrefly = use_extension("@rules_pyrefly//pyrefly:extensions.bzl", "pyrefly") -pyrefly.toolchain(version = "1.2.0") +pyrefly.toolchain(version = "1.5.1") use_repo(pyrefly, "pyrefly_toolchains") register_toolchains("@pyrefly_toolchains//:all") diff --git a/pyrefly/private/versions.bzl b/pyrefly/private/versions.bzl index d035dda..b292688 100644 --- a/pyrefly/private/versions.bzl +++ b/pyrefly/private/versions.bzl @@ -25,4 +25,84 @@ PYREFLY_RELEASES = { "pyrefly-windows-x86_64.zip": "6b5a5fe1c15093cb369bfcab0651f9e904417d0af49d2095ea75a91735c0fce4", }, }, + "1.2.1": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "b2d4653ee1b64cc3eec3a0b21d9fd03715dc33c33e0bc78e7804d5468cd03545", + "pyrefly-linux-x86_64-musl.tar.gz": "ed118dde5b160ad98b5260a5511dcfc5bb8d4b7e04f483c985d2df6ddaf0bbad", + "pyrefly-macos-arm64.tar.gz": "b9ff6b22c1cce276d2ce2d84ee7770f2794f4e1efdea239def046264ee1b5197", + "pyrefly-macos-x86_64.tar.gz": "2b891db343c111c48d8be32d9b93ac0adf7bd9a93d6bdeb5303e770592a091cd", + "pyrefly-windows-arm64.zip": "68aeda9ed1c3ebb11e42ae2172039d55225d44bdb656d30b642c28eea2d9a7a0", + "pyrefly-windows-x86_64.zip": "a175cbbac6a00d42e1cf24dda18eec29c865d6b1a3540b8b9f5c76f77467a1e6", + }, + }, + "1.3.0": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "954833c74958d844139e02bf0d240aa05cd96c231086069d00658a3aebad44bf", + "pyrefly-linux-x86_64-musl.tar.gz": "97586de84f392a9c2220fdded4ae58a1528e939bff237a0693be140843e6969f", + "pyrefly-macos-arm64.tar.gz": "c15ad88f494c03e434290a7a22ada4028a184f5f9140e2e869b6cd6eea3637c8", + "pyrefly-macos-x86_64.tar.gz": "f82c8dae0975ef3929636df20cff02294b0be80bda9825910f1e3164954b9aef", + "pyrefly-windows-arm64.zip": "cfa729f6d82aedd628e15630396597925eef7bfbb071f068aa0a28a7721b2802", + "pyrefly-windows-x86_64.zip": "2e37f7a128e59d6740983bd6d14ad5699bd95b04cda7a116de70214d91c407fb", + }, + }, + "1.3.1": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "c7770869c96bb3dfa4c39c30b644e1d4c61e8f8645069ebf2dac117c34cb9cd1", + "pyrefly-linux-x86_64-musl.tar.gz": "4859097cc9b00b8719993dc8228d2bffcc8659414d32494bb752ccf9d535dc21", + "pyrefly-macos-arm64.tar.gz": "3c7294e86efb53d6bc46619fd17002266731a79894a668b8e9db2ec189e746d2", + "pyrefly-macos-x86_64.tar.gz": "497d5743ff54f1b4a444f72a4147d7b85fa8cf20bf87123304b00b6173254545", + "pyrefly-windows-arm64.zip": "e92c6ee9078d7bbcdb3a22d6be44e0335ddce1e0f9ea9b0eea8fcdd9ce07010e", + "pyrefly-windows-x86_64.zip": "d10bb909b9007d076fe7cb1f7164e26ab4287ca08e4df624fffaee7360f44baa", + }, + }, + "1.3.2": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "3d0ec81c08dbb4a5251dd15800131e8d82b3f09c118f6c669ccbf1bf486db65e", + "pyrefly-linux-x86_64-musl.tar.gz": "11bc0951e77e5fe2eb84b3e297bc2af598e6008b2f2788336cbc610a254a303b", + "pyrefly-macos-arm64.tar.gz": "7c0b2109a00ccca83e22daa3724d4a091a1b673823175004eb449ba88ab2adb7", + "pyrefly-macos-x86_64.tar.gz": "5ceb539168b2cd681d032f6e2b6d95571fd92e6cad70d11acd9284660d56e88e", + "pyrefly-windows-arm64.zip": "46e7a5eeef2eb4a11e88aebff2a49f5d45f31250221bcef1ef1b9cba08513bb1", + "pyrefly-windows-x86_64.zip": "3f23b1807033aff34c96f65ead4958d1493fbcbb087cc5ba3ab3ce9ebbd95911", + }, + }, + "1.4.0": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "ead4b6c024f3060e8afd09b24b2650cde70c2bfab6fb639aebc773885418c476", + "pyrefly-linux-x86_64-musl.tar.gz": "a615290c7f2dbcf38a103fe8c0c617b3d9d8a756a1665eddd9c49782275b002e", + "pyrefly-macos-arm64.tar.gz": "590b1a638e68e9573fe2c79386d8cfb69eddc575c54b798d2375b054a5c66c90", + "pyrefly-macos-x86_64.tar.gz": "9660dfe2abef579b3a684d18a926d4d82ece1cde12f0a809b3f44ff50d443a81", + "pyrefly-windows-arm64.zip": "76725412d1a799ca4015d0e99a76d24ae26f42bb53379f8330f5f4ce5cd35ee6", + "pyrefly-windows-x86_64.zip": "90cb8c7d92051d274c48dd1caacbc20e795b3f5248ddc55d6d22adf53424225f", + }, + }, + "1.4.1": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "e689804431d3419b2e342c0f0fa7a429273be4910d5fe32c5c26ec4d6d5fbc68", + "pyrefly-linux-x86_64-musl.tar.gz": "254275403d5312541a7d3b57f6a466f6c47c61fcae4aa6c53eb2259dabf94a02", + "pyrefly-macos-arm64.tar.gz": "c3bed7f4777e4727b0a16833ea1e7cdbae0a9ba7b9f274c8c99a59a13ea378bc", + "pyrefly-macos-x86_64.tar.gz": "fbe1fe0da29556696df812d9099c03bbc744c63aa4dc671bde37806d31434e64", + "pyrefly-windows-arm64.zip": "f90c4cce550b5c4e5376fe0f02c8c7e1b181f975aced393bcd8d50426df61ad2", + "pyrefly-windows-x86_64.zip": "5a90780dbb78faad27bab4ce6e14f5ae0065e0aa3a46f5542c62ad62533c5c3b", + }, + }, + "1.5.0": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "0dbaeca00d082189eb5641fb787ff11ec497f310651fd0f2bc44ed6bb42429c3", + "pyrefly-linux-x86_64-musl.tar.gz": "b5c01c39fd089cb1f45b9b7553d1dbfd21644b23ca5721e16f29c32631659ee1", + "pyrefly-macos-arm64.tar.gz": "c8637fd8ef859facbe70a647ce77fa82b26394d49b5f37c0246fb22b7b5b265e", + "pyrefly-macos-x86_64.tar.gz": "c2d00f7da3755199b3c0a758944c12f960f73f6c7891a0ed4e602fe38d9868c5", + "pyrefly-windows-arm64.zip": "01841b1c2e730858453b4a8f33e9373ef5846f95270d0dcc7f9c656163259e00", + "pyrefly-windows-x86_64.zip": "c1dcc29d7b47eb9c2c251d2e1f0e7fbb7116c1e7e238b85db94c588b819db306", + }, + }, + "1.5.1": { + "assets": { + "pyrefly-linux-arm64-musl.tar.gz": "c904fff99be18d83828173330b4b43e84191a7d6421f1037f9c4637360e4f91b", + "pyrefly-linux-x86_64-musl.tar.gz": "bcf4bd70bd08b546c915998ff6b7ffd67dda0fca4cf8aa7de59d29802fc32ba3", + "pyrefly-macos-arm64.tar.gz": "a4238a2a1585007b2774bda4d61dc34d450e071ecaf7d402c5afd85c11e20c39", + "pyrefly-macos-x86_64.tar.gz": "2d9f70e83794fad2d727a530c6e280dc4679401e814dc2b38ae73b85d085f85b", + "pyrefly-windows-arm64.zip": "0e83a61483eb8740cd99d96ba770c49fff4b8c1ed523dbbc18b6b8ee43b4c1bb", + "pyrefly-windows-x86_64.zip": "fd65c5e0d08144ce6860ae5396b69445e6d9775064103db33222ecec5b5cea38", + }, + }, } diff --git a/tests/verify_toolchain_resolution.py b/tests/verify_toolchain_resolution.py index 0bfd826..3c2ec9d 100755 --- a/tests/verify_toolchain_resolution.py +++ b/tests/verify_toolchain_resolution.py @@ -29,7 +29,7 @@ def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser() parser.add_argument( "--pyrefly-version", - default=os.environ.get("PYREFLY_VERSION", "1.2.0"), + default=os.environ.get("PYREFLY_VERSION", "1.5.1"), ) parser.add_argument( "--output-group",