Jump to ratings and reviews
Rate this book

Publishing Python Packages: Test, share, and automate your projects

Rate this book
Create masterful, maintainable Python packages! This book includes pro tips for design, automation, testing, deployment, and even release as an open source project!

In Publishing Python Packages you will learn how to:

    Build extensions and console script commands
    Use tox to automate packaging, installing, and testing
    Build a continuous integration pipeline using GitHub Actions
    Improve code quality and reduce manual review using black, mypy, and flake8
    Create published documentation for your packages
    Keep packages up to date with pyupgrade and Dependabot
    Foster an open source community using GitHub features

Publishing Python Packages teaches you how to easily share your Python code with your team and the outside world. Learn a repeatable and highly automated process for package maintenance that’s based on the best practices, tools, and standards of Python packaging. This book walks you through creating a complete package, including a C extension, and guides you all the way to publishing on the Python Package Index. Whether you’re entirely new to Python packaging or looking for optimal ways to maintain and scale your packages, this fast-paced and engaging guide is for you.

Foreword by David Beazley.

About the technology
Successful Python packages install easily, run flawlessly, and stay reliably up to date. Publishing perfect Python packages requires a rigorous process that supports systematic testing and review, along with excellent documentation. Fortunately, the Python ecosystem includes tools and techniques to automate package creation and publishing.

About the book
Publishing Python Packages presents a practical process for sharing Python code in an automated and scalable way. Get hands-on experience with the latest packaging tools, and learn the ins and outs of package testing and continuous integration. You’ll even get pro tips for setting up a maintainable open source project, including licensing, documentation, and nurturing a community of contributors.

What's inside

    Build extensions and console script commands
    Improve code quality with automated review and testing
    Create excellent documentation
    Keep packages up to date with pyupgrade and Dependabot

About the reader
For intermediate Python programmers.

About the author
Dane Hillard has spent the majority of his development career using Python to build web applications.

Table of Contents
PART 1 FOUNDATIONS
1 The what and why of Python packages
2 Preparing for package development
3 The anatomy of a minimal Python package
PART 2 CREATING A VIABLE PACKAGE
4 Handling package dependencies, entry points, and extensions
5 Building and maintaining a test suite
6 Automating code quality tooling
PART 3 GOING PUBLIC
7 Automating work through continuous integration
8 Authoring and maintaining documentation
9 Making a package evergreen
10 Scaling and solidifying your practices
11 Building a community

248 pages, ebook

Published February 28, 2023

4 people are currently reading
34 people want to read

About the author

Dane Hillard

3 books2 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
13 (72%)
4 stars
3 (16%)
3 stars
2 (11%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 6 of 6 reviews
Profile Image for Håvard Wall.
1 review
January 20, 2023
Before reading this book I was already maintaining a dozen or so python packages within my company. My python packages and packing was not too bad, but I spent a lot of work reading and searching to figure it all out. This book saves you a lot of the time I spent and will also give you a better result than what I had (of course I went back to my own packages and improved them after reading the book).

The book covers the building python packages, but equally important, all the infrastructure you need around your packages to work efficiently with them: Automation of tests and deployment, which is a must for me in my daily work. Of less interest to me, but important for many other types of projects than mine: Automation of documentation and working with public repositories and more.

For me personally, the only thing I missed that I find important for my own projects, would be how to automate the changelog.
Profile Image for Fábio Fortkamp.
183 reviews6 followers
April 25, 2024
This book is a good reference book to have about the complete workflow of publishing a python package. It covers modern development tools that are clearly used in popular projects (asdf, black, mypy, tox, cookiecutter), and presents a clear tutorial for each one of them. Hence, it is very nice to have such a condensed compedium of things that are usually treated in scattered tutorials throughout the internet.

However, many things can be improved. The examples are very bad; the authors talks about a "CarCorp" company that releases a "imppkg" package that calculated harmonic means - nothing related whatsoever. Hence, it is indeed a reference book and a tutorial about tools, but you have to follow along with your own projects, and not immerse yourself in the book.
1 review
Read
January 21, 2023
If you want to have a clear understanding of the Python package system and want to create packages yourself, buy this book. This book will sharpen your Python skills and make you stand out as a software engineer. Understanding packages is key to be efficient as a programmer. I highly recommend Python developers read this book and contribute to the ever-growing ecosystem.
114 reviews1 follower
November 2, 2022
Excellent introduction to much of the tooling around Python. (Read in final MEAP form)
Profile Image for Miki Tebeka.
1 review1 follower
January 24, 2023
A good solid book on a subject not many people know. It cover the newer tools nicely, I'd love it it covered pip in more details.
Profile Image for Tim Verstraete.
315 reviews3 followers
August 25, 2023
Now this was an very well written book of an underestimated topic in Python… excellent!
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.