diff --git a/.github/problem-matchers/README.md b/.github/problem-matchers/README.md index 6ef475f64..a9eab0358 100644 --- a/.github/problem-matchers/README.md +++ b/.github/problem-matchers/README.md @@ -20,13 +20,12 @@ license. The version of the files at the time they were copied was 2025.1.2. - [`pylint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/pylint.json) - [`yamllint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/yamllint.json) -The Mypy and Pytest problem matchers files originally came from the +The Pytest problem matcher file originally came from the [gh-problem-matcher-wrap](https://github.com/liskin/gh-problem-matcher-wrap/tree/master/problem-matchers) -repository (copied 2025-03-04, version 3.0.0), and were subsequently modified by -Michael Hucka. The original JSON files are Copyright © 2020 Tomáš Janoušek and +repository (copied 2025-03-04, version 3.0.0), and was subsequently modified by +Michael Hucka. The original JSON file is Copyright © 2020 Tomáš Janoušek and made available under the terms of the MIT license. -- [`mypy.json`](https://github.com/liskin/gh-problem-matcher-wrap/blob/master/problem-matchers/mypy.json) - [`pytest.json`](https://github.com/liskin/gh-problem-matcher-wrap/blob/master/problem-matchers/pytest.json) The actionlint problem matcher JSON file came from the diff --git a/.github/problem-matchers/mypy.json b/.github/problem-matchers/mypy.json deleted file mode 100644 index 027169219..000000000 --- a/.github/problem-matchers/mypy.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "mypy", - "severity": "error", - "pattern": [ - { - "regexp": "^([^:]*):(\\d+):(?:(\\d+):)?\\s(error|warning): (.*?)(?: \\[(\\S+)\\])?$", - "file": 1, - "line": 2, - "column": 3, - "severity": 4, - "message": 5, - "code": 6 - } - ] - } - ] -} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9de1a40bd..9fa0612a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,7 +46,7 @@ env: # This is used by setup-python to check whether its cache needs updating. python-dep-files: >- dev_tools/requirements/envs/format.env.txt - dev_tools/requirements/envs/mypy.env.txt + dev_tools/requirements/envs/typecheck.env.txt dev_tools/requirements/envs/pylint.env.txt dev_tools/requirements/envs/pytest-extra.env.txt dev_tools/requirements/envs/pytest.env.txt @@ -56,7 +56,8 @@ concurrency: cancel-in-progress: true group: ${{github.workflow}}-${{github.event.pull_request.number||github.ref}} -permissions: read-all +permissions: + contents: read jobs: python-checks: @@ -83,7 +84,7 @@ jobs: run: | pip install -r dev_tools/requirements/envs/format.env.txt pip install -r dev_tools/requirements/envs/pylint.env.txt - pip install -r dev_tools/requirements/envs/mypy.env.txt + pip install -r dev_tools/requirements/envs/typecheck.env.txt - name: Check format run: | @@ -96,9 +97,7 @@ jobs: check/pylint -j 0 - name: Check type declarations - run: | - echo '::add-matcher::.github/problem-matchers/mypy.json' - check/mypy + run: check/typecheck --output-format github pytest: name: Unit tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7c6cccb6c..1ce53fc92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -170,6 +170,14 @@ repos: files: \.(cc|h|cu|py)$ stages: [pre-push] + - id: typecheck + name: 'check/typecheck runs without errors' + entry: check/typecheck + language: script + pass_filenames: false + types: [python] + stages: [pre-push] + - repo: https://github.com/Pierre-Sassoulas/copyright_notice_precommit rev: 'd9215b6b2a028d1614c92cf43a9fcff3b1dd889e' # frozen: 0.1.2 hooks: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4b603e49..c7456ce30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -234,13 +234,15 @@ for information about how to set up a local copy of the software for development ### Type annotation conventions Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/). We use -[mypy](http://mypy-lang.org/) to check that type annotations are correct, and the following script -to run it: +[Pyrefly](https://pyrefly.org/) to check that type annotations are correct, and the following +script to run it: ```shell -check/mypy +check/typecheck ``` +(`check/mypy` remains as a deprecated wrapper that forwards to `check/typecheck`.) + ### Linting and formatting Code should meet common style standards for Python and be free of error-prone constructs. We use diff --git a/check/all b/check/all index 04946a011..79e053691 100755 --- a/check/all +++ b/check/all @@ -100,7 +100,7 @@ done declare -a errors=() declare -a pylint_j=() declare -a pytest_n=() -declare -a mypy_n=() +declare -a typecheck_j=() function run() { echo "~~~~ Running $* ~~~~" @@ -112,11 +112,11 @@ function run() { cpus=$(python3 -c 'import psutil; print(psutil.cpu_count(logical=False))') if [[ -z "${no_parallel}" ]]; then - # Pylint & pytest can auto-detect the number of CPUs, but not mypy. To be - # consistent, this uses the same explicit number for all of them. + # Pylint & pytest can auto-detect the number of CPUs; pyrefly uses -j. + # To be consistent, this uses the same explicit number for all of them. pylint_j=("-j" "${cpus}") pytest_n=("-n" "${cpus}") - mypy_n=("-n" "${cpus}") + typecheck_j=("-j" "${cpus}") fi if [[ -n "${only_changed}" ]]; then @@ -126,7 +126,7 @@ else run check/format-incremental "${rev[@]}" "${apply_arg[@]}" --all run check/pylint "${pylint_j[@]}" "${rev[@]}" fi -run check/mypy "${mypy_n[@]}" +run check/typecheck "${typecheck_j[@]}" run check/pytest-and-incremental-coverage "${pytest_n[@]}" "${rev[@]}" run check/shellcheck run check/nbformat diff --git a/check/mypy b/check/mypy index c9c72ac9c..0bd52ee21 100755 --- a/check/mypy +++ b/check/mypy @@ -14,19 +14,18 @@ # limitations under the License. ################################################################################ -# Runs mypy on the repository starting from the root. +# Deprecated wrapper that forwards to check/typecheck (Pyrefly). # # Usage: # check/mypy [--flags] ################################################################################ +echo "Warning: 'check/mypy' is deprecated." \ + "Please use 'check/typecheck' instead." >&2 +echo >&2 + # Get the working directory to the repo root. cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" || exit 1 cd "$(git rev-parse --show-toplevel)" || exit 1 -echo -e -n "\033[31m" -mypy "$@" . -result=$? -echo -e -n "\033[0m" - -exit ${result} +exec check/typecheck "$@" diff --git a/check/shellcheck b/check/shellcheck index 85be18a98..a4b3a970b 100755 --- a/check/shellcheck +++ b/check/shellcheck @@ -62,6 +62,7 @@ required_shell_scripts=( check/pylint-changed-files check/pytest check/pytest-and-incremental-coverage + check/typecheck ) scripts_not_found=$(comm -13 \ diff --git a/check/typecheck b/check/typecheck new file mode 100755 index 000000000..a67d042c3 --- /dev/null +++ b/check/typecheck @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################################ +# Runs type checking on the repository using Pyrefly. +# +# Usage: +# check/typecheck [--flags] +################################################################################ + +# Get the working directory to the repo root. +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" || exit 1 +cd "$(git rev-parse --show-toplevel)" || exit 1 + +# Ensure terminal color is reset even if interrupted. +trap 'echo -e -n "\033[0m"' EXIT + +echo -e -n "\033[31m" +pyrefly check "$@" +result=$? +exit ${result} diff --git a/dev_tools/requirements/create-env-files.sh b/dev_tools/requirements/create-env-files.sh index 2cdf4aa02..688ecff69 100755 --- a/dev_tools/requirements/create-env-files.sh +++ b/dev_tools/requirements/create-env-files.sh @@ -48,13 +48,13 @@ mkdir -p dev_tools/requirements/envs dev_tools/requirements/max_compat uv pip compile "$@" \ -o dev_tools/requirements/envs/dev.env.txt \ dev_tools/requirements/deps/format.txt \ - dev_tools/requirements/deps/mypy.txt \ dev_tools/requirements/deps/packaging.txt \ dev_tools/requirements/deps/pylint.txt \ dev_tools/requirements/deps/pytest.txt \ dev_tools/requirements/deps/resource_estimates_runtime.txt \ dev_tools/requirements/deps/runtime.txt \ - dev_tools/requirements/deps/shellcheck.txt + dev_tools/requirements/deps/shellcheck.txt \ + dev_tools/requirements/deps/typecheck.txt uv pip compile "$@" \ -o dev_tools/requirements/envs/format.env.txt \ @@ -82,9 +82,9 @@ uv pip compile "$@" \ dev_tools/requirements/deps/runtime.txt uv pip compile "$@" \ - -o dev_tools/requirements/envs/mypy.env.txt \ + -o dev_tools/requirements/envs/typecheck.env.txt \ -c dev_tools/requirements/envs/dev.env.txt \ - dev_tools/requirements/deps/mypy.txt \ + dev_tools/requirements/deps/typecheck.txt \ dev_tools/requirements/deps/runtime.txt uv pip compile "$@" \ diff --git a/dev_tools/requirements/deps/mypy.txt b/dev_tools/requirements/deps/mypy.txt deleted file mode 100644 index 36826aaae..000000000 --- a/dev_tools/requirements/deps/mypy.txt +++ /dev/null @@ -1,6 +0,0 @@ -mypy - -pandas-stubs -types-requests -types-setuptools -types-networkx diff --git a/dev_tools/requirements/deps/typecheck.txt b/dev_tools/requirements/deps/typecheck.txt new file mode 100644 index 000000000..ff3c068c9 --- /dev/null +++ b/dev_tools/requirements/deps/typecheck.txt @@ -0,0 +1,3 @@ +pyrefly + +types-networkx diff --git a/dev_tools/requirements/envs/dev.env.txt b/dev_tools/requirements/envs/dev.env.txt index a28c00833..48d32be2d 100644 --- a/dev_tools/requirements/envs/dev.env.txt +++ b/dev_tools/requirements/envs/dev.env.txt @@ -42,7 +42,6 @@ ast-serialize==0.5.0 \ --hash=sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9 \ --hash=sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf \ --hash=sha256:f8015cd071ac1339924ee2b8098c93e00e155f30a16f40ec9816fcf84f4753f6 - # via mypy astor==0.8.1 \ --hash=sha256:070a54e890cefb5b3739d19f30f5a5ec840ffc9c50ffa7d23cc9fc1a38ebbfc5 \ --hash=sha256:6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e @@ -1001,7 +1000,6 @@ librt==0.11.0 ; platform_python_implementation != 'PyPy' \ --hash=sha256:f9743fc99135d5f78d2454435615f6dec0473ca507c26ce9d92b10b562a280d3 \ --hash=sha256:fa475675db22290c3158e1d42326d0f5a65f04f44a0e68c3630a25b53560fb9c \ --hash=sha256:ff0fbaf5f44a21beeb0110f2ab64f45135a9536a834b79c0d1ef018f2786bbfa - # via mypy markdown-it-py==4.2.0 \ --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a @@ -1217,58 +1215,6 @@ mpmath==1.3.0 \ --hash=sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f \ --hash=sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c # via sympy -mypy==2.1.0 \ - --hash=sha256:022c771234936ceac541ebaf836fe9e2abeb3f5e09aff21588fe543ff006fe21 \ - --hash=sha256:0b1a5260c95aa443083f9ed3592662941951bca3d4ca224a5dc517c38b7cf666 \ - --hash=sha256:11a6beb180257a805961aea9ec591bbd0bd17f1e18d35b8456d57aee5bedfedc \ - --hash=sha256:1a293c534adb55271fef24a26da04b855540a8c13cc07bc5917b9fd2c394f2ca \ - --hash=sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22 \ - --hash=sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af \ - --hash=sha256:35aac3bb114e03888f535d5eb51b8bafbb3266586b599da1940f9b1be3ec5bd5 \ - --hash=sha256:3712c20deed54e814eaaa825603bada8ea1c390670a397c95b98405347acc563 \ - --hash=sha256:47cebf61abde7c088a4e27718a8b13a81655686b2e9c251f5c0915a802248166 \ - --hash=sha256:498207db725cec88829a6a5c2fc771205fd043719ef98bc49aba8fb9fc4e6d57 \ - --hash=sha256:49890d4f76ac9e06ec117f9e09f3174da70a620a0c300953d8595c926e80947f \ - --hash=sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6 \ - --hash=sha256:4f910fe825376a7b66ef7ca8c98e5a149e8cd64c19ae71d84047a74ee060d4e6 \ - --hash=sha256:5431d42af987ebd92ba2f71d45c85ed41d8e6ca9f5fd209a69f68f707d2469e5 \ - --hash=sha256:5fdf2941a07434af755837d9880f7d7d25f1dacb1af9dcd4b9b66f2220a3024e \ - --hash=sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b \ - --hash=sha256:7354c5a7f69d9345c3d6e69921d57088eea3ddeeb6b20d34c1b3855b02c36ec2 \ - --hash=sha256:7406f4d048e71e576f5356d317e5b0a9e666dfd966bd99f9d14ca06e1a341538 \ - --hash=sha256:761be68e023ef5d94678772396a8af1220030f80837a3afd8d0aef3b419666f4 \ - --hash=sha256:767fe8c66dc3e01e19e1737d4c38ebefead16125e1b8e58ad421903b376f5c65 \ - --hash=sha256:7d5e5cad0efeba72b93cd17490cc0d69c5ac9ca132994fe3fb0314808aeeb83e \ - --hash=sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633 \ - --hash=sha256:82208da9e09414d520e912d3e462d454854bed0810b71540bb016dcbca7308fd \ - --hash=sha256:8de55a8c861f2a49331f807be98d90caeceeef520bde13d43a160207f8af613e \ - --hash=sha256:8ef78c1d306bbf9a8a12f526c44902c9c28dffd6c52c52bf6a72641ce18d3849 \ - --hash=sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8 \ - --hash=sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289 \ - --hash=sha256:a683016b16fe2f572dc04c72be7ee0504ac1605a265d0200f5cea695fb788f41 \ - --hash=sha256:aea7f7a8a55b459c34275fc468ada6ca7c173a5e43a68f5dbe588a563d8a06b8 \ - --hash=sha256:b33b6cd332695bba180d55e717a79d3038e479a2c49cc5eb3d53603409b9a5d7 \ - --hash=sha256:b84802e7b5a6daf1f5e15bc9fcd7ddae77be13981ffab037f1c67bb84d67d135 \ - --hash=sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b \ - --hash=sha256:c209a90853081ff01d01ee895cafe10f7db1474e0d95beaeef0f6c1db9119bbd \ - --hash=sha256:c90345fc182dc363b891350457ec69c35140858538f38b4540845afcc32b1aef \ - --hash=sha256:c989640253f0d76843e9c6c1bbf4bd48c5e85ada61bde4beb37cb3eca035685e \ - --hash=sha256:d57a90ae5e872138a425ec328edbc9b235d1934c4377881a33ec05b341acc9a8 \ - --hash=sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211 \ - --hash=sha256:e0210d626fc8b31ccc90233754c7bc90e1f43205e85d96387f7db1285b55c398 \ - --hash=sha256:e195b817c13f02352a9c124301f9f30f078405444679b6753c1b96b6eed37285 \ - --hash=sha256:e583edc957cfb0deb142079162ae826f58449b116c1d442f2d91c69d9fced081 \ - --hash=sha256:e79ebc1b904b84f0310dff7469655a9c36c7a68bddb37bdd42b67a332df61d08 \ - --hash=sha256:ecfe70d43775ab99562ab128ce49854a362044c9f894961f68f898c23cb7429d \ - --hash=sha256:fcaa0e479066e31f7cceb6a3bea39cb22b2ff51a6b2f24f193d19179ba17c389 \ - --hash=sha256:ff715050c127d724fd260a2e666e7747fdd83511c0c47d449d98238970aef780 - # via -r dev_tools/requirements/deps/mypy.txt -mypy-extensions==1.1.0 \ - --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ - --hash=sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558 - # via - # black - # mypy nbformat==5.10.4 \ --hash=sha256:322168b14f937a5d11362988ecac2a4952d3d8e3a2cbeb2319584631226d5b3a \ --hash=sha256:3b48d6c8fbca4b299bf3982ea7db1af21580e4fec269ad087b9e81588891200b @@ -1377,7 +1323,6 @@ numpy==2.2.6 \ # matplotlib # ml-dtypes # pandas - # pandas-stubs # pyscf # scipy # types-networkx @@ -1453,16 +1398,11 @@ pandas==2.3.3 \ --hash=sha256:f086f6fe114e19d92014a1966f43a3e62285109afe874f067f5abbdcbb10e59c \ --hash=sha256:f8bfc0e12dc78f777f323f55c58649591b2cd0c43534e8355c51d3fede5f4dee # via cirq-core -pandas-stubs==2.3.3.260113 \ - --hash=sha256:076e3724bcaa73de78932b012ec64b3010463d377fa63116f4e6850643d93800 \ - --hash=sha256:ec070b5c576e1badf12544ae50385872f0631fc35d99d00dc598c2954ec564d3 - # via -r dev_tools/requirements/deps/mypy.txt pathspec==1.1.1 \ --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189 # via # black - # mypy pillow==12.2.0 \ --hash=sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9 \ --hash=sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5 \ @@ -2097,7 +2037,6 @@ tomli==2.4.1 ; python_full_version <= '3.11' \ # black # build # coverage - # mypy # pylint # pytest tomlkit==0.15.0 \ @@ -2118,22 +2057,24 @@ twine==6.2.0 \ --hash=sha256:418ebf08ccda9a8caaebe414433b0ba5e25eb5e4a927667122fbe8f829f985d8 \ --hash=sha256:e5ed0d2fd70c9959770dce51c8f39c8945c574e18173a7b81802dab51b4b75cf # via -r dev_tools/requirements/deps/packaging.txt -types-networkx==3.6.1.20260518 \ - --hash=sha256:574304deea33828fb32cdca757af84f79b67bd80164aa1725c52a95d4a9347e6 \ - --hash=sha256:af3ab153815b366c3695a0015cc75aece9b3eb0e5df56bb60ffee0b7cec8f630 - # via -r dev_tools/requirements/deps/mypy.txt -types-pytz==2026.2.0.20260518 \ - --hash=sha256:3a12eaa38f476bd650902a9c9bb442f03f3c7dee2be5c5848bce61bd708d205a \ - --hash=sha256:e5d254329e9c4e91f0781b22c43a4bb2d10bb044d97b24c4b05d45567b0eae16 - # via pandas-stubs -types-requests==2.33.0.20260518 \ - --hash=sha256:626d697d1adaaff76e2044dc8c5c051d8f21abc157bdfe204a75558076fe0bf0 \ - --hash=sha256:df7bd3bfe0ca8402dfb841e7d9be714bb5578203283d66d7dc4ef69343449a5e - # via -r dev_tools/requirements/deps/mypy.txt -types-setuptools==82.0.0.20260518 \ - --hash=sha256:31c04a62b57a653a5021caf191be0f10f70df890f813b51f02bab3969d300f20 \ - --hash=sha256:3b743cfe63d0981ea4c15b90710fc1ed41e3464a537d51e705be514e891c1d07 - # via -r dev_tools/requirements/deps/mypy.txt +pyrefly==1.2.0 \ + --hash=sha256:25822ea9505f589ea8a725e4268b475132fb89e038fbf092e446510443ac142a \ + --hash=sha256:368aaf7eee4f511ddc0f8e564cf14e01ab2f10b0db9105c6d5b153bf498d07bf \ + --hash=sha256:3a90bb8df39dfbac74b1f3b2e9d7c526b8f80568884c3944d955023a73ebf61e \ + --hash=sha256:5485f960fc2481617068c918335c39ab1507ef90b6b5bd35bf57726e60e73185 \ + --hash=sha256:5de7b2ad2bba5c8055181681a84b74143eac2234a48ba5d1b7ed7e7a722b02bd \ + --hash=sha256:756f669b5555090f5c1a4fef30db1785fabe657764f7e4e6dc88994dfb8ca82d \ + --hash=sha256:7f46d983ac49ddd2b043694960a01dc6a19a5cfd8eec609d6bd9c42866f91b4e \ + --hash=sha256:8a8964c224ccc4882730130955815de21ff443c1ac3f0b90685b19bf63848170 \ + --hash=sha256:8c90751de8506d938e8f802659c74cf35bd7a0036510ee6c634a38eebb280bfa \ + --hash=sha256:90efe75e17491ef5d636e10469e9278d7d0256b3b4c5e1f4750069bf3ae0f5d1 \ + --hash=sha256:d52d5da7bc65fb7675fbaa80eda879d4f8787c494f04cac21603330d3abbdbbe \ + --hash=sha256:e3465812ce5ef4781fb592edbf2724547296f0a3124be115d73c7e8b2401862d + # via -r dev_tools/requirements/deps/typecheck.txt +types-networkx==3.6.1.20260728 \ + --hash=sha256:0be72ff7625dbdfcd2d76ed7662de96987d0d5433b7055c320065d5b3621f9f6 \ + --hash=sha256:f193e4fc6a41c973c7d687fa3c12f8008d8e7dcd22b0ab62f0300cc47b65eb28 + # via -r dev_tools/requirements/deps/typecheck.txt typing-extensions==4.15.0 \ --hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \ --hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548 @@ -2143,7 +2084,6 @@ typing-extensions==4.15.0 \ # cirq-core # cryptography # exceptiongroup - # mypy # pytest-asyncio # referencing # virtualenv @@ -2158,7 +2098,6 @@ urllib3==2.7.0 \ # id # requests # twine - # types-requests uv==0.11.20 \ --hash=sha256:14026b64ccbe0174e4fcf107f585f5d23f0f5b9f5b3e8b28394fe63fff3e60ff \ --hash=sha256:2d307d47b1a0cf8f76aa69bde850be407bca9482c13cff066142e586a5c57e77 \ diff --git a/dev_tools/requirements/envs/mypy.env.txt b/dev_tools/requirements/envs/typecheck.env.txt similarity index 76% rename from dev_tools/requirements/envs/mypy.env.txt rename to dev_tools/requirements/envs/typecheck.env.txt index cceab8c76..2eb2eb4dd 100644 --- a/dev_tools/requirements/envs/mypy.env.txt +++ b/dev_tools/requirements/envs/typecheck.env.txt @@ -1,42 +1,5 @@ # This file was autogenerated by uv via the following command: # dev_tools/requirements/create-env-files.sh -ast-serialize==0.5.0 \ - --hash=sha256:061ee58bdb52341c8201a6df41182a977736bae3b7ded87ca7176ca25a8a47ab \ - --hash=sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101 \ - --hash=sha256:104e4a35bd7c124173c41760ef9aaea17ddb3f86c65cb643671d59afbe3ee94c \ - --hash=sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a \ - --hash=sha256:16db7c62ec0b8efe1d7afd283a388d8f74f2605d56032e5a37747d2de8dba027 \ - --hash=sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759 \ - --hash=sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d \ - --hash=sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934 \ - --hash=sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43 \ - --hash=sha256:36be371028fc1675acb38a331bde160dbab7ff907fdf00b67eb6911aa106951b \ - --hash=sha256:5499e8797edff2a9186aa313ed382c6b422e798e9332d9953badcee6e69a88f2 \ - --hash=sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6 \ - --hash=sha256:6848f2a093fb5548751a9a09bff8fcd229e2bbeb0e3331f391b6ae6d26cd9903 \ - --hash=sha256:787baedb0262cc49e8ce37cc15c00ae818e46a165a3b36f5e21ed174998104cb \ - --hash=sha256:7d1a2de9de5be04652f0ed60738356ef94f66db37924a9499fffe98dc491aa0b \ - --hash=sha256:832d4c998e0b091fd60a6d6bceee535483c4d490de9ba85003af835225719261 \ - --hash=sha256:842d1c004bb466c7df036f95fabef789570541922b10976b12f5592a69cf0b38 \ - --hash=sha256:8f5c14f169eb0972c0c21bada5358b23d6047c76583b005234f865b11f1fa00a \ - --hash=sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642 \ - --hash=sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211 \ - --hash=sha256:b0c06d760909b095cc466356dfccd05a1c7233a6ca191c020dca2c6a6f16c24c \ - --hash=sha256:b15219e9cdc9f53f6f4cb51c009203507228226148c05c5e8fe451c28b435eb3 \ - --hash=sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809 \ - --hash=sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee \ - --hash=sha256:baf5eb061eb5bccade4128ad42da33787d72f6013809cd1b590376ece8b3c937 \ - --hash=sha256:be5173fb66f9b49026d9d5a2ff0fc7c7009077107c0eb285b2d60fdf1fe10bd1 \ - --hash=sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a \ - --hash=sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27 \ - --hash=sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590 \ - --hash=sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887 \ - --hash=sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9 \ - --hash=sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf \ - --hash=sha256:f8015cd071ac1339924ee2b8098c93e00e155f30a16f40ec9816fcf84f4753f6 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # mypy attrs==26.1.0 \ --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 @@ -182,12 +145,7 @@ charset-normalizer==3.4.7 \ # via # -c dev_tools/requirements/envs/dev.env.txt # requests -cirq-core==1.5.0 ; python_full_version < '3.11' \ - --hash=sha256:104a574c766011c979e897f0fb5e90eb69a2b58ec1dc389a73495e63124923d0 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/runtime.txt -cirq-core==1.6.1 ; python_full_version >= '3.11' \ +cirq-core==1.6.1 \ --hash=sha256:fbc809d7c6a228762ad92bb7870dc16f55b76728fcc7ef4c7aaceb7e5c63e8e6 # via # -c dev_tools/requirements/envs/dev.env.txt @@ -510,100 +468,6 @@ kiwisolver==1.5.0 \ # via # -c dev_tools/requirements/envs/dev.env.txt # matplotlib -librt==0.11.0 ; platform_python_implementation != 'PyPy' \ - --hash=sha256:05fb8fb2ab90e21c8d12ea240d744ad514da9baf381ebfa70d91d20d21713175 \ - --hash=sha256:070aa8c26c0a74774317a72df8851facc7f0f012a5b406557ac56992d92e1ec8 \ - --hash=sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1 \ - --hash=sha256:0827efe7854718f04aaddf6496e96960a956e676fe1d0f04eb41511fd8ad06d5 \ - --hash=sha256:0add982e0e7b9fc14cf4b33789d5f13f66581889b88c2f58099f6ce8f92617bd \ - --hash=sha256:0cad8a4d6a8ff03c9b76f9414caccd78e7cfbc8a2e12fa334d8e1d9932753783 \ - --hash=sha256:0d1029d7e1ae1a7e647ed6fb5df8c4ce2dffefb7a9f5fd1376a4554d96dac09f \ - --hash=sha256:0dc56b1f8d06e60db362cc3fdae206681817f86ce4725d34511473487f12a34b \ - --hash=sha256:0ef69ac715f3cd8e5cd252cb2aebfa72c015492aacc339d5d7bf8fef3c62c677 \ - --hash=sha256:11bd19822431cc21af9f27374e7ae2e58103c7d98bda823536a6c47f6bb2bb3d \ - --hash=sha256:137e79445c896a0ea7b265f52d23954e05b64222ee1af69e2cb34219067cbb67 \ - --hash=sha256:140695816ddf3c86eb972981a26f35efd871c44b0c3aed44c8cd01749386617f \ - --hash=sha256:22bdf239b219d3993761a148ffa134b19e52e9989c84f845d5d7b71d70a17412 \ - --hash=sha256:258d73a0aa66a055e65b2e4d1b8cdb23b9d132c5bb915d9547d804fcaed116cc \ - --hash=sha256:28edb433edde181112a908c78907af28f964eabc15f4dd16c9d66c834302677c \ - --hash=sha256:2b481d846ac894c4e8403c5fd0e87c5d11d6499e404b474602508a224ff531c8 \ - --hash=sha256:2f10cf143e4a9bb0f4f5af568a00df94a2d69ef41c2579584454bb0fe5cc642c \ - --hash=sha256:32bcc918c0148eb7e3d57385125bac7e5f9e4359d05f07448b09f6f778c2f31c \ - --hash=sha256:40071fc5fe0ce8daa6de616702314a01e1250711682b0523d6ab8d4525910cb3 \ - --hash=sha256:41dc19fe150b69716c8ece4f76773a9e8813fe3e35e032a58b4d46423fb8d7c0 \ - --hash=sha256:461bbceede621f1ffb8839755f8663e886087ee7af16294cab7fb4d782c62eeb \ - --hash=sha256:46c60b61e308eb535fbd6fa622b1ee1bb2815691c1ad9c98bf7b84952ec3bc8d \ - --hash=sha256:4a017a95e5837dc15a8c5661d60e05daa96b90908b1aa6b7acdf443cd25c8ebd \ - --hash=sha256:4a9a237d13addb93715b6fee74023d5ee3469b53fce527626c0e088aa585805f \ - --hash=sha256:4ce1f21fbe589bc1afd7872dece84fb0e1144f794a288e58a10d2c54a55c43be \ - --hash=sha256:4e8bd98ea9c47ae90b319a087ab28dac493f1ffbc1ecd1f28fcdbf3b7e1108d1 \ - --hash=sha256:4ee278c769a713638cdacd4c0436d72156e75df3ebc0166ab2b9dc43acc386c9 \ - --hash=sha256:557183ddc36babe46b27dd60facbd5adb4492181a5be887587d57cda6e092f21 \ - --hash=sha256:5ba067f4aadae8fda802d91d2124c90c42195ff32d9161d3549e6d05cfe26f96 \ - --hash=sha256:5d63c855d86938d9de93e265c9bd8c705b51ec494de5738340ee93767a686e4b \ - --hash=sha256:5ddd17bd87b2c56ddd60e546a7984a2e64c4e8eab92fb4cf3830a48ad5469d51 \ - --hash=sha256:621db29691044bdeda22e789e482e1b0f3a985d90e3426c9c6d17606416205ea \ - --hash=sha256:624a40c4a4ad7773315c287276cd024509b2c66ff5904f504bfc08d2c70293ab \ - --hash=sha256:65ac3bc20f78aa0ee5ae84baa68917f89fef4af63e941084dd019a0d0e749f0c \ - --hash=sha256:6bd72d903911d995ab666dbd1871f8b1e80925a699af8063fbf50053329fb05f \ - --hash=sha256:6bf14feb84b05ae945277395451998c89c54d0def4070eb5c08de544930b245a \ - --hash=sha256:6e94ebfcfa2d5e9926d6c3b9aa4617ffc42a845b4321fb84021b872358c82a0f \ - --hash=sha256:75672f0bc524ede266287d532d7923dbce94c7514ad07627bac3d0c6d92cc4d9 \ - --hash=sha256:7753e57d6e12d019c0d8786f1c09c709f4c3fcc57c3887b24e36e6c06ec938b7 \ - --hash=sha256:78dc31f7fdfe9c9d0eb0e8f42d139db230e826415bbcabd9f0e9faaaee909894 \ - --hash=sha256:78fddc31cd4d3caa897ad5d31f856b1faadc9474021ad6cb182b9018793e254e \ - --hash=sha256:7a80a71e1fda83cc752a9141e87aae7fef279538597564d670e9ce513f286192 \ - --hash=sha256:7aef3cf1d5af86e770ab04bfd993dfc4ae8b8c17f66fb77dd4a7d50de7bbb1a3 \ - --hash=sha256:7c39513d8b7477a2e1ed8c43fc21c524e8d5a0f8d4e8b7b074dbdbe7820a08e2 \ - --hash=sha256:7da327dacd7be8f8ec36547373550744a3cc0e536d54665cd83f8bcd961200e8 \ - --hash=sha256:7e82e642ab0f7608ce2fe53d76ca2280a9ee33a1b06556142c7c6fe80a86fc33 \ - --hash=sha256:83d3e1f72bd42f6c5c0b7daec530c3f829bd02db42c70b8ddf0c2d90a2459930 \ - --hash=sha256:84308fc49423ce6475d1c5d1985cd69a8ca9f0325fc7d5f81bb690a3f3625d4e \ - --hash=sha256:88145c15c67731d54283d135b03244028c750cc9edc334a96a4f5950ebdb2884 \ - --hash=sha256:8ca8aa88751a775870b764e93bad5135385f563cb8dcee399abf034ea4d3cb47 \ - --hash=sha256:902e546ff044f579ff1c953ff5fce97b636fe9e3943996b2177710c6ef076f73 \ - --hash=sha256:92f7ff819c197fc30473190a12c2856f325ac90aabfccbeb2072d28cc2e234e3 \ - --hash=sha256:936c5995f3514a42111f20099397d8177c79b4d7e70961e396c6f5a0a3566766 \ - --hash=sha256:93d95bd45b7d58343d8b90d904450a545144eec19a002511163426f8ab1fae29 \ - --hash=sha256:94663a21534637f0e787ec2a2a756022df6e5b7b2335a5cdd7d8e33d68a2af89 \ - --hash=sha256:96f044bb325fd9cf1a723015638c219e9143f0dfbc0ca54c565df2b7fc748b44 \ - --hash=sha256:970b09f7044ea2b64c9da42fd3d335666518cfd1c6e8a182c95da73d0214b41e \ - --hash=sha256:993f028be9e96a08d31df3479ac80d99be374d17f3b78e4796b3fd3c913d4e89 \ - --hash=sha256:9bc0ca6ad9381cbe8e4aa6e5726e4c80c78115a6e9723c599ed1d73e092bc49d \ - --hash=sha256:9c028a9442a18e266955d364ce42259136e79a7ba14d773e0d778d5f70cd56f1 \ - --hash=sha256:9d36a51b3d93320b686588e27123f4995804dbf1bce81df78c02fc3c6eea9280 \ - --hash=sha256:9f1692105a02bcf853f355032a5fdc5494358ef83d8fd22d16de375c85cec3f5 \ - --hash=sha256:a9010e2ed5b3a9e158c5fd966b3ab7e834bb3d3aacc8f66c91dd4b57a3799230 \ - --hash=sha256:aa0dd688aab3f7914d3e6e5e3554978e0383312fb8e771d84be008a35b9ee548 \ - --hash=sha256:ab73e8db5e3f564d812c1f5c3a175930a5f9bc96ccb5e3b22a34d7858b401cf7 \ - --hash=sha256:ae627397a2f351560440d872d6f7c8dbb4072e57868e7b2fc5b8b430fe489d45 \ - --hash=sha256:aea3caa317752e3a466fa8af45d91ee0ea8c7fdd96e42b0a8dd9b76a7931eba1 \ - --hash=sha256:b1ecbd9819deccc39b7542bf4d2a740d8a620694d39989e58661d3763458f8d4 \ - --hash=sha256:b87504f1690a23b9a2cca841191a04f83895d4fc2dd04df91d82b1a04ca2ad46 \ - --hash=sha256:bc3ce6b33c5828d9e80592011a5c584cb2ce86edbc4088405f70da47dc1d1b3b \ - --hash=sha256:bd43992b4473d42f12ff9e68326079f0696d9d4e6000e8f39a0238d482ba6ee2 \ - --hash=sha256:c1f708d8ae9c56cf38a903c44297243d2ec83fd82b396b977e0144a3e76217e3 \ - --hash=sha256:cae74872be221df4374d10fec61f93ed1513b9546ea84f2c0bf73ab3e9bd0b03 \ - --hash=sha256:cca6644054e78746d8d4ef238681f9c34ff8b584fe6b988ecebb8db3b15e622a \ - --hash=sha256:d00f3ac06a2a8b246327f11e186a53a100a4d5c7ed52346367e5ec751d51586c \ - --hash=sha256:d1b36540d7aaf9b9101b3a6f376c8d8e9f7a9aec93ed05918f2c69d493ffef72 \ - --hash=sha256:d2277a05f6dcb9fd13db9566aac4fabd68c3ea1ea46ee5567d4eef8efa495a2f \ - --hash=sha256:d5b0eea49f5562861ee8d757a32ef7d559c1d35be2aaaa1ec28941d74c9ffc8a \ - --hash=sha256:dc329359321b67d24efdf4bc69012b0597001649544db662c001db5a0184794c \ - --hash=sha256:de3bf945454d032f9e390b85c4072e0a0570bf825421c8be0e71209fa65e1abe \ - --hash=sha256:dec7db73758c2b54953fd8b7fe348c45188fe26b39ee18446196edd08453a5d4 \ - --hash=sha256:dee008f20b542e3cd162ba338a7f9ec0f6d23d395f66fe8aeeec3c9d067ea253 \ - --hash=sha256:efbb343ab2ce3540f4ecbe6315d677ed70f37cd9a72b1e58066c918ca83acbaa \ - --hash=sha256:f230cb1cbc9faaa616f9a678f530ebcf186e414b6bcbd88b960e4ba1b92428d5 \ - --hash=sha256:f37aa505b3cf60701562eddb32df74b12a9e380c207fd8b06dd157a943ac7ea0 \ - --hash=sha256:f5fb36b8c6c63fdcbb1d526d94c0d1331610d43f4118cc1beb4efef4f3faacb2 \ - --hash=sha256:f8e3e8056dd674e279741485e2e512d6e9a751c7455809d0114e6ebf8d781085 \ - --hash=sha256:f9743fc99135d5f78d2454435615f6dec0473ca507c26ce9d92b10b562a280d3 \ - --hash=sha256:fa475675db22290c3158e1d42326d0f5a65f04f44a0e68c3630a25b53560fb9c \ - --hash=sha256:ff0fbaf5f44a21beeb0110f2ab64f45135a9536a834b79c0d1ef018f2786bbfa - # via - # -c dev_tools/requirements/envs/dev.env.txt - # mypy matplotlib==3.10.9 \ --hash=sha256:09218df8a93712bd6ea133e83a153c755448cf7868316c531cffcc43f69d1cc9 \ --hash=sha256:10cc5ce06d10231c36f40e875f3c7e8050362a4ee8f0ee5d29a6b3277d57bb42 \ @@ -669,60 +533,6 @@ mpmath==1.3.0 \ # via # -c dev_tools/requirements/envs/dev.env.txt # sympy -mypy==2.1.0 \ - --hash=sha256:022c771234936ceac541ebaf836fe9e2abeb3f5e09aff21588fe543ff006fe21 \ - --hash=sha256:0b1a5260c95aa443083f9ed3592662941951bca3d4ca224a5dc517c38b7cf666 \ - --hash=sha256:11a6beb180257a805961aea9ec591bbd0bd17f1e18d35b8456d57aee5bedfedc \ - --hash=sha256:1a293c534adb55271fef24a26da04b855540a8c13cc07bc5917b9fd2c394f2ca \ - --hash=sha256:20509760fd791c51579d573153407d226385ec1f8bcce55d730b354f3336bc22 \ - --hash=sha256:244358bf1c0da7722230bce60683d52e8e9fd030554926f15b747a84efb5b3af \ - --hash=sha256:35aac3bb114e03888f535d5eb51b8bafbb3266586b599da1940f9b1be3ec5bd5 \ - --hash=sha256:3712c20deed54e814eaaa825603bada8ea1c390670a397c95b98405347acc563 \ - --hash=sha256:47cebf61abde7c088a4e27718a8b13a81655686b2e9c251f5c0915a802248166 \ - --hash=sha256:498207db725cec88829a6a5c2fc771205fd043719ef98bc49aba8fb9fc4e6d57 \ - --hash=sha256:49890d4f76ac9e06ec117f9e09f3174da70a620a0c300953d8595c926e80947f \ - --hash=sha256:4ec7c57657493c7a75534df2751c8ae2cda383c16ecc55d2106c54476b1b16f6 \ - --hash=sha256:4f910fe825376a7b66ef7ca8c98e5a149e8cd64c19ae71d84047a74ee060d4e6 \ - --hash=sha256:5431d42af987ebd92ba2f71d45c85ed41d8e6ca9f5fd209a69f68f707d2469e5 \ - --hash=sha256:5fdf2941a07434af755837d9880f7d7d25f1dacb1af9dcd4b9b66f2220a3024e \ - --hash=sha256:6753d0c1fdd6b1a23b9e4f283ce80b2153b724adcb2653b20b85a8a28ac6436b \ - --hash=sha256:7354c5a7f69d9345c3d6e69921d57088eea3ddeeb6b20d34c1b3855b02c36ec2 \ - --hash=sha256:7406f4d048e71e576f5356d317e5b0a9e666dfd966bd99f9d14ca06e1a341538 \ - --hash=sha256:761be68e023ef5d94678772396a8af1220030f80837a3afd8d0aef3b419666f4 \ - --hash=sha256:767fe8c66dc3e01e19e1737d4c38ebefead16125e1b8e58ad421903b376f5c65 \ - --hash=sha256:7d5e5cad0efeba72b93cd17490cc0d69c5ac9ca132994fe3fb0314808aeeb83e \ - --hash=sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633 \ - --hash=sha256:82208da9e09414d520e912d3e462d454854bed0810b71540bb016dcbca7308fd \ - --hash=sha256:8de55a8c861f2a49331f807be98d90caeceeef520bde13d43a160207f8af613e \ - --hash=sha256:8ef78c1d306bbf9a8a12f526c44902c9c28dffd6c52c52bf6a72641ce18d3849 \ - --hash=sha256:98ebb6589bb3b6d0c6f0c459d53ca55b8091fbc13d277c4041c885392e8195e8 \ - --hash=sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289 \ - --hash=sha256:a683016b16fe2f572dc04c72be7ee0504ac1605a265d0200f5cea695fb788f41 \ - --hash=sha256:aea7f7a8a55b459c34275fc468ada6ca7c173a5e43a68f5dbe588a563d8a06b8 \ - --hash=sha256:b33b6cd332695bba180d55e717a79d3038e479a2c49cc5eb3d53603409b9a5d7 \ - --hash=sha256:b84802e7b5a6daf1f5e15bc9fcd7ddae77be13981ffab037f1c67bb84d67d135 \ - --hash=sha256:bf03e12003084a67395184d3eb8cbd6a489dc3655b5664b28c210a9e2403ab0b \ - --hash=sha256:c209a90853081ff01d01ee895cafe10f7db1474e0d95beaeef0f6c1db9119bbd \ - --hash=sha256:c90345fc182dc363b891350457ec69c35140858538f38b4540845afcc32b1aef \ - --hash=sha256:c989640253f0d76843e9c6c1bbf4bd48c5e85ada61bde4beb37cb3eca035685e \ - --hash=sha256:d57a90ae5e872138a425ec328edbc9b235d1934c4377881a33ec05b341acc9a8 \ - --hash=sha256:d8161b6ff4392410023224f0969d17db93e1e154bc3e4ba62598e720723ae211 \ - --hash=sha256:e0210d626fc8b31ccc90233754c7bc90e1f43205e85d96387f7db1285b55c398 \ - --hash=sha256:e195b817c13f02352a9c124301f9f30f078405444679b6753c1b96b6eed37285 \ - --hash=sha256:e583edc957cfb0deb142079162ae826f58449b116c1d442f2d91c69d9fced081 \ - --hash=sha256:e79ebc1b904b84f0310dff7469655a9c36c7a68bddb37bdd42b67a332df61d08 \ - --hash=sha256:ecfe70d43775ab99562ab128ce49854a362044c9f894961f68f898c23cb7429d \ - --hash=sha256:fcaa0e479066e31f7cceb6a3bea39cb22b2ff51a6b2f24f193d19179ba17c389 \ - --hash=sha256:ff715050c127d724fd260a2e666e7747fdd83511c0c47d449d98238970aef780 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/mypy.txt -mypy-extensions==1.1.0 \ - --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ - --hash=sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # mypy networkx==3.4.2 \ --hash=sha256:307c3669428c5362aab27c8a1260aa8f47c4e91d3891f48be0141738d8d053e1 \ --hash=sha256:df5d4365b724cf81b8c6a7312509d0c22386097011ad1abe274afd5e9d3bbc5f @@ -794,7 +604,6 @@ numpy==2.2.6 \ # h5py # matplotlib # pandas - # pandas-stubs # scipy # types-networkx packaging==26.2 \ @@ -863,18 +672,6 @@ pandas==2.3.3 \ # via # -c dev_tools/requirements/envs/dev.env.txt # cirq-core -pandas-stubs==2.3.3.260113 \ - --hash=sha256:076e3724bcaa73de78932b012ec64b3010463d377fa63116f4e6850643d93800 \ - --hash=sha256:ec070b5c576e1badf12544ae50385872f0631fc35d99d00dc598c2954ec564d3 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/mypy.txt -pathspec==1.1.1 \ - --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ - --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # mypy pillow==12.2.0 \ --hash=sha256:00a2865911330191c0b818c59103b58a5e697cae67042366970a6b6f1b20b7f9 \ --hash=sha256:01afa7cf67f74f09523699b4e88c73fb55c13346d212a59a2db1f86b0a63e8c5 \ @@ -982,6 +779,22 @@ pyparsing==3.3.2 \ # via # -c dev_tools/requirements/envs/dev.env.txt # matplotlib +pyrefly==1.2.0 \ + --hash=sha256:25822ea9505f589ea8a725e4268b475132fb89e038fbf092e446510443ac142a \ + --hash=sha256:368aaf7eee4f511ddc0f8e564cf14e01ab2f10b0db9105c6d5b153bf498d07bf \ + --hash=sha256:3a90bb8df39dfbac74b1f3b2e9d7c526b8f80568884c3944d955023a73ebf61e \ + --hash=sha256:5485f960fc2481617068c918335c39ab1507ef90b6b5bd35bf57726e60e73185 \ + --hash=sha256:5de7b2ad2bba5c8055181681a84b74143eac2234a48ba5d1b7ed7e7a722b02bd \ + --hash=sha256:756f669b5555090f5c1a4fef30db1785fabe657764f7e4e6dc88994dfb8ca82d \ + --hash=sha256:7f46d983ac49ddd2b043694960a01dc6a19a5cfd8eec609d6bd9c42866f91b4e \ + --hash=sha256:8a8964c224ccc4882730130955815de21ff443c1ac3f0b90685b19bf63848170 \ + --hash=sha256:8c90751de8506d938e8f802659c74cf35bd7a0036510ee6c634a38eebb280bfa \ + --hash=sha256:90efe75e17491ef5d636e10469e9278d7d0256b3b4c5e1f4750069bf3ae0f5d1 \ + --hash=sha256:d52d5da7bc65fb7675fbaa80eda879d4f8787c494f04cac21603330d3abbdbbe \ + --hash=sha256:e3465812ce5ef4781fb592edbf2724547296f0a3124be115d73c7e8b2401862d + # via + # -c dev_tools/requirements/envs/dev.env.txt + # -r dev_tools/requirements/deps/typecheck.txt python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 @@ -1071,94 +884,24 @@ sympy==1.14.0 \ # -c dev_tools/requirements/envs/dev.env.txt # -r dev_tools/requirements/deps/runtime.txt # cirq-core -tomli==2.4.1 ; python_full_version < '3.11' \ - --hash=sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853 \ - --hash=sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe \ - --hash=sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5 \ - --hash=sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d \ - --hash=sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd \ - --hash=sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26 \ - --hash=sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54 \ - --hash=sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6 \ - --hash=sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c \ - --hash=sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a \ - --hash=sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd \ - --hash=sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f \ - --hash=sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5 \ - --hash=sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9 \ - --hash=sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662 \ - --hash=sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9 \ - --hash=sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1 \ - --hash=sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585 \ - --hash=sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e \ - --hash=sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c \ - --hash=sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41 \ - --hash=sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f \ - --hash=sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085 \ - --hash=sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15 \ - --hash=sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7 \ - --hash=sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c \ - --hash=sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36 \ - --hash=sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076 \ - --hash=sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac \ - --hash=sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8 \ - --hash=sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232 \ - --hash=sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece \ - --hash=sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a \ - --hash=sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897 \ - --hash=sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d \ - --hash=sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4 \ - --hash=sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917 \ - --hash=sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396 \ - --hash=sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a \ - --hash=sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc \ - --hash=sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba \ - --hash=sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f \ - --hash=sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257 \ - --hash=sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30 \ - --hash=sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf \ - --hash=sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9 \ - --hash=sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # mypy tqdm==4.67.3 \ --hash=sha256:7d825f03f89244ef73f1d4ce193cb1774a8179fd96f31d7e1dcde62092b960bb \ --hash=sha256:ee1e4c0e59148062281c49d80b25b67771a127c85fc9676d3be5f243206826bf # via # -c dev_tools/requirements/envs/dev.env.txt # cirq-core -types-networkx==3.6.1.20260518 \ - --hash=sha256:574304deea33828fb32cdca757af84f79b67bd80164aa1725c52a95d4a9347e6 \ - --hash=sha256:af3ab153815b366c3695a0015cc75aece9b3eb0e5df56bb60ffee0b7cec8f630 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/mypy.txt -types-pytz==2026.2.0.20260518 \ - --hash=sha256:3a12eaa38f476bd650902a9c9bb442f03f3c7dee2be5c5848bce61bd708d205a \ - --hash=sha256:e5d254329e9c4e91f0781b22c43a4bb2d10bb044d97b24c4b05d45567b0eae16 - # via - # -c dev_tools/requirements/envs/dev.env.txt - # pandas-stubs -types-requests==2.33.0.20260518 \ - --hash=sha256:626d697d1adaaff76e2044dc8c5c051d8f21abc157bdfe204a75558076fe0bf0 \ - --hash=sha256:df7bd3bfe0ca8402dfb841e7d9be714bb5578203283d66d7dc4ef69343449a5e - # via - # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/mypy.txt -types-setuptools==82.0.0.20260518 \ - --hash=sha256:31c04a62b57a653a5021caf191be0f10f70df890f813b51f02bab3969d300f20 \ - --hash=sha256:3b743cfe63d0981ea4c15b90710fc1ed41e3464a537d51e705be514e891c1d07 +types-networkx==3.6.1.20260728 \ + --hash=sha256:0be72ff7625dbdfcd2d76ed7662de96987d0d5433b7055c320065d5b3621f9f6 \ + --hash=sha256:f193e4fc6a41c973c7d687fa3c12f8008d8e7dcd22b0ab62f0300cc47b65eb28 # via # -c dev_tools/requirements/envs/dev.env.txt - # -r dev_tools/requirements/deps/mypy.txt + # -r dev_tools/requirements/deps/typecheck.txt typing-extensions==4.15.0 \ --hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \ --hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548 # via # -c dev_tools/requirements/envs/dev.env.txt # cirq-core - # mypy tzdata==2026.2 \ --hash=sha256:9173fde7d80d9018e02a662e168e5a2d04f87c41ea174b139fbef642eda62d10 \ --hash=sha256:bbe9af844f658da81a5f95019480da3a89415801f6cc966806612cc7169bffe7 @@ -1171,4 +914,3 @@ urllib3==2.7.0 \ # via # -c dev_tools/requirements/envs/dev.env.txt # requests - # types-requests diff --git a/pyproject.toml b/pyproject.toml index 72ba61d15..98a6b8d87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,44 +31,60 @@ filterwarnings = [ "ignore:Skipped assert_qasm_is_consistent_with_unitary because qiskit.*:UserWarning", ] -[tool.mypy] -implicit_optional = true -ignore_errors = false - -[[tool.mypy.overrides]] -module = "__main__" -follow_imports = "silent" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = [ +[tool.pyrefly] +# Migrated from [tool.mypy] via `pyrefly init`. Preset "legacy" disables a few +# Pyrefly-only checks so the first pass stays closer to mypy behavior. +preset = "legacy" +# Match mypy defaults: do not aggressively check unannotated defs / infer returns. +check-unannotated-defs = false +infer-return-types = "never" +# Respect leftover `# type: ignore` / `# mypy: ignore` comments during migration. +permissive-ignores = true +project-includes = ["src"] +project-excludes = [ + "**/docs/**", + "**/*.ipynb", + "**/__pycache__/**", + "**/.venv/**", + "**/venv/**", +] +search-path = ["src"] +# Optional or test-only imports without stubs; mirrors the old [tool.mypy.overrides]. +ignore-missing-imports = [ + "__main__", "_pytest.*", "absl", "apiclient.*", "ase.*", "h5py", + "jax", + "jax.*", "numpy.*", + "pandas", + "pandas.*", "pubchempy", "pybtas", + "pyscf", "pyscf.*", "pytest.*", "scipy.*", + "sympy.*", "tensorflow_docs", + "tensorflow_docs.*", +] +# pyscf (and similar) may be installed in CI via other env files; their +# factory callables (e.g. scf.HF) are not valid annotation forms for Pyrefly. +replace-imports-with-any = [ + "pyscf", + "pyscf.*", ] -follow_imports = "silent" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "sympy.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "tensorflow_docs.*" -ignore_missing_imports = true -[[tool.mypy.overrides]] -module = "deprecation" -follow_untyped_imports = true +# Pyrefly-only checks that currently flag ~15 Cirq/sympy Expr and EigenGate override +# issues mypy did not report on main; re-enable in a follow-up once those are fixed. +[tool.pyrefly.errors] +unsupported-operation = false +invalid-inheritance = false +bad-override = false [tool.uv.pip] universal = true diff --git a/src/openfermion/chem/pubchem.py b/src/openfermion/chem/pubchem.py index ca365c431..fb1573e2c 100644 --- a/src/openfermion/chem/pubchem.py +++ b/src/openfermion/chem/pubchem.py @@ -11,7 +11,7 @@ # limitations under the License. -def geometry_from_pubchem(name: str, structure: str = None): +def geometry_from_pubchem(name: str, structure: str | None = None): """Function to extract geometry using the molecule's name from the PubChem database. The 'structure' argument can be used to specify which structure info to use to extract the geometry. If structure=None, the geometry will @@ -52,6 +52,7 @@ def geometry_from_pubchem(name: str, structure: str = None): ) return None + # pyrefly: ignore[no-matching-overload] pubchempy_geometry = pubchempy_molecule[0].to_dict(properties=['atoms'])['atoms'] geometry = [ (atom['element'], (atom['x'], atom['y'], atom.get('z', 0))) for atom in pubchempy_geometry diff --git a/src/openfermion/circuits/gates/four_qubit_gates.py b/src/openfermion/circuits/gates/four_qubit_gates.py index 429ec77e5..70476682f 100644 --- a/src/openfermion/circuits/gates/four_qubit_gates.py +++ b/src/openfermion/circuits/gates/four_qubit_gates.py @@ -27,7 +27,7 @@ class DoubleExcitationGate(cirq.EigenGate): def __init__( self, *, # Forces keyword args. - exponent: Optional[Union[sympy.Symbol, float]] = None, + exponent: Optional[Union[sympy.Expr, float]] = None, rads: Optional[float] = None, degs: Optional[float] = None, duration: Optional[float] = None, @@ -86,7 +86,7 @@ def _apply_unitary_(self, args: cirq.ApplyUnitaryArgs) -> Optional[np.ndarray]: args.target_tensor, inner_matrix, slices=[a, b], out=args.available_buffer ) - def _with_exponent(self, exponent: Union[sympy.Symbol, float]) -> 'DoubleExcitationGate': + def _with_exponent(self, exponent: Union[sympy.Expr, float]) -> 'DoubleExcitationGate': return DoubleExcitationGate(exponent=exponent) def _decompose_(self, qubits): diff --git a/src/openfermion/circuits/primitives/bogoliubov_transform.py b/src/openfermion/circuits/primitives/bogoliubov_transform.py index c1d298d9a..07a53906a 100644 --- a/src/openfermion/circuits/primitives/bogoliubov_transform.py +++ b/src/openfermion/circuits/primitives/bogoliubov_transform.py @@ -170,7 +170,7 @@ def _is_spin_block_diagonal(matrix) -> bool: return False max_upper_right = numpy.max(numpy.abs(matrix[: n // 2, n // 2 :])) max_lower_left = numpy.max(numpy.abs(matrix[n // 2 :, : n // 2])) - return numpy.isclose(max_upper_right, 0.0) and numpy.isclose(max_lower_left, 0.0) + return bool(numpy.isclose(max_upper_right, 0.0) and numpy.isclose(max_lower_left, 0.0)) def _preserves_parity(transformation_matrix: numpy.ndarray) -> bool: @@ -194,7 +194,7 @@ def _preserves_parity(transformation_matrix: numpy.ndarray) -> bool: w1 = transformation_matrix[:, :n] w2 = transformation_matrix[:, n:] bogoliubov_de_gennes = numpy.block([[w1, w2], [numpy.conjugate(w2), numpy.conjugate(w1)]]) - return numpy.isclose(numpy.linalg.det(bogoliubov_de_gennes), 1.0) + return bool(numpy.isclose(numpy.linalg.det(bogoliubov_de_gennes), 1.0)) def _occupied_orbitals(computational_basis_state: int, n_qubits) -> List[int]: diff --git a/src/openfermion/hamiltonians/jellium.py b/src/openfermion/hamiltonians/jellium.py index a1ad64b72..9aecffca4 100644 --- a/src/openfermion/hamiltonians/jellium.py +++ b/src/openfermion/hamiltonians/jellium.py @@ -138,7 +138,7 @@ def plane_wave_kinetic( def plane_wave_potential( grid: Grid, spinless: bool = False, - e_cutoff: float = None, + e_cutoff: Optional[float] = None, non_periodic: bool = False, period_cutoff: Optional[float] = None, ) -> FermionOperator: @@ -403,7 +403,7 @@ def jellium_model( spinless: bool = False, plane_wave: bool = True, include_constant: bool = False, - e_cutoff: float = None, + e_cutoff: Optional[float] = None, non_periodic: bool = False, period_cutoff: Optional[float] = None, ) -> FermionOperator: diff --git a/src/openfermion/resource_estimates/pbc/sf/sf_integrals.py b/src/openfermion/resource_estimates/pbc/sf/sf_integrals.py index f9d91e242..3daf710c1 100644 --- a/src/openfermion/resource_estimates/pbc/sf/sf_integrals.py +++ b/src/openfermion/resource_estimates/pbc/sf/sf_integrals.py @@ -11,6 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. import itertools +from typing import Optional + import numpy as np import numpy.typing as npt @@ -21,7 +23,7 @@ # Single-Factorization class SingleFactorization: - def __init__(self, cholesky_factor: npt.NDArray, kmf: scf.HF, naux: int = None): + def __init__(self, cholesky_factor: npt.NDArray, kmf: scf.HF, naux: Optional[int] = None): """Class defining single-factorized ERIs. Args: