Set up ruff and uv for python projects
How to set up ruff and uv when working in python projects
The Problem
In the last months uv has gained a lot of popularity, and with it ruff also. This is my actual setup for it.
Install the extension ruff on vscode/cursor and following these steps
Pyproject.toml
Add this configuration
[tool.ruff]
# Enable auto-fixing
fix = true
unsafe-fixes = false
lint.select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"D", # pydocstyle
"D401", # First line should be in imperative mood
"T201",
"UP",
]
lint.ignore = [
"UP006",
"UP007",
"UP035",
"D417",
"E501",
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "UP"]
[tool.ruff.lint.pydocstyle]
convention = "google"
.vscode/settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"ruff.enable": true,
"ruff.fixAll": true,
"ruff.organizeImports": true
}
Related Posts
How to add third parthy login with Supertokens (Google)
Step by step of how to integrate a google login in your application. Create the credentials in google and integrate everything in your application.
How to add pricing with Lemonsqueezy (python fastapi + React)
How to add pricing with lemonsqueezy, handle the webhooks, automatic redirects and changes to the DB
Simple Approach to write readable Logs
Writing Logs is a necessary part of every application, though it can also be tedious. This guide shows how to write minimal logs for an MVP to track what is going on in the app
Let's connect !!
Get in touch if you want updates, examples, and insights on how AI agents, Langchain and more are evolving and where they’re going next.