Python Packaging, Interoperability, and Runtime Typing

·33m 14s
Shared point

Overview

In this episode of Python Bytes, hosts Michael Kennedy and Brian Okken dive into the complexities of Python packaging, explore an innovative way to bridge Python and JavaScript, and discuss runtime type checking tools. The episode also covers nuances in versioning and highlights new pedagogical resources for developers.

Python Packaging and Dependencies

Brett Cannon explores the historical and practical differences between managing dependencies for applications versus packages.
• There is an ongoing debate about the adequacy of requirements.txt versus modern configurations like pyproject.toml.
• The hosts discuss the potential for expanding pyproject.toml to include application-specific sections, potentially replacing or augmenting legacy requirement files.
• They emphasize the importance of using tools like pip-tools and pip-compile to maintain synchronization in complex project environments.

Python Monkey: JavaScript Interop

Python Monkey is introduced as a powerful, high-performance compatibility layer that embeds the SpiderMonkey JavaScript engine directly within Python.
• It allows developers to call JavaScript functions from Python and vice versa, leveraging shared memory and JIT compilation.
• The tool supports WebAssembly execution and asynchronous programming, offering a unique bridge for data science applications or performance-intensive tasks.

"My mind to your mind, my object to your dics, your dics to my objects."

Versioning Quirks and Runtime Type Checking

Seth Larson analyzes the strange, often overlooked rules of Python packaging versioning, including the use of "Epic" versions and arbitrary precision.
• The episode also highlights BearType, a near zero-cost, runtime type checker that brings Rust-inspired safety to dynamically typed Python.
BearType uses decorators to enforce type hints at the function boundary, providing helpful exceptions when runtime data violates expected schemas.

Conferences and Community News

• The hosts announce PackagingCon in Berlin and the Cloud Builders Python Conf.
• A warm welcome is extended to Mike Felder for his role as the new security engineer for PyPI.
• Brian Okken highlights a new error-tolerant feature in VS Code for pytest discovery and announces his new pre-release pytest bundle course.

Topics

Chapters

5 chapters
Python Bytes
AI chat — answers grounded in episodes