Python Byte 315: Jupyter, TOML, Serverless & Projects
Jupyter Server 2.0 and New Tooling
The Evolution of Jupyter Server
• Jupyter Server 2.0 brings significant updates to the core web server powering JupyterLab and Notebooks.
• Key features include a new Identity API designed for Google Docs-style real-time collaboration and an Authorization API to manage granular access control.
• A new event system, JupyterEvents, enables JSON-based, event-driven architecture, while a new kernel WebSocket API improves underlying communications.
Developer Tools & Testing
• The release includes PyTest Jupyter fixtures, allowing developers to test extensions more effectively, with a stated goal of reaching 80% test coverage.
Modernizing Python Packaging
Migrating to pyproject.toml
• Discussion on tools to transition from setup.py or setup.cfg to the modern pyproject.toml standard.
"Who really cares how much how it's formatted as long as it looks good and it's proper."
• Tools like Any.toml (experimental) and PyProject-format provide ways to standardize project configuration, though auto-formatted output often requires manual cleanup.
• The importance of validating pyproject.toml using schema-driven tools was highlighted alongside the continued utility of Tox for virtual environment testing.
Serverless Computing with Python
AWS Lambda Power Tools
• AWS Lambda Power Tools Python simplifies serverless development by providing utilities for:
• Distributed tracing to debug transient functions.
• Structured logging and custom metrics.
• Middleware-like decorators for request handling.
• Validation using Pydantic.
• The library allows Python developers to manage complex, geographically distributed architectures with reduced overhead.
Developer Productivity & Maintenance
Self-Updating Profiles
• Using Jinja2 templates, GitHub Actions, and cron jobs, developers can create self-updating README files that pull data from RSS feeds, blogs, or social media.
• Crontab.guru is recommended as a reliable tool for managing the syntax of these automated jobs.
Performance & Security
• Python 3.11 demonstrates significant performance improvements, with PyPI observing a 50% drop in load after upgrading.
• GitHub has introduced enhanced security scanning features to detect secret leakage automatically in repositories.