-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Update getting_started.rst to add uv #18983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence also implicitly says "we do support
Suggested change
Here's how ruff explains its installation (note that they have to mention uv as that's another tool from Astral.sh, good for marketing, "recommended" is there for the same reason): https://docs.astral.sh/ruff/installation/ |
||||||
|
||||||
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 whether 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 | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this is a bit unfair. There is
poetry
, there ispdm
, there ispipx
- are we going to enumerate all package managers here?pip
is the "default" one, so mentioningpip
is reasonable. Everything else is user's homework IMO: "how to run a tool using your package manager?" I'm not a maintainer here, so please don't treat the comment above as a binding disapproval, let's wait for someone from the core team to comment.