Episode 93: Launching Python, Virtual Environments, and Locking Dependencies With Brett Cannon
The Real Python Podcast
Jan 14, 2022 50m
Would you like a simple command to launch your Python programs using the newest version of the language installed on your machine? This week on the show, we continue our conversation with Brett Cannon. Brett discusses his project, the Python Launcher for Unix.
Episode Sponsor:
We dive into Brett’s workflow to set up projects, virtual environments, and prepare for distribution. He shares some of the tools he employs and reasons for keeping things simple.
We also talk about PEP 665, which specifies a file format to list an application’s Python package installation requirements. Brett shares why he co-authored the PEP and a bit of the community’s reaction. It leads to a deeper conversation about going beyond ‘requirements.txt’ to lock files.
Course Spotlight: Data Visualization Interfaces in Python With Dash
In this course, you’ll learn how to build a dashboard using Python and Dash. Dash is a framework for building data visualization interfaces. It helps data scientists build fully interactive web applications quickly.
Topics:
- 00:00:00 – Introduction
- 00:01:43 – Python Launcher for Unix
- 00:09:36 – Hiding a virtual environment directory
- 00:13:30 – Sponsor: Scout APM
- 00:14:17 – Environment managers and being an editor vs an IDE person
- 00:17:32 – PEP 665, lock files, and Brett’s dependency workflow
- 00:20:56 – The hurdles of source distributions and version control repositories
- 00:25:07 – Drawbacks of requirements files and standardizing lock files
- 00:28:19 – Why PEP 665 is controversial and the changes to setuptools
- 00:33:48 – Video Course Spotlight
- 00:35:16 – Are these examples of growing pains?
- 00:37:51 – Unfair comparisons to packaging in Rust or other languages
- 00:42:35 – What are you excited about in the world of Python?
- 00:43:54 – What do you want to learn next?
- 00:49:23 – Thanks and goodbye
Show Links:
- Introducing the Python Launcher for Unix
- brettcannon/python-launcher: Python launcher for Unix
- Python Extension for VSCode
- Why use Flit? — Flit 3.5.1 documentation
- pip-tools: A set of tools to keep your pinned Python dependencies fresh.
- PEP 665 – A file format to list Python dependencies for reproducibility of an application | Python.org
- venv — Creation of virtual environments — Python 3.10.1 documentation
- virtualenvwrapper · PyPI
- pdm - Python Development Master · PyPI
- pyflow - Streamlines working with Python projects and files · PyPI
- pipenv · PyPI
- Thoughts on where tools fit into a workflow
- What to do when you botch a release on PyPI
- Python Virtual Environments: A Primer – Real Python
- Why you shouldn’t invoke setup.py directly | Paul Ganssle
- python-wasm: Build scripts and configuration for building CPython for Emscripten
- Pyodide — A Python distribution for the browser and Node.js based on WebAssembly
- WebAssembly
- Programming Rust, 2nd Edition
- Brett Cannon on Twitter: “PEP 665 got rejected today 😞”