Starting a new Python project, do I need all these tools?

I’m starting a new Python project and have always used a simple requirements.txt workflow. Recently an LLM suggested configuring a bunch of tools (Pyright, Black, Ruff, MyPy, Debugpy, Tree-sitter, uv, etc.) when using NvChad Neovim configuration, tools I’ve heard of but never used. Should I learn and adopt all of them? What’s a guide you’d recommend that shows a typical setup to start productive Python work?

You can bootstrap this project cleanly with uv managing your Python toolchain, and then wire Ruff, Black, and MyPy via pyproject.toml plus Neovim/NvChad integration.github+2

1. Install uv and create the project

On Manjaro, install uv globally and create a project‑local environment.snapcraft+1

bash

# install uv (snap example; pick your preferred method)
sudo pacman -S snapd           # if not already installed[web:22]
sudo systemctl enable --now snapd.socket[web:22]
sudo snap install astral-uv --classic[web:22]

# create project
mkdir ao3downloader
cd ao3downloader

# initialize uv-managed project & venv
uv init --app .
uv venv
source .venv/bin/activate

Then install your core tooling into the local environment:

bash

uv add ruff black mypy

This keeps all tools version‑pinned inside the project.

2. Configure pyproject.toml for Ruff, Black, MyPy

Use a unified pyproject.toml so all tools share line length and Python target.gpxz+2

Minimal example for ao3downloader (adjust versions as needed):

text

[project]
name = "ao3downloader"
version = "0.1.0"
description = "AO3 bookmark tracker, downloader, stats, and recommender"
requires-python = ">=3.11"

[tool.black]
line-length = 100
target-version = ["py311"]
skip-string-normalization = true

[tool.ruff]
line-length = 100
target-version = "py311"
src = ["ao3downloader", "scripts"]
lint.select = ["E", "F", "I", "B"]
lint.ignore = [
  "E501",  # Let Black handle line length.[web:20]
]
lint.per-file-ignores = { "tests/**" = ["E402"] }

[tool.ruff.format]
quote-style = "double"

[tool.mypy]
python_version = "3.11"
strict = true
ignore_missing_imports = true
mypy_path = ["ao3downloader", "scripts"]
plugins = []

[tool.uv]
dev-dependencies = [
  "ruff",
  "black",
  "mypy",
]

Run the tools once to verify:

bash

ruff check .
black .
mypy ao3downloader

3. Wire tools into Neovim + NvChad

Use NvChad’s custom config to hook Pyright (for LSP), Ruff, Black, and MyPy.youtube+1​github

  1. Ensure Python plugins are installed inside the project venv:

bash

uv add debugpy
# (pyright is an LSP server installed via Mason, not pip)[web:21]
  1. In Neovim (NvChad):
  • Install Pyright LSP and Tree‑sitter:

text

:MasonInstall pyright       " LSP for Python[web:21]
:TSInstall python           " Treesitter parser[web:21]
  • Create a custom Python config, e.g. ~/.config/nvim/lua/custom/configs/python.lua, modeled on NvChad Python examples. In that file:youtube​github
    • Configure LSP (pyright) for Python buffers.
    • Set format-on-save with Black.
    • Register Ruff and MyPy as external tools (e.g., via null‑ls / conform‑nvim depending on your NvChad version) so diagnostics from Ruff & MyPy show in the gutter.github​youtube+1​
  1. In ~/.config/nvim/lua/custom/plugins.lua, add the plugins / sources for Black, Ruff, MyPy following an NvChad Python template (for example, the NvChad-python-config repo shows a full setup with Pyright, Black, Ruff, and MyPy plus keymaps and DAP.)youtube​github

After that, in your ao3downloader directory:

bash

source .venv/bin/activate  # or use uv's `uv run ...`
nvim .

