We're sunsetting PodQuest on 2025-07-28. Thank you for your support!
Export Podcast Subscriptions
cover of episode #425 If You Were a Klingon Programmer

#425 If You Were a Klingon Programmer

2025/3/24
logo of podcast Python Bytes

Python Bytes

AI Deep Dive AI Chapters Transcript
People
B
Brian
Python 开发者和播客主持人,专注于测试和软件开发教育。
M
Michael
帮助医生和高收入专业人士管理财务的金融教育者和播客主持人。
Topics
Michael: 我认为很多人对`uv`存在误解,`uv`是一个很棒的工具,它可以替代`pip`/`pyenv`,并且比`python -m venv`更好用。它可以自动安装Python,无需预先安装,并且速度非常快。它可以将虚拟环境放在项目文件夹中,虽然这可能与某些公司政策冲突,但可以通过环境变量进行配置。许多人因为懒惰或对新工具的不信任而没有使用`uv`,但`uv`的优势在于它可以简化工作流程,提高效率。有些人尝试过类似的工具,但最终还是回到了`pip`和`pip-tools`,因为它们'好用'。`uv`有两种工作流程,一种类似于`poetry`或`hatch`,另一种更底层,类似于`pip`。`uv`允许在两种风格之间切换。有些人还在等待`dependabot`的支持,但实际上,如果使用`uv space pip compile`和`requirements.txt`文件,就可以获得`dependabot`的支持。 Brian: 我同意Michael的观点,`uv`是一个非常有用的工具。我个人也喜欢使用`uv`,因为它可以简化我的工作流程,提高我的效率。关于`uv`将虚拟环境放在项目文件夹中的问题,我理解这可能与某些公司政策冲突,但这可以通过环境变量进行配置。我也理解有些人因为懒惰或对新工具的不信任而没有使用`uv`,但这并不意味着`uv`不好用。`uv`的优势在于它可以简化工作流程,提高效率,并且它是一个开源项目,所以我们可以放心使用。

Deep Dive

Chapters
This chapter explores the reasons why Python developers might not be using UV, a tool that simplifies Python environment management. The discussion includes various responses from a Twitter thread, highlighting misconceptions and workflow preferences.
  • UV simplifies Python environment management, addressing issues like Python installation and virtual environment location.
  • Many developers express concerns about trust, workflow disruption, and the learning curve associated with adopting new tools.
  • UV offers flexibility in managing dependencies, allowing users to choose between project-level and low-level pip-style workflows.

Shownotes Transcript

Topics covered in this episode:

- **[Why aren't you using uv](https://x.com/mitsuhiko/status/1899928805742899231?featured_on=pythonbytes))?**

Watch on YouTube)

About the show

Brought to you by Posit Connect: pythonbytes.fm/connect).

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live) to be part of the audience. Usually Monday 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.

Michael #1: Why aren't you using uv)?

  • Fun conversation on X by Armin Ronacher).

  • Interesting quotes from the thread

  • I get it replaces pip/pyenv, but should I also use it instead of the built in 'python -m venv .venv'?

  • But I need python installed to make python programs?

  • Because it places the venv in the project folder and I can't run executables from there due to corporate policy. Many such cases. No idea why astral doesn't address this with more urgency.

  • Sounds like a bad corporate policy :)

  • i’m too lazy to switch from pyenv and pip

  • trust issues, what if they do a bait and switch …

  • Because everyone said that about poetry and I'm not sure I'm really ready to get hurt again.

  • Masochism

  • Many times I tried a lot of similar tools and always come back to pip and pip-tools. Them are just work, why should I spend my time for something "cool" that will bring more problems?

  • I tried this week but I was expecting a "uv install requests" instead of "uv add". Switched back to pipenv.

  • we partially use it. will transition when Dependabot support is available.

  • I’ll leave it with → Jared Scheel: Seeing a whole lotta Stockholm Syndrome in the replies to this question.

Brian #2: Python Developer Tooling Handbook)

  • Tim Hopper

  • “This is not a book about programming Python. Instead, the goal of this book is to help you understand the ecosystem of tools used to make Python development easier and more productive”

  • Covers tools related to packaging, linting, formatting, and managing dependencies.

Michael #3: Calling all doc writers: blacken-docs)

  • Run black on python code blocks in documentation files

  • You can also install blacken-docs as a pre-commit) hook.

  • It supports Markdown, reStructuredText, and LaTex files.

  • Additionally, you can run it on Python files to reformat Markdown and reStructuredText within docstrings.

Brian #4: Reinventing notebooks as reusable Python programs)

  • marimo allows you to store notebooks as plaintext Python files

  • properties

  • Git-friendly: small code change => small diff

  • easy for both humans and computers to read

  • importable as a Python module, without executing notebook cells

  • executable as a Python script

  • editable with a text editor

  • Also, … testing with pytest

  • “Because marimo notebooks are just Python files, they are interoperable with other tools for Python — including pytest. “

  • Testing cells. Any cell named as test_* is automatically discoverable and testable by pytest. The same goes for any cell that contains only test_ functions and Test classes.”

  • “Importantly, because cells are wrapped in functions, running pytest test_notebook.py doesn’t execute the entire notebook — just its tests.”

Extras

Brian:

Michael:

I'm sure some other Hacker News reader has already given you the feedback, but in the unlikely case that they haven't, You read those headlines in this segment exactly wrong.

“Ask HN: Who is hiring?" is a monthly post that asks employers to post about jobs they have available

“Ask HN: Who wants to be hired?” is a monthly topic where they ask people who are looking for jobs to post about themselves in the hope that their skillset it is a good match (and not an LLM generated resume)

So unfortunately your rosy analysis might need a less rosy interpretation.

Joke: