A practical guide to building a Python code quality workflow using six tools: Black for formatting, Ruff for linting, mypy for static type checking, pytest for behavioral testing, pre-commit for automating checks on commit/push, and py-spy for performance profiling. The post uses a realistic order-processing module with deliberate bugs to demonstrate how each tool catches different categories of problems before code reaches production.

18m read timeFrom towardsdatascience.com
Post cover image
Table of contents
Tool #1: Readable code with no formatting noiseTool #2: Catching the small suspicious mistakesTool #3: Python starts feeling much saferTool #4: Testing, testing 1..2..3Tool #5: Because your memory is not a reliable quality-control systemTool #6: Because “correct” code can still be brokenResourcesSummary

Sort: