Leanpub Header

Skip to main content

Modern Python Development in 2026: uv, Ruff, mypy, Black, pytest, Cython & Beyond

The Complete Guide to the Python Toolchain -- From Package Management to Production

This book is 100% completeLast updated on 2026-07-03
Python development has changed dramatically in recent years, and keeping up with the growing ecosystem of tools can be challenging. Modern Python Development in 2026 brings everything together in one practical reference, covering package management with uv, pip, Poetry, and PDM, code quality with Ruff, Black, mypy, and Pyright, testing with pytest and Hypothesis, performance optimization with…

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

This book is a comprehensive, up-to-date reference for modern Python development in 2026. It covers the tools that define the contemporary Python workflow: package management with uv, pip, Poetry, and PDM; code quality with Ruff, Black, and mypy/Pyright; testing with pytest and Hypothesis; performance optimization with Cython, Numba, and PyO3; build systems, documentation, CI/CD pipelines, security scanning, and more. Whether you are starting a new project or migrating an existing codebase, this book gives you the knowledge to make informed tool choices backed by benchmarks, real-world data, and current best practices.

Share this book

Author

About the Author

Steve T. Publications

Steve T. is a cybersecurity leader, researcher, and engineer with more than 20 years of experience across application security, infrastructure security, vulnerability management, software development, and secure engineering practices. Having built his career alongside the growth of the modern internet, he has worked through multiple generations of technology, evolving security threats, and changing development methodologies.

He is currently part of the advanced research organization at a leading cybersecurity company, where he focuses on emerging threats, security innovation, and the practical application of research. His work involves investigating new attack techniques, evaluating emerging technologies, conducting deep technical analysis, and helping organizations better understand and manage complex security risks.

In addition to his research responsibilities, Steve leads a team of senior engineers and subject matter experts who create technical books, training programs, and educational resources for security professionals. Through this work, he helps engineers, developers, architects, and security practitioners strengthen their skills and build more secure systems.

Steve's technical expertise spans software development, reverse engineering, web application security, penetration testing, security architecture, incident response, vulnerability research, operating system internals, and secure software development. His ability to analyze systems at both the source code and binary levels enables him to bridge the worlds of software engineering, security research, and practical defense.

Over the course of his career, Steve has worked with organizations across a wide range of industries, helping them identify, assess, and remediate security weaknesses in critical applications and infrastructure. He is recognized for combining deep technical expertise with a pragmatic approach to security, focusing on solutions that are effective, sustainable, and aligned with business goals.

Through his work in research, engineering, leadership, and education, Steve continues to contribute to the advancement of cybersecurity and the development of secure, resilient technology systems.

Contents

Table of Contents

The Complete Guide to the Python Toolchain: From Package Management to Production

Introduction: A Toolchain Transformed

  1. The Politics of Packaging: How We Got Here
  2. The Rust Revolution in Python Tooling
  3. What This Book Will Teach You
  4. A Note on Scope and Perspective

References

Chapter 1: The Modern Python Landscape

  1. A Day in the Life of a Python Developer (2019)
  2. The Old Stack: A Fragmented World
  3. The State of Affairs in 2018
  4. The First Wave of Consolidation: pip 20.3
  5. The Second Wave: PEP 517, PEP 518, and Build Backends
  6. The Turning Point: PEP 621
  7. The Rust Revolution
  8. The OpenAI Acquisition: A Watershed Moment
  9. Deep Dive: The PubGrub Algorithm and Why It Matters
  10. PEP 735 and the Standardization of Dependency Groups
  11. The Economics of Speed
  12. The 2026 Python Toolchain at a Glance
  13. Why Speed and Standards Matter

References for Chapter 1

Chapter 2: Package Managers–uv, pip, Poetry, PDM, and Pipenv

  1. The Architecture of a Modern Package Manager
  2. uv: The All-in-One Powerhouse
  3. The pip Story: Still Relevant in 2026
  4. Poetry: Legacy Champion and Modern Redesign
  5. PDM, Pipenv, Hatch, and pixi: The Alternatives
  6. Head-to-Head Benchmarks
  7. Migration Guides
  8. When to Use Which Tool

References

  1. When to Use Which Tool

Chapter 3: Dependency Management and Virtual Environments

  1. The Art of Dependency Resolution
  2. Lockfiles: The Foundation of Reproducibility
  3. Virtual Environments: Isolation Without Friction
  4. Dependency Groups and Optional Dependencies
  5. Tox and Environment Orchestration
  6. PEP 751 and the Future of Lockfiles
  7. Reproducibility and CI Strategy
  8. Hands-On Project: Migrate a Legacy Django Project to uv and Ruff

