pyright VS ruff

Compare pyright vs ruff and see what are their differences.

pyright

Static Type Checker for Python (by microsoft)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
pyright ruff
135 94
11,846 25,475
2.9% 11.6%
9.8 10.0
7 days ago about 20 hours ago
Python Rust
GNU General Public License v3.0 or later MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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

Posts with mentions or reviews of pyright. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-18.

ruff

Posts with mentions or reviews of ruff. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-18.
  • Enhance Your Project Quality with These Top Python Libraries
    16 projects | dev.to | 18 Mar 2024
    Ruff is a Python linter that helps to identify and remove code smells. Over 700 built-in rules: Ruff includes native re-implementations of popular Flake8 plugins, like flake8-bugbear. And also built-in caching to avoid re-analyzing unchanged files.
  • Ask HN: What interesting project ideas you've got but have no time to work on?
    2 projects | news.ycombinator.com | 6 Feb 2024
    Because the Python's "ast" modules is too slow, and lacks proper "format" feature (it has unparse but it removes comments, and forgets the current style completely). I use "ruff" a lot (https://github.com/astral-sh/ruff) which is in Rust. But I want to be able to implement fast custom linters in Go (linters that ruff / fixit lack, and Python linters lack or are too slow).
  • Rye: A Vision Continued
    2 projects | news.ycombinator.com | 4 Feb 2024
    I think it’s interesting that rye uses ruff (https://github.com/astral-sh/ruff) for linting and formatting. That’s the right call, and it’s also correct to bundle that in for an integrated dev experience.

    I had to guess, that’s the path that the Astral team would take as well - expand ruff’s capabilities so it can do everything a Python developer needs. So the vision that Armin is describing here might be achieved by ruff eventually. They’d have an advantage that they’re not a single person maintenance team, but the disadvantage of needing to show a return to their investors.

  • Smooth Packaging: Flowing from Source to PyPi with GitLab Pipelines
    8 projects | dev.to | 18 Jan 2024
    Adding more weight to ease of setup and configurability, the choice came down on flake8. It is easy to integrate, since its also available through pip and let’s you configure which standards you want to omit by simply stating them as a list via the --ignore switch. Moving to ruff appears quite smooth, so future updates may do so.
  • Show HN: Marimo – an open-source reactive notebook for Python
    13 projects | news.ycombinator.com | 12 Jan 2024
  • AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
    15 projects | news.ycombinator.com | 10 Dec 2023
    I confess I stole the pip recipe from Charlie :D

    https://github.com/astral-sh/ruff/blob/main/.github/workflow...

  • Embracing Modern Python for Web Development
    12 projects | dev.to | 8 Dec 2023
    Ruff is an emerging tool in the Python ecosystem that describes itself as "an extremely fast Python linter and code formatter, written in Rust".
  • Writing and Linting Python at Scale
    4 projects | news.ycombinator.com | 22 Nov 2023
    I'm happy with Ruff[0], it's very fast.

    [0] -- https://github.com/astral-sh/ruff

  • Using GitHub Actions with my Project
    3 projects | dev.to | 16 Nov 2023
    Thankfully, my project has no dependencies so I don't have to make pip install anything other than Ruff to lint my code, which you can see above. I only make my program run the testers with two versions of Python, 3.11 and 3.12. I chose these versions in particular because there is a library my program uses called tomllib. Tomllib is built into Python 3.11 and above, which means that my program does not support 3.10 and below. So I've only made it test with the two most recent versions of Python. I also wanted to attempt running my program on different OSs, like Ubuntu and MacOS, but I believe way those two OSs handle file paths differently from Windows. So when I was trying to handle file paths, it was expecting it in the Windows way and not the Linux way. So for now, it looks like my program does not work with Linux and MacOS. That concludes what I did for my workflow, next I'll talk about writing a test for a peer's program.
  • A Tale of Two Kitchens - Hypermodernizing Your Python Code Base
    31 projects | dev.to | 12 Nov 2023
    A more modern alternative for flake8 is Ruff: Ruff can be used to replace Flake8 (plus a variety of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake, all while executing tens or hundreds of times faster than any individual tool. Ruff supports over 700 lint rules and goes beyond the responsibilities of a traditional linter, instead functioning as an advanced code transformation tool capable of upgrading type annotations, rewriting class definitions, sorting imports, and more.

What are some alternatives?

When comparing pyright and ruff you can also consider the following projects:

jedi-language-server - A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.

mypy - Optional static typing for Python

python-lsp-server - Fork of the python-language-server project, maintained by the Spyder IDE team and the community

python-language-server - Microsoft Language Server for Python

coc-jedi - coc.nvim wrapper for https://github.com/pappasam/jedi-language-server

pylance-release - Documentation and issues for Pylance

black - The uncompromising Python code formatter

flake8

pyre-check - Performant type-checking for python.

Pylint - It's not just a linter that annoys you!

Flake8 - flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.