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-13

Python development has changed fast, and keeping up with new tools is a challenge. Modern Python Development in 2026 is a practical guide to package management, testing, code quality, performance, CI/CD and security, helping you choose the right tools and modern workflows for any Python project.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
139
Pages
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.

Bundle

Bundles that include this book

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 400 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

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