Publishing Python Packages, Video Edition

Video description

In Video Editions the narrator reads the book while the content, figures, code listings, diagrams, and text appear on the screen. Like an audiobook that you can also watch as a video.

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.

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.

Quotes
...practical...I learned a lot from this book. A wholly modern approach to current packaging tooling and the problems faced by package developers…I think you’ll find it to be a useful source and an inspiration.
- From the Foreword by David Beazley, author of Python Distilled

A comprehensive guide to the Python packaging landscape. Dane takes a complicated topic and makes you think, ‘Yeah, I got this.’ It’s impressively done. Recommended.
- Carlton Gibson, Django Project

A comprehensive guide for Python programmers ready to share their code with the world.
- Joshua A. McAdams, Senior Software Engineer, Google

Table of contents

  1. Part 1. Foundations
  2. Chapter 1. The what and why of Python packages
  3. Chapter 1. How packaging helps you
  4. Chapter 1. Summary
  5. Chapter 2. Preparing for package development
  6. Chapter 2. Summary
  7. Chapter 3. The anatomy of a minimal Python package
  8. Chapter 3. Authoring package metadata
  9. Chapter 3. Controlling source code and file discovery
  10. Chapter 3. Including non-Python files in a package
  11. Chapter 3. Summary
  12. Part 2. Creating a viable package
  13. Chapter 4. Handling package dependencies, entry points, and extensions
  14. Chapter 4. Creating a C extension for Python
  15. Chapter 4. Offering command-line tools from a Python package
  16. Chapter 4. Specifying dependencies for Python packages
  17. Chapter 4. Summary
  18. Chapter 5. Building and maintaining a test suite
  19. Chapter 5. Addressing testing tedium
  20. Chapter 5. Summary
  21. Chapter 6. Automating code quality tooling
  22. Chapter 6. Analyzing type safety
  23. Chapter 6. Creating a tox environment for code formatting
  24. Chapter 6. Creating a tox environment for linting
  25. Chapter 6. Summary
  26. Part 3. Going public
  27. Chapter 7. Automating work through continuous integration
  28. Chapter 7. Continuous integration with GitHub Actions
  29. Chapter 7. Converting manual tasks to GitHub Actions
  30. Chapter 7. Publishing a package
  31. Chapter 7. Summary
  32. Chapter 8. Authoring and maintaining documentation
  33. Chapter 8. Starting your documentation with Sphinx
  34. Chapter 8. Publishing documentation to Read the Docs
  35. Chapter 8. Documentation best practices
  36. Chapter 8. Summary
  37. Chapter 9. Making a package evergreen
  38. Chapter 9. Getting the most out of GitHub
  39. Chapter 9. Thresholding test coverage
  40. Chapter 9. Updating Python syntax using pyupgrade
  41. Chapter 9. Reducing rework using pre-commit hooks
  42. Chapter 9. Summary
  43. Part 4. The long haul
  44. Chapter 10. Scaling and solidifying your practices
  45. Chapter 10. Using namespace packages
  46. Chapter 10. Scaling packaging in your organization
  47. Chapter 10. Summary
  48. Chapter 11. Building a community
  49. Chapter 11. Provide supporting documentation for different user types
  50. Chapter 11. Establish, provide, and enforce a code of conduct
  51. Chapter 11. Conveying the project’s road map, status, and changes
  52. Chapter 11. Gather consistent information with issue templates
  53. Chapter 11. Go forth
  54. Chapter 11. Summary
  55. Appendix A. Installing asdf and python-launcher
  56. Appendix A. Installing python-launcher
  57. Appendix B. Installing pipx, build, tox, pre-commit, and cookiecutter
  58. Appendix B. Installing build
  59. Appendix B. Installing tox
  60. Appendix B. Installing pre-commit
  61. Appendix B. Installing cookiecutter

Product information

  • Title: Publishing Python Packages, Video Edition
  • Author(s): Dane Hillard
  • Release date: February 2023
  • Publisher(s): Manning Publications
  • ISBN: None