You should have:

  • LSP (Pyright) autocompletion and hover.
  • On-save formatting with Black.
  • Inline diagnostics from Ruff and MyPy for your AO3 downloader code.
  1. GitHub - dobval/NvChad-python-config: Custom config of Nvim (NvChad) as a Python IDE.
  2. Install uv on Manjaro Linux using the Snap Store | Snapcraft
  3. Configuring Ruff | Ruff
  4. How to Install kokoro-tts on Manjaro? (Python 3.13 Issues) - Third-Party Software - Manjaro Linux Forum
  5. How to configure ruff | GPXZ Elevation API
  6. ruff/docs/configuration.md at main · astral-sh/ruff · GitHub
  7. https://www.youtube.com/watch?v=4BnVeOUeZxc
  8. https://www.youtube.com/watch?v=m0OobzFjEKE
  9. https://www.youtube.com/watch?v=yAQFk3cHJbo
  10. https://www.youtube.com/watch?v=sSz2eXZ2ELM

I’m not sure, but if you are adding ruff to your environment, black is unnecessary, as it can already do what black is doing with code: formatting. Ruff can both check code (ruff check) and format (ruff format) and work as well as a language server (ruff server)

2 Likes

I mainly use uv, ruff, mypy, and pytest. Perhaps plus a particular project’s precommit.yaml.

Using pyright as well as mypy is overkill while getting used to static typing (but for a mature project, it can be thought of as thorough testing against multiple compilers).

I can’t imagine why anyone would need tree-sitter in a project that doesn’t need a parser. I’ve never heard of it or Debugpy before.

There are other good code quality tools out there, that are worth running - coverage and pytest in particular. Using more of them rather than fewer is by no means a bad idea if generating code from LLMs.

1 Like

You don’t need any of them. By all means, look them up to see what they do and try ones that sound useful but no one should feel that they must adopt them. Many of them are only useful in certain kinds of workflows or projects. All of them have costs which may sometimes be worse than the problems they intend to solve.

11 Likes

I would recommend that you use tools as needed instead of adding them from the start.


UV

The uv is very good; it will offer you:

  • Virtual environment management: uv venv
  • Dependency management: uv sync / uv add / uv remove
  • Python version management: uv python
  • Installation of isolated tools by virtual environment: uv tool
  • Package building: uv build
  • Package publishing: uv publish

Without it, you would have to use individual tools such as venv/pip/poetry/pdm/twine/pyenv/pipx.


Ruff

Do you want to standardize coding styles? ruff is fantastic for that. With it, you can:

  • Format your code using ruff format
  • Choose your code style rules (Rules | Ruff)
  • Check your code is following the style rules using ruff check
  • Autofix your code style using ruff check --fix

You don’t need to install black/blue, pyflakes, etc.


Pytest

Looking to write tests to ensure software quality? I highly recommend pytest.

pytest .

Mypy / Pyright

Want to know if your type hints are correct or if you’re following existing type hints the right way? Use a static type analyzer like mypy.

mypy your-package

And if you want to ensure it also works with others like pyright, you can use both (but I don’t recommend it right away).


Taskipy

Wow, that’s a lot of tool commands to remember! So, use taskipy, you’ll be able to shorten the commands so you don’t even need to know the tools.

task format # ruff format && ruff check --fix
task lint_mypy # mypy your-package
task lint_ruff # ruff check
task lint # task lint_mypy && task lint_ruff
task test # pytest .

Using tools according to your needs is key!

2 Likes

Tree-sitter appears to just be a dependency for the LSP server, and I didn’t look deeply enough to see why it needs to be installed separately rather than automatically when installing the LSP server.

I use Debian and I’ve never really needed any of these tools. I just install the python modules I need from apt, if any.

I do use mypy but I do not use any syntax checkers and formatters, since they interact badly with history.

I strongly recommend that you start out with the absolute minimum, and only add when you feel that you need it.

Write tests and try to keep your git commits small and self-contained. If possible, let your repository server (GitHub?) run tests on their end as well, to make sure that your program doesn’t only work on your machine.

Happy coding!