References for Chapter 3

Chapter 4: Code Formatting–Black and Ruff

  1. The Philosophy of Automated Formatting
  2. Black: The Uncompromising Formatter
  3. Ruff Formatter: Black-Compatible, Blazing Fast
  4. Editor Integration
  5. When to Use Which Formatter
  6. Migration from Black to Ruff: A Step-by-Step Guide
  7. Hands-On Project: Formatting Migration–Flake8 + Black + isort to Ruff

Chapter 5: Linting–Ruff, Pylint, and the Modern Linter Stack

  1. The Evolution of Python Linting
  2. Ruff: A New Paradigm for Linting
  3. Configuration and Rule Management
  4. Pylint: Deep Semantic Analysis
  5. Flake8 and Legacy Tools
  6. Pre-Commit Hooks and CI Integration
  7. Per-File Overrides and Selective Rules
  8. Hands-On Project: Building a Quality Gate for a Mid-Sized Project

Chapter 6: Static Type Checking–mypy, Pyright, ty, and Pyrefly

  1. The Promise and Reality of Type Checking in Python
  2. Independent Benchmarks: Speed at Scale
  3. mypy: The Original and Still the Default
  4. pyright and Basedpyright: Microsoft’s Type Checker
  5. ty: The OpenAI Type Checker
  6. Pyrefly: Meta’s High-Speed Checker
  7. Zuban: MyPy-Compatible at Rust Speed
  8. Comparison Summary
  9. The Inference Problem: Why Tools Disagree
  10. Selection Guide
  11. Multi-Checker Workflows: The Best of Both Worlds

References for Chapter 6

Chapter 7: Testing with pytest and Hypothesis

  1. The Philosophy of Testing in Python
  2. pytest: The Workhorse of Python Testing
  3. Essential pytest Plugins
  4. Hypothesis: Property-Based Testing
  5. Test Architecture: Organizing a Growing Test Suite
  6. Hands-On Project: Building a Property-Based Test Suite for a Data Validation Library

Chapter 8: Build Systems and Packaging

  1. The Anatomy of a Python Package
  2. The Build Backend Ecosystem
  3. Writing a Modern pyproject.toml
  4. Building Distributions
  5. Publishing to PyPI
  6. Database Migrations with Alembic
  7. Hands-On Project: Build a High-Performance Data Processing CLI with PyO3 & maturin

References for Chapter 8

Chapter 9: Documentation–Sphinx, MkDocs, and Read the Docs

  1. Why Documentation Matters
  2. Sphinx: The Gold Standard for API Reference
  3. MkDocs: Simplicity and Speed
  4. JupyterBook and Zensical
  5. Docstring Styles: Choosing Your Convention
  6. Hosting and CI Integration
  7. Hands-On Project: Setting Up Documentation for a Library

References for Chapter 9

Chapter 10: Performance Optimization–Cython, Numba, PyO3, and Beyond

  1. The Discipline of Profiling
  2. Cython: Ahead-of-Time Compilation
  3. Numba: Just-in-Time Compilation
  4. Codon and Nuitka: Alternative Compilers
  5. Cython vs. Numba: When to Use What
  6. PyO3 and Rust Bindings: Maximum Performance
  7. Performance Optimization Decision Tree
  8. Hands-On Project: Profiling and Optimizing a Data Processing Pipeline

References for Chapter 10

Chapter 11: Debugging, Profiling, and Observability

  1. The Art of Finding Bugs
  2. Interactive Debugging with pdb and Its Successors
  3. IDE Debugging with debugpy
  4. Enhanced Tracebacks with rich.traceback
  5. Advanced Profiling Tools
  6. Logging and Structured Observability
  7. Secret Scanning and Supply Chain Security
  8. Debugging in CI and Containers
  9. Hands-On Project: Setting Up Production Observability

References for Chapter 11

Chapter 12: CI/CD, Automation, and Security

  1. The Philosophy of Automated Quality
  2. GitHub Actions for Python
  3. GitLab CI / Jenkins: Alternatives
  4. Security Scanning in CI Pipelines
  5. Pre-Commit Hooks: Quality at the Gate
  6. Hands-On Project: Architecting a Production CI/CD Pipeline with Security Gates

References for Chapter 12

Conclusion: The Modern Python Developer’s Toolkit

  1. The Convergence of Speed and Standards
  2. What We Have Learned
  3. The Vendor Question: Astral, OpenAI, and the Future of Open Source Tooling
  4. Looking Ahead: The Next Five Years
  5. A Strategic Framework for Toolchain Decisions

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub