pyright
ruff
| pyright | ruff | |
|---|---|---|
| 150 | 138 | |
| 15,043 | 44,521 | |
| 0.7% | 2.4% | |
| 9.4 | 10.0 | |
| 7 days ago | 5 days ago | |
| Python | Rust | |
| GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pyright
- Ty: An fast Python type checker and LSP
- Type hints in Python (1)
is used with the type checkers such as mypy, pyright, pyre-check, pytype, etc.
- PyreFly: Python type checker and language server in Rust
- Ruff and Ready: Linting Before the Party
mypy (and pyright occasionally) as a type checker,
- Pyrefly
They identified this as a bug and fixed it, then changed course and decided to reinstate the behaviour. So if you want to write idiomatic Python, you need to disable typechecking TypedDicts.
— https://github.com/microsoft/pyright/issues/1739
Now if this were a linter then I would understand. But a type checker should not be opinionated to the point of pushing people not to use idiomatic Python.
- Top Tools for Static Analysis Help in Your Python Projects
Pyright:
- Astral – "We're building a new static type checker for Python"
This is a good summary: https://github.com/microsoft/pyright/blob/main/docs/mypy-com...
But without that, I always felt like I was actively fighting mypy. It seemed like it was written for a totally different language than Python.
Compared to another more modern type system like TypeScript, sometimes you don't explicitly type something and yet TypeScript usually does exactly what you expect.
- Ruff: Python linter and code formatter written in Rust
We have it already: https://github.com/microsoft/pyright
- The Language Server Protocol - Building DBChat (Part 5)
Python (pyright)
- Multilspy: Building a common LSP client handtuned for all Language servers
Pyright is billed as a "static type checker" but its a full-blown language server (which pylance is built on). I've used both pylance and pyright and frankly I haven't seen any benefit going up to pylance. Pyright is under the MIT license so it can be used for anything: https://github.com/microsoft/pyright/blob/main/LICENSE.txt
ruff
- Ty: An fast Python type checker and LSP
There was a hang/performance bug [1, 2] that was reported just after the beta release, which we've since fixed [3]. You might try seeing if we get through your entire project now?
(And as an aside, there _is_ a verbose mode: if you add `-vv` you'll get DEBUG-level log messages printing out the name of each file as we start to check it, and you can set TY_MAX_PARALLELISM=1 in your env to make it very clear which file is causing the hang. That's how we debug these kinds of issues when they're reported to us.)
[1] https://github.com/astral-sh/ty/issues/1968
[2] https://github.com/astral-sh/ty/issues/1993
[3] https://github.com/astral-sh/ruff/pull/22030
- Python Linters: A Guide for Clean Code
Ruff Documentation
- My Experience Creating CI Workflows and Contributing Tests to an Existing Project
To begin with, I created a ci.yml file that runs on push and pull request to the main branch. The workflow has two major jobs. The first is the test job, which runs on a matrix of Ubuntu, Windows, and macOS to ensure cross-platform reliability. It checks out the repository, sets up Python 3.12 with pip caching, installs all necessary dependencies, runs linting and formatting checks using ruff, performs type checking with mypy(static type checker for Python), and finally executes the full test suite with coverage reporting. The second job is a build job that runs only if the tests pass successfully. It installs the build tools, creates distribution packages using python -m build, and uploads the generated artifacts so they can be reviewed.
- Developer Tooling #007
ruff Description: An extremely fast Python linter and code formatter, written in Rust. What we like: Orders of magnitude faster than other Python linters, very active development. What we don't like: Still a zero-point release (0.14 as of this article), which allows for breaking changes in minor and patch releases.
- Python Code Quality Tools Beyond Linting
Let's start the conversation on how to 'measure' maintainable, and architecturally sound Python code. And keep Goodhart's law: "When a measure becomes a target, it ceases to be a good measure" in mind ;-)
- We adopt an approach I'll call "Thanks I Hate It (TIHI)"
- Exploring the dangerous power of unquoted Python strings, and how they caused CVE-2024-9287
The wise path is the one that avoids the shell entirely when not needed. Most linters (like ruff) will detect this for you.
- Uv format: Code Formatting Comes to uv (experimentally)
- What Rust projects are you most excited about?
I am also looking forward to uv, the really fast Python package manager written in Rust. I think Rust tooling for Python has great potential. Astral is also making a project called Ruff, which is a formatter and I'm also very excited about that.
- Python MCP Remote Server — The Dawn of the Streamable HTTP Era ~ With a Minimalist Template Featuring uv / Docker / pytest ~
Ruff: A Rust-based, ultra-fast Python linter and formatter developed by Astral (official website). What's astounding is not just its speed, but its ability to cover most of the checks and formatting previously done by multiple tools like Flake8, isort, pydocstyle, pyupgrade, etc., with Ruff alone. This simplifies configuration files and significantly reduces tool management costs. Ruff hooks are defined in .pre-commit-config.yaml. When you try to commit, static code analysis (detecting potential bugs or deprecated practices) and formatting (unifying coding style) are automatically executed. If issues are found, the commit is aborted, prompting you to fix them. In many cases, Ruff can automatically fix the problems it finds.
What are some alternatives?
python-lsp-server - Fork of the python-language-server project, maintained by the Spyder IDE team and the community
mypy - Optional static typing for Python
jedi-language-server - A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
prospector - Inspects Python source files and provides information about type and location of classes, methods etc
Pylint - It's not just a linter that annoys you!