Python Packaging, Async Tools, and IDE Updates (Ep 80)
Python Packaging Simplified
The Python Packaging Authority has recently revamped their official packaging tutorial, making it far more accessible and current. Key takeaways include:
• Transitioning to Markdown for README files.
• A move away from overly complex setup.py examples.
• The recommendation of Twine as the standard tool for pushing packages to PyPI.
• The mention of FLIT, a modern, minimal alternative for those looking to avoid traditional setup scripts.
Async Development with GidgetHub
Modern GitHub Automation
We explored GidgetHub, an async-enabled wrapper for the GitHub API. It is particularly powerful for building:
• GitHub bots that automate PR management and issue tracking.
• Systems that leverage webhooks for asynchronous event handling.
"It's a sans IO library... just a protocol implementation that doesn't really specify how the IO is performed."
This modular design allows developers to plug in different backends like AIOHTTP or Tornado.
Systemd and Infrastructure
For those working with Linux services, PySystemD offers a powerful API to manage daemons and unit files directly from Python. It acts as a wrapper around the native systemd C library, making it an excellent choice for production engineers automating service lifecycles.
PyCharm and PyTest Integration
The latest Early Access Program (EAP) for PyCharm 2018.2 features robust improvements for PyTest enthusiasts:
• Enhanced IntelliSense for test fixtures.
• Seamless parameterization support, allowing users to rerun specific parameterized tests or only failed subsets, saving significant time during hardware testing.
Challenges in Initial Setup
Teaching Python to beginners highlighted significant pain points in installing Python 3.6. Issues often arise from:
• Confusion between Windows hosts and the Linux Subsystem for Windows.
• Broken third-party PPAs on older Ubuntu distributions.
• Dependency conflicts between different terminal environments.
To combat this, a new guide has been established at realpython.com/installing-python to streamline the experience for newcomers.