DiscoverPython Bytes#396 uv-ing your way to Python
#396 uv-ing your way to Python

#396 uv-ing your way to Python

Update: 2024-08-13
Share

Description

Topics covered in this episode:


Watch on YouTube


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:



Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

#396 uv-ing your way to Python

#396 uv-ing your way to Python

Michael Kennedy (@mkennedy)