Reimagining Python's Packaging Workflows
Episode Deep Dive
Guests Introduction and Background
- Steve Dower is a CPython core developer at Microsoft who got started in the Python community to help improve Windows support and Python packaging. While his primary focus now is broader in Python, he still contributes to packaging standards and tools.
- Paul Moore is also a CPython core developer, known for being a longtime maintainer of
pip
. He’s the delegate for PEPs (Python Enhancement Proposals) related to packaging standards, giving him a key role in shaping the ecosystem. - Ofek Lev is the primary maintainer of Hatch, a modern Python project manager and build backend. He rewrote Hatch from scratch to simplify and streamline user workflows, with an emphasis on user experience.
- Pradyun Gedam is deeply involved in Python packaging as a maintainer of
pip
,Flit
, and other tools. He’s also recently become a CPython core developer, solidifying his role in guiding Python’s future packaging direction.
What to Know If You're New to Python
Here are a few points to help you follow the discussion on Python packaging tools and workflows:
- Python packages are bundles of code you can install, usually from PyPI.
- Environment management is important: You typically use tools like
virtualenv
,conda
, orvenv
to separate different project dependencies. - Packaging goes beyond just installing libraries—it’s also about building and distributing your own Python code, even if it’s just for internal apps.
- Understanding the difference between installing packages for your personal use vs. publishing packages for others is central to much of this conversation.
Key Points and Takeaways
- Rethinking Python Packaging as a Whole
The episode kicks off with the idea that Python’s packaging landscape has expanded rapidly, bringing new tools like Hatch, Poetry, PDM, and others alongside classics like
pip
andsetuptools
. This has sparked in-depth discussions on how to unify or at least better guide Python’s packaging story, especially for new and casual users. - Python Packaging User Survey
A detailed survey was conducted under the Python Software Foundation’s umbrella, revealing that many users want a single or more unified packaging tool. Yet the community has a variety of established workflows, making a “one size fits all” approach complicated. This feedback has spurred the packaging discussions on discuss.python.org.
- Links and Tools:
- The Packaging “Divide”
Many developers who use Python packages for data science or application development have distinct needs from those who create and publish libraries on PyPI. Balancing these dual communities is essential.
- No single environment manager or build backend fits all. Instead, we have specialized tools like
conda
for science andhatch
/poetry
/pdm
for application workflows.
- No single environment manager or build backend fits all. Instead, we have specialized tools like
- Pip’s Role and Limitations
pip
is included with Python primarily for bootstrapping—installing and upgrading packages. It was never designed to handle advanced workflows like environment management or building complex applications. Many people still assumepip
should do it all, but the maintainers are cautious about pushingpip
too far from its core mission.- Links and Tools:
- Why Not Just Copy Cargo or Conda?
Listeners may wonder why Python can’t simply adopt something like Rust’s Cargo or fully embrace the Conda approach. The short answer is that Python has an older and more diverse ecosystem, with multiple platforms and deeply entrenched workflows. Simply copying Rust’s or Conda’s model would create disruption and leave many users behind.
- Links and Tools:
- Diversity vs. Confusion Python’s packaging ecosystem intentionally embraced diversity (e.g., multiple build backends and environment managers) to spur innovation. However, this leads to confusion for beginners and casual users who just want a recommended path. The open question: How do we keep encouraging new ideas while reducing user confusion?
- Possible Unified Workflows
The panel discussed ideas like adding higher-level commands directly into the
python
CLI (e.g.,python add
,python init
), or bundling an official workflow tool in standard Python distributions. Yet the biggest concern is ensuring any “unified tool” respects the huge variety of needs already covered by specialized projects. - Distribution Challenges
Python is delivered in different ways: from python.org installers on Windows to
apt
orbrew
packages on Linux and macOS. This distribution model complicates standardization since it’s not always the Python core team deciding how Python is bundled for each platform. - The Myth of the “Packaging Authority” The Python Packaging Authority (PyPA) name can be misleading. It’s more of a collaborative group of volunteers rather than a centralized command structure. Many of the real decisions are made through consensus in working groups or in the open on the packaging forums.
- Next Steps and Community Involvement Major changes will require alignment between tool developers, the PyPA, CPython core developers, and the wider community. Engaged discussion, especially from real-world users, is vital. The best path forward may involve an “officially recommended” tool that emerges from the existing diversity—while not outright removing other options.
Interesting Quotes and Stories
- On new users and confusion: “If you’re brand-new to Python and you see one blog post recommending Poetry, another praising Hatch, and a third saying to stick to pip and requirements files, you’re bound to be confused.”
- On Python’s growth and packaging: “We’re getting these deep packaging issues now because everything else works well enough that so many more people can use Python, and that’s a success story.”
- On deciding a unified tool: “It’s not that we don’t want a recommended tool—nobody wants to pick the ‘wrong’ solution and make half the community unhappy.”
Key Definitions and Terms
- PyPI (Python Package Index): The default online repository where open-source Python packages are published and shared.
- PEP (Python Enhancement Proposal): A design document that provides information to the Python community or describes a new feature for Python.
- Virtual Environment: A tool or structure to isolate dependencies, ensuring projects do not conflict with each other.
- Build Backend: A tool or library (like
setuptools
,Flit
, orHatchling
) used to define how Python packages are built. - Conda: A cross-platform package management system often used in data science for handling Python and non-Python dependencies under one environment manager.
Learning Resources
Here are some additional ways to delve deeper into Python’s packaging ecosystem and best practices:
- PyPA (Python Packaging Authority): Collaborative site for many packaging-related projects.
- Hatch documentation: Modern Python project management and build backend.
- Poetry documentation: Popular dependency manager and build tool.
- pypackaging-native discourse thread: Official forum for packaging discussions and proposals (some of the conversation took place here).
Overall Takeaway
There is tremendous energy in the Python community around packaging, highlighted by diverse tools and ongoing debates about unification. Much of the conversation focuses on striking the right balance between a “simple, obvious” workflow that newcomers and casual users can adopt versus continuing to allow the competition and customization that have driven innovation so far. The guests are hopeful that through open discussion, community feedback, and careful experimentation, Python can maintain its flexibility while offering clearer guidance to developers of all levels.
Links from the show
Thoughts on the Python packaging ecosystem: pradyunsg.me
Python Packaging Authority: pypa.io
Hatch: hatch.pypa.io
Pyscript: pyscript.net
Dark Matter Developers: The Unseen 99%: hanselman.com
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm
--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy