Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book

#396: uv-ing your way to Python

Published Tue, Aug 13, 2024, recorded Tue, Aug 13, 2024
Watch this episode on YouTube
Play on YouTube
Watch the live stream replay

About the show

Sponsored by ScoutAPM: pythonbytes.fm/scout

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 10am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Brian #1: uv venv --python & uv python

  • I was reading this article Python Packaging is Great Now: uv is all you need
  • It’s a little too “look, a silver bullet” for me, but it did point out some cool uv stuff I didn’t know about.
    • uv venv venv --python 3.12 creates a virtual environment with Python 3.12,
      • even if you didn’t have 3.12 installed on your system already.
      • If it doesn’t work, try adding --python-preference managed
    • uv python list shows all the python versions on your computer
    • There’s quite a few “experimental features”
      • run Run a command or script (experimental)
      • init Create a new project (experimental)
      • add Add dependencies to the project (experimental)
      • remove Remove dependencies from the project (experimental)
      • sync Update the project's environment (experimental)
      • lock Update the project's lockfile (experimental)
      • tree Display the project's dependency tree (experimental)
      • tool Run and manage tools provided by Python packages (experimental)
      • python Manage Python versions and installations (experimental)
  • uv add --dev pytest will add pytest to your dev dependencies.
  • uv tree rocks
  • uv might not have “solved packaging” (or maybe it might have)
    • but it sure is fun to watch the experimentation of different workflows.

Michael #2: Python 3.12.5 released

Brian #3: Compile and use dependencies for multiple Python versions in Tox

  • Viktor Rimark
  • Cool idea to use the {envname}, which specifies the tox environment, in the name of a requirements-dev.txt file name.
  • Then add a requirements tox target to generate pip-compile-ed files.
  • Now I gotta try doing all of this with uv lock
  • Then we need everyone to mod their tools to comply with PEP 571, when/if it’s adopted (covered it last week)

Michael #4: Catalog of Dark Patterns

  • Including
    • Bait and Switch
    • Confirm Shaming
    • Disguised Ads
    • Roach Motel
    • Fake Scarcity

Extras

Brian:

  • Recording of Hello, pytest! is done. Editing now. On track for the 19th (or before).

Michael:

Joke:


Want to go deeper? Check our projects