Python Development: Packaging, Tooling, and Internals
Overview
This episode of Python Bytes covers essential updates and interesting technical deep dives into the Python ecosystem, ranging from project configuration to internal memory management.
Core Python Development
pyproject.toml
• Discussion highlights the importance of pyproject.toml (PEP 517/518), which now serves as a centralized configuration file for various tools like Black, coverage, and tox.
• The host emphasizes that it replaces disparate configuration files, streamlining project setup.
GitHub Actions for CI/CD
• The hosts explore using GitHub Actions for automated testing and publishing packages to PyPI.
• Key advice includes using GitHub Secrets for sensitive information to avoid exposing credentials in source code and implementing a workflow that tests on TestPyPI before final deployment.
Tools and Productivity
Rich Terminals
• Rich is highlighted as a powerful library for terminal applications, allowing for 16.7 million colors, emojis, tables, Markdown rendering, and advanced progress bars.
• It is described as a professional solution for modernizing CLI feedback.
System Monitoring with psutil
• psutil is identified as a vital cross-platform library for monitoring CPU, memory, and disk usage, as well as managing processes (suspending/killing).
Deep Dives
Python Integers Internals
• An exploration into how Python handles arbitrarily large integers, which avoids the classic overflow issues found in languages like C/C++.
• Internally, integers are represented as pyvar objects that store digits in a base-230 list, dynamically resizing as needed.
"The notion of developer time is way more valuable than computer time."
Community and News
• Mention of the Awesome Python Bytes community project.
• Brief update regarding GitHub's acquisition of npm.