From 7181f965fc9ccf4c893e54ad8256dbb17153467d Mon Sep 17 00:00:00 2001 From: godalming123 <68993177+godalming123@users.noreply.github.com> Date: Sun, 27 Apr 2025 15:19:36 +0100 Subject: [PATCH 1/2] Update getting_started.rst to add uv --- docs/source/getting_started.rst | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 9b510314fd8fe..bf859849fbab1 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -13,21 +13,46 @@ If you're unfamiliar with the concepts of static and dynamic type checking, be sure to read this chapter carefully, as the rest of the documentation may not make much sense otherwise. -Installing and running mypy -*************************** +Installing mypy +*************** -Mypy requires Python 3.9 or later to run. You can install mypy using pip: +Mypy requires Python 3.9 or later to run, and can be installed through either pip or uv. + +With pip +~~~~~~~~ + +You can install mypy with pip: .. code-block:: shell $ python3 -m pip install mypy -Once mypy is installed, run it by using the ``mypy`` tool: +With uv +~~~~~~~ + +You can also install mypy with uv: + +.. code-block:: shell + + $ uv add mypy + +Running mypy +************ + +Once mypy is installed, run it by using the ``mypy`` tool. The command that you use to run mypy depends on wether you installed it with pip or uv. + +For pip, use: .. code-block:: shell $ mypy program.py +For uv, use: + +.. code-block:: shell + + $ uv run mypy program.py + This command makes mypy *type check* your ``program.py`` file and print out any errors it finds. Mypy will type check your code *statically*: this means that it will check for errors without ever running your code, just From 5db05ab4a0cf94a825d85dc5b88cd705ca4cad67 Mon Sep 17 00:00:00 2001 From: godalming123 <68993177+godalming123@users.noreply.github.com> Date: Sun, 27 Apr 2025 15:25:22 +0100 Subject: [PATCH 2/2] Fix spelling --- docs/source/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index bf859849fbab1..8745cd9d79eae 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -39,7 +39,7 @@ You can also install mypy with uv: Running mypy ************ -Once mypy is installed, run it by using the ``mypy`` tool. The command that you use to run mypy depends on wether you installed it with pip or uv. +Once mypy is installed, run it by using the ``mypy`` tool. The command that you use to run mypy depends on whether you installed it with pip or uv. For pip, use: