Book description
Keeping up with the Python ecosystem can be daunting. Its developer tooling doesn't provide the out-of-the-box experience native to languages like Rust and Go. When it comes to long-term project maintenance or collaborating with others, every Python project faces the same problem: how to build reliable workflows beyond local development while staying in sync with the evolving ecosystem.
With this hands-on guide, Python developers will learn how to forge the moving parts of a Python project into an easy-to-use toolchain, using state-of-the-art tools including Poetry, Nox, pytest, mypy, pre-commit, Black, Ruff, uv, Rye, Hatch, and more. Author Claudio Jolowicz shows you how to create robust Python project structures complete with unit tests, static analysis, code formatting, and type checking.
You'll learn how to:
- Create open source projects with state-of-the-art infrastructure
- Build a custom infrastructure for all Python projects in a company or team
- Improve and modernize the infrastructure of an existing Python project
- Evaluate modern Python tooling for adoption in existing projects
- Use tools for packaging and dependency management
- Automate common development tasks such as testing, dependency updates, and publishing releases
Publisher resources
Table of contents
- Preface
- I. Working with Python
-
1. Installing Python
- Supporting Multiple Versions of Python
- Locating Python Interpreters
- Installing Python on Windows
- The Python Launcher for Windows
- Installing Python on macOS
- Installing Python on Linux
- The Python Launcher for Unix
- Installing Python with pyenv
- Installing Python from Anaconda
- A Brave New World: Installing with Hatch and Rye
- An Overview of Installers
- Summary
- 2. Python Environments
- II. Python Projects
- 3. Python Packages
- 4. Dependency Management
- 5. Managing Projects with Poetry
- III. Testing and Static Analysis
- 6. Testing with pytest
- 7. Measuring Coverage with Coverage.py
-
8. Automation with Nox
- First Steps with Nox
- Working with Sessions
- Working with Multiple Python Interpreters
- Session Arguments
- Automating Coverage
- Session Notification
- Automating Coverage in Subprocesses
- Parameterizing Sessions
- Session Dependencies
- Using Nox with Poetry Projects
- Locking Dependencies with nox-poetry
- Summary
- 9. Linting with Ruff and pre-commit
- 10. Using Types for Safety and Inspection
- Index
- About the Author
Product information
- Title: Hypermodern Python Tooling
- Author(s):
- Release date: June 2024
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098139582
You might also like
book
Python Testing with pytest
Test applications, packages, and libraries large and small with pytest, Python's most powerful testing framework. pytest …
book
Python Testing with pytest
Do less work when testing your Python code, but be just as expressive, just as elegant, …
book
Dead Simple Python
Dead Simple Python is a thorough introduction to every feature of the Python language for programmers …
book
Automate the Boring Stuff with Python, 2nd Edition
If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how …