Python Packaging, Vector Search with PostgreSQL, and Load Testing Tools

·30m 20s
Shared point

Python Packaging: The Shift to pyproject.toml

This episode dives into the modern Python packaging standards. The transition from setup.py to pyproject.toml is now the recommended approach for defining project metadata, build backends, and dependencies. Key highlights:
• Projects can now easily reference readme and license files without complex injection scripts.
• There is increased flexibility for listing multiple URLs such as bug trackers and documentation.
• Developers are encouraged to use classifiers to define license types, as these are the canonical standard for PyPI.
• Build backends like Flit, Hatchling, and Setup Tools offer distinct features, allowing developers to manage tests or C-extensions in their distribution.

Data science and Postgres with Vex

Discussion shifts to the pgvector extension for PostgreSQL, which enables efficient vector similarity searches.

"It gives you the exact and approximate nearest neighbors, allow you to query that... Gives you L2 distance, it'll do the inner product and cosine distance."

• The Vex library provides a convenient Python API to interact with this extension, simplifying SQL-based vector queries into intuitive Python functions.
• For local development on macOS, the host emphasizes the utility of postgres.app for quick, container-like database management.

Load Testing with Locust and Grasshopper

For performance testing, the episode reviews Grasshopper, a library built on top of Locust.
Grasshopper introduces features like custom performance trends, timing thresholds, and deep integration with PyTest.
• It enables "tag-based suites," allowing teams to monitor performance regressions across different versions of their software.
• The tool supports complex user action tracking, which involves measuring multiple API requests as a single user interaction.

iOS Integration with Pythonista

Finally, the podcast explores using Pythonista on iOS to create tools like MemoCast. This allows users to share podcast show note links directly to a reminder app. It serves as a creative example of using Python to build scriptable GUIs and automate OS-level tasks.

Topics

Chapters

5 chapters
Python Bytes
AI chat — answers grounded in episodes