From 38a3b056e39a89af9c569c10a6382c5331f1daf2 Mon Sep 17 00:00:00 2001 From: David Peter Date: Tue, 22 Apr 2025 11:55:16 +0200 Subject: [PATCH] [red-knot] mypy_primer: Use upstream repo (#17500) ## Summary Switch to the official version of [`mypy_primer`](https://github.com/hauntsaninja/mypy_primer), now that Red Knot support has been upstreamed (see https://github.com/hauntsaninja/mypy_primer/pull/138, https://github.com/hauntsaninja/mypy_primer/pull/135, https://github.com/hauntsaninja/mypy_primer/pull/151, https://github.com/hauntsaninja/mypy_primer/pull/155). ## Test Plan Locally and in CI --- .github/workflows/mypy_primer.yaml | 2 +- crates/red_knot/docs/mypy_primer.md | 9 ++++----- .../red_knot_python_semantic/resources/primer/good.txt | 2 -- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/mypy_primer.yaml b/.github/workflows/mypy_primer.yaml index ac0dc7a2a1..7ceb1d9f2d 100644 --- a/.github/workflows/mypy_primer.yaml +++ b/.github/workflows/mypy_primer.yaml @@ -45,7 +45,7 @@ jobs: - name: Install mypy_primer run: | - uv tool install "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support-v6" + uv tool install "git+https://github.com/hauntsaninja/mypy_primer@ebaa9fd27b51a278873b63676fd25490cec6823b" - name: Run mypy_primer shell: bash diff --git a/crates/red_knot/docs/mypy_primer.md b/crates/red_knot/docs/mypy_primer.md index c4d73add14..bcf288265e 100644 --- a/crates/red_knot/docs/mypy_primer.md +++ b/crates/red_knot/docs/mypy_primer.md @@ -2,16 +2,16 @@ ## Basics -For now, we use our own [fork of mypy primer]. It can be run using `uvx --from "…" mypy_primer`. For example, to see the help message, run: +`mypy_primer` can be run using `uvx --from "…" mypy_primer`. For example, to see the help message, run: ```sh -uvx --from "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" mypy_primer -h +uvx --from "git+https://github.com/hauntsaninja/mypy_primer" mypy_primer -h ``` Alternatively, you can install the forked version of `mypy_primer` using: ```sh -uv tool install "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" +uv tool install "git+https://github.com/hauntsaninja/mypy_primer" ``` and then run it using `uvx mypy_primer` or just `mypy_primer`, if your `PATH` is set up accordingly (see: [Tool executables]). @@ -56,6 +56,5 @@ mypy_primer --repo /path/to/ruff --old origin/main --new my/local-branch … Note that you might need to clean up `/tmp/mypy_primer` in order for this to work correctly. -[fork of mypy primer]: https://github.com/astral-sh/mypy_primer/tree/add-red-knot-support -[full list of ecosystem projects]: https://github.com/astral-sh/mypy_primer/blob/add-red-knot-support/mypy_primer/projects.py +[full list of ecosystem projects]: https://github.com/hauntsaninja/mypy_primer/blob/master/mypy_primer/projects.py [tool executables]: https://docs.astral.sh/uv/concepts/tools/#tool-executables diff --git a/crates/red_knot_python_semantic/resources/primer/good.txt b/crates/red_knot_python_semantic/resources/primer/good.txt index 3dca5c49f9..d813eccdd0 100644 --- a/crates/red_knot_python_semantic/resources/primer/good.txt +++ b/crates/red_knot_python_semantic/resources/primer/good.txt @@ -1,4 +1,3 @@ -arrow async-utils bidict black @@ -18,7 +17,6 @@ python-chess python-htmlgen rich scrapy -strawberry typeshed-stats werkzeug zipp