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

#372: uv - an impressive pip alternative

Published Tue, Feb 20, 2024, recorded Tue, Feb 20, 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 11am PT. Older video versions available there too.

First, we are likely skipping next week folks. I’ll be at PyCon Philippines.

Brian #1: uv: Python packaging in Rust

  • Suggested by Collin Sullivan
  • “uv is designed as a drop-in replacement for pip and pip-tools”
  • Intended to support the pip and pip-tools APIs, just use uv pip instead.
  • Oh yeah, also replaces venv and virtualenv.
  • And it’s super zippy, as you would expect.
  • I’m still getting used to it
    • uv pip venv didn’t have --prompt at first. But that’s fixed. should get released soon.
      • first thing I tried
    • uv pip install ./ and uv pip install pytest
      • second. worked awesome
    • uv pip list
      • third thing I tried
      • not there either, but uv pip freeze is similar.
      • Issue already filed
  • Seriously, I’m excited about this. It’s just that it seems I wasn’t the target workflow for this.
  • See also

Michael #2: jpterm

  • via David Brochart
  • jpterm is a JupyterLab-like environment running in the terminal.
  • What sets jpterm apart is that it builds on the shoulders of giants, one of which is Textual.
  • It is designed similarly to JupyterLab, where everything is a plugin.

Brian #3: Everything You Can Do with Python's textwrap Module

  • Martin Heinz
  • Nice quick demo of one of my favorite builtin modules.
  • Features
    • shorten text and insert placeholders
    • wrap can split lines to the same length
      • but can also just split a string into equal chunks for batch processing
    • TextWrapper class does all sorts of fancy stuff.
    • dedent is my fave. Awesome for including a multiline string in a test function as an expected outcome.

Michael #4: HTML First

Extras

Brian:

  • pytest 8.0.1 released. Fixes the parametrization order reversal I mentioned a couple episodes ago, plus some other fixes.
  • Learn about dependency injection from Hynek
  • If you want to jump into some Rust to help speed up Python tools, maybe check out yarr.fyi
    • I just interviewed Nicole, the creator, for Python Test, and this looks pretty cool
    • Her episode should come out in a couple of weeks.
  • Ramping up more interviews for Python People. So please let me know if you’d like to be on the show or if you have suggestions for people you’d like me to interview.
  • Also, I know this is weird, some people are still on X, and not like “didn’t close their account when they left”, but actually still using it. This is ironically a reverse of X-Files. “I don’t want to believe”. However, I’ve left my account open for those folks. I check it like twice a month. But eventually I’ll see it if you DM me. But really, there are easier ways to reach me.

Michael:

Joke: Yeti tumbler


Want to go deeper? Check our projects