Afleveringen
-
Topics covered in this episode:
Git Town solves the problem that using the Git CLI correctlyPEP 751 â A file format to record Python dependencies for installation reproducibility git-who and watchghaShare Python Scripts Like a Pro: uv and PEP 723 for Easy DeploymentExtrasJokeWatch on YouTubeAbout the show
Sponsored by Posit Package Manager: pythonbytes.fm/ppm
Connect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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: Git Town solves the problem that using the Git CLI correctly
Git Town is a reusable implementation of Git workflows for common usage scenarios like contributing to a centralized code repository on platforms like GitHub, GitLab, or Gitea. Think of Git Town as your Bash scripts for Git, but fully engineered with rock-solid support for many use cases, edge cases, and error conditions.Keep using Git the way you do now, but with extra commands to create various branch types, keep them in sync, compress, review, and ship them efficiently.Basic workflowCommands to create, work on, and ship features.git town hack - create a new feature branchgit town sync - update the current branch with all ongoing changesgit town switch - switch between branches visuallygit town propose - propose to ship a branchgit town ship - deliver a completed feature branchAdditional workflow commandsCommands to deal with edge cases.git town delete - delete a feature branchgit town rename - rename a branchgit town repo - view the Git repository in the browserBrian #2: PEP 751 â A file format to record Python dependencies for installation reproducibility
AcceptedFrom Brett CannonâPEP 751 has been accepted! This means Python now has a lock file standard that can act as an export target for tools that can create some sort of lock file. And for some tools the format can act as their primary lock file format as well instead of some proprietary format.âFile name: pylock.toml or at least something that starts with pylock and ends with .tomlItâs exciting to see the start of a standardized lock fileMichael #3: git-who and watchgha
git-who is a command-line tool for answering that eternal question: Who wrote this code?!Unlike git blame, which can tell you who wrote a line of code, git-who tells you the people responsible for entire components or subsystems in a codebase. You can think of git-who sort of like git blame but for file trees rather than individual files.And watchgha - Live display of current GitHub action runs by Ned Batchelder
Brian #4: Share Python Scripts Like a Pro: uv and PEP 723 for Easy Deployment
Dave JohnsonNice full tutorial discussing single file Python scripts using uv with external dependencies Starting with a script with dependencies.Using uv add --script [HTML_REMOVED] [HTML_REMOVED] to add a /// script block to the topUsing uv runAdding #!/usr/bin/env -S uv run --script shebangEven some Windows adviceExtras
Brian:
April 1 pranks done wellBREAKING: Guido van Rossum Returns as Pythonâs BDFLincludingBrett Cannon noted as âFamous Python QuotationistâGuido taking credit for âI came for the language but I stayed for the communityâ which was from Brettthen Brettâs title of âFamous Python Quotationistâ is crossed out.Barry Warsaw asking Guido about releasing Python 2.8Barry is the FLUFL, âFriendly Language Uncle For Life âMariatta canât get Guido to respond in chat until she addresses him as âmy lordâ.â⊠becoming one with whitespace.ââIndentation is Enlightenmentâ Upcoming new keyword: maybeLike âifâ but more Pythonicas in Maybe: print("Python The Documentary - Coming This Summer!")Iâm really hoping there is a documentaryApril 1 pranks done poorlyNote: pytest-repeat works fine with Python 3.14, and never had any problemsIf you have to explain the joke, maybe itâs not funny.The explanationpi, an irrational number, as in it cannot be expressed by a ratio of two integers, starts with 3.14159 and then keeps going, and never repeats.Python 3.14 is in alpha and people could be testing with it for packagesTest & Code is doing a series on pytest pluginspytest-repeat is a pytest plugin, and it happened to not have any tests for 3.14 yet.Now the âjokeâ. I pretended that I had tried pytest-repeat with Python 3.14 and it didnât work.Test & Code: Python 3.14 won't repeat with pytest-repeatThus, Python 3.14 wonât repeat.Also I mentioned that there was no ârationalâ explanation.And pi is an irrational number.Michael:
pysqlscribe v0.5.0 has the âparse create scriptsâ feature I suggested!Markdown follow upPrettier to format Markdown via HugoBeen using mdformat on some upcoming projects including the almost done Talk Python in Production book. Command I like is mdformat --number --wrap no ./uv tool install --with is indeed the pipx inject equivalent, but requires multiple --with's:pipx inject mdformat mdformat-gfm mdformat-frontmatter mdformat-footnote mdformat-gfm-alertsuv tool install mdformat --with mdformat-gfm --with mdformat-frontmatter --with mdformat-footnote --with mdformat-gfm-alertsuv follow upFrom James FalconAs a fellow uv enthusiast, I was still holding out for a use case that uv hasn't solved. However, after last week's episode, you guys finally convinced me to switch over fully, so I figured I'd explain the use case and how I'm working around uv's limitations.I maintain a python library supported across multiple python versions and occasionally need to deal with bugs specific to a python version. Because of that, I have multiple virtualenvs for one project. E.g., mylib38 (for python 3.8), mylib313 (for python 3.13), etc. I don't want a bunch of .venv directories littering my project dir.For this, pyenv was fantastic. You could create the venv with pyenv virtualenv 3.13.2 mylib313, then either activate the venv with pyenv activate mylib313 and create a .python-version file containing mylib313 so I never had to manually activate the env I want to use by default on that project.uv doesn't have a great solution for this use case, but I switched to a workflow that works well enough for me:Define my own central location for venvs. For me that's ~/vCreate venvs with something like uv venv --python 3.13 ~/v/mylib313Add a simple function to my bashrc:`workon() { source ~/v/$1/bin/activate } \ so now I can run \workon mylib313orworkon mylib38when I need to work in a specific environment. uv's.python-version` support works much differently than pyenv's, and that lack of support is my biggest frustration with this approach, but I am willing to live without it.Do you Firefox but not Zen? You can now make pure Firefox more like Zenâs / Arcâs layout.Joke: So here it will stay
See the follow up thread too!Also: Guido as Lord Python via Nick Muoh -
Topics covered in this episode:
mdformatpre-commit-uvPEP 758 and 781Serie: rich git commit graph in your terminal, like magic ExtrasJokeWatch on YouTubeAbout the show
Sponsored by Posit Connect Cloud: pythonbytes.fm/connect-cloud
Connect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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.
Brian #1: mdformat
Suggested by Matthias SchöttleLast episode Michael covered blacken-docs, and I mentioned itâd be nice to have an autoformatter for text markdown.Matthias delivered with suggesting mdformatâMdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files.âA python project that can be run on the command line.Uses a style guide I mostly agree with.Iâm not a huge fan of numbered list items all being â1.â, but that can be turned off with --number, so Iâm happy.Converts underlined headings to #, ##, etc. headings.Lots of other sane conventions.The numbering thing is also sane, I just think it also makes the raw markdown hard to read.Has a plugin system to format code blocksMichael #2: pre-commit-uv
via Ben FalkUse uv to create virtual environments and install packages for pre-commit.Brian #3: PEP 758 and 781
PEP 758 â Allow except and except* expressions without parenthesesacceptedPEP 781 â Make TYPE_CHECKING a built-in constantdraft statusAlso, PEP Index by Category kinda rocksMichael #4: Serie: rich git commit graph in your terminal, like magic
While some users prefer to use Git via CLI, they often rely on a GUI or feature-rich TUI to view commit logs. Others may find git log --graph sufficient.GoalsProvide a rich git log --graph experience in the terminal.Offer commit graph-centric browsing of Git repositories.Extras
Michael:
Sunsetting Search? (Startpage)Ruff in or out?Joke: Wishing for wishes
-
Zijn er afleveringen die ontbreken?
-
Topics covered in this episode:
Why aren't you using uv?Python Developer Tooling HandbookCalling all doc writers: blacken-docsReinventing notebooks as reusable Python programsExtrasJokeWatch on YouTubeAbout the show
Brought to you by Posit Connect: pythonbytes.fm/connect.
Connect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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 threadI 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 piptrust 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.MasochismMany 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 filespropertiesGit-friendly: small code change => small diffeasy for both humans and computers to readimportable as a Python module, without executing notebook cellsexecutable as a Python scripteditable with a text editorAlso, ⊠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:
PyConUS announces Refund Policy for International AttendeesNew format now live for The Complete pytest Course Bundle and component coursesEach course now available separately alsopytest Primary Power is 13 lessons, 3.9 hoursUsing pytest with Projects, 10 lessons, 3.4 hourspytest Booster Rockets, 6 lessons, 1.3 hours of contentNew format is easier to navigateBetter for people who like different speeds. Iâm usually a 1.25x-1.5x speed person.Now also with Congratulations! lessons (with fireworks) and printable certificates.Michael:
PyCon Taiwan is currently calling for proposalsHN trends follow up via ShinjitsuI'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 postabout jobs they have available
âAsk HN: Who wants to be hired?â is a monthly topic where they askpeople who are looking for jobs to post about themselves in the hopethat their skillset it is a good match (and not an LLM generated resume)
So unfortunately your rosy analysis might need a less rosyinterpretation.
Joke:
Top 12 things likely to be overheard if you had a Klingon ProgrammerFrom Holgi on Mastodon -
Topics covered in this episode:
The weird quirk with rounding in PythonPython interpreter adds tail callsRemove punctuation from a string with translate and maketransExtra, extra, extraExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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.
Brian #1: The weird quirk with rounding in Python
Tom Nijhof-VerheesbWith numbers ending in .5, Python always rounds to an even number.round(0.5) â 0round(1.5) â 2etcThis follows IEEE 754You can use decimal if you need a different behavior.Michael #2: Python interpreter adds tail calls
Ken Jin, a member of the project, has merged a new set of changes that have been benchmarked as improving performance by 10% for some architectures."Speedup is roughly equal to 2 minor CPython releases worth of improvements. For example, CPython 3.12 roughly sped up by 5%.âBrian #3: Remove punctuation from a string with translate and maketrans
RodrigoâDon't use the method replace to remove punctuation from a Python string. Instead, use the method translate.âMichael #4: Extra, extra, extra
Animation v Coding, hello world to transformersTypeScript rewritten in GoFirefox liesPyConâs Startup RowPython in Production BookExtras
Joke: Startrek Testing
-
Topics covered in this episode:
pysqlscribeA map of PythonRust, C++, and Python trends in jobs on Hacker News (February 2025)The features of Python's help() functionExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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: pysqlscribe
A Python library intended to make building SQL queries in your code a bit easier.A Query object can be constructed using the QueryRegistry's get_builder featuring a dialect (e.g; "mysql", "postgres", "oracle").Brian #2: A map of Python
Cool visualization of dependencies in PyPI packagesEven cooler visualization (linked from main article)Michael #3: Rust, C++, and Python trends in jobs on Hacker News (February 2025)
Interesting supply and demand comparisons from at least on source.Brian #4: The features of Python's help() function
Trey HunnerDonât forget how useful and cool help() is.Extras
Michael:
Granian works with FastAPI againJoke: Computer engineer vs. Geologist
-
Topics covered in this episode:
My 2025 uv-based Python Project Layout for Production AppsaiolimiterA peek into a possible future of Python in the browserReloadiumExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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.
Brian #1: My 2025 uv-based Python Project Layout for Production Apps
Hynek SchlawackDiscusses uv, a simple pyproject.toml, a simple project layout, and uv.lock as the modern way to ditch requirements.txt filesThis is the starting video in a series, but itâs already very worthwhileMichael #2: aiolimiter
An efficient implementation of a rate limiter for asyncio.This project implements the Leaky bucket algorithm, giving you precise control over the rate a code section can be entered.Brian #3: A peek into a possible future of Python in the browser
a.k.a âSecret SPy StuffâĆukasz LangaA peek at SPy, a new language for Python on the web.Michael #4: Reloadium
Hot Reloading and Profiling for PythonIf you are a PyCharm user please check out Reloadium pluginSee also: github.com/mikeckennedy/server-hot-reloadExtras
Brian:
Making an alternate version of The Complete pytest CourseMichael:
Book: Zero Day: A Jeff Aiken NovelWarp terminal on Windows is out.PyCon Ed Summit announced.Joke: py programmer walks into a bar
-
Topics covered in this episode:
httpdbgPyPI Now Supports iOS and Android Wheels for Mobile Python DevelopmentArcade Game Platform goes 3.0PEP 765 â Disallow return/break/continue that exit a finally blockExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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: httpdbg
A tool for Python developers to easily debug the HTTP(S) client requests in a Python program.To use it, execute your program using the pyhttpdbg command instead of python and that's it. Open a browser to http://localhost:4909 to view the requestsBrian #2: PyPI Now Supports iOS and Android Wheels for Mobile Python Development
Sara Goodingâthe Python Packaging Index (PyPI) has officially begun accepting and distributing pre-compiled binary packages, known as "wheels," for both iOS and Android platforms. âNext up, âcibuildwheel Updates Are in Progress to Simplify iOS and Android Wheel CreationâMichael #3: Arcade Game Platform goes 3.0
via Maic SiemeringThis is our first major release since 2022.It keeps the beginner-friendly API while adding power and efficiency.Arcade now supports both standard OpenGL and ShaderToy (www.shadertoy.com) a-shaders through a compatibility layer.Since 3.0 is a major release, the full list of changes is over ingithub.com/pythonarcade/arcade/blob/development/CHANGELOG.mdBrian #4: PEP 765 â Disallow return/break/continue that exit a finally block
Accepted for Python 3.14I wouldnât have thought to do this anyway, but itâs weird, so donât.Will become a SyntaxWarning catchable by running with -WeExtras
Brian:
Correction: Niki Tonsky was originator of âPride Versioningâ. Thanks NikitaCorrection: Scheme is actually awesome. Brian is just a curmudgeonAlso: pytest-rerunfailures is good for exposing flaky testsAnd apparently me being wrong was a great to get at least one person to blog more.Cheers Filip ĆajszczakMichael:
Tea pot follow upWhile you're right that some software actually had this implemented, Python does not. It's not an officially accepted HTTP status code, it was proposed in a 'joke' RFC. I guess Python - even though its name comes from the funny TV series Monty Python - is not so funny. httpx, your (or at least -my-) favorite HTTP module for python, does have the I_AM_A_TEAPOT constant.By the way, there are some HTTP status codes that changed their names in RFC 9110, for instance, http.HTTPStatus.UNPROCESSABLE_CONTENT (422, previously UNPROCESSABLE_ENTITY)Pride follow up fosstodon.org/@kytta/114034442981727301Time to upgrade your mini?Joke: How old is she?
-
Topics covered in this episode:
PEP 772 â Packaging governance processOfficial Django MongoDB Backend Now Available in Public PreviewDeveloper PhilosophyPython 3.13.2 releasedExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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.
Brian #1: PEP 772 â Packaging governance process
draft, created 21-Jan, by Barry Warsaw, Deb Nicholson, Pradyun GedamâAs Python packaging has matured, several interrelated problems with the current way of managing the technical development, decision making and processes have become apparent.ââThis PEP proposes a Python Packaging Council with broad authority over packaging standards, tools, and implementations. Like the Python Steering Council, the Packaging Council seeks to exercise this authority as rarely as possible; instead, they use this power to establish standard processes.âPEP discussesPyPA, Packaging-WG, Interoperability Standards, Python Steering Council, and Expectations of an elected Packaging CouncilA specification withComposition: 5 peopleMandate, Responsibilities, Delegations, Process, Terms, etc.Michael #2: Official Django MongoDB Backend Now Available in Public Preview
Over the last few years, Django developers have increasingly used MongoDB, presenting an opportunity for an official MongoDB-built Python package to make integrating both technologies as painless as possible.FeaturesThe ability to use Django models with confidence. Developers can use Django models to represent MongoDB documents, with support for Django forms, validations, and authentication.Django admin support. The package allows users to fire up the Django admin page as they normally would, with full support for migrations and database schema history.Native connecting from settings.py. Just as with any other database provider, developers can customize the database engine in settings.py to get MongoDB up and running.MongoDB-specific querying optimizations. Field lookups have been replaced with aggregation calls (aggregation stages and aggregate operators), JOIN operations are represented through $lookup, and itâs possible to build indexes right from Python.Limited advanced functionality. While still in development, the package already has support for time series, projections, and XOR operations.Aggregation pipeline support. Raw querying allows aggregation pipeline operators. Since aggregation is a superset of what traditional MongoDB Query API methods provide, it gives developers more functionality.Brian #3: Developer Philosophy
by qntmIntended as âadvice for junior developers about personal dev philosophyâ, I think these are just great tips to keep in mind.The itemsAvoid, at all costs, arriving at a scenario where the ground-up rewrite starts to look attractiveThis is less about âdonât do rewritesâ, but about noticing the warning signs ahead of time.Aim to be 90% done in 50% of the available timeGreat quote: âThe first 90% of the job takes 90% of the time. The last 10% of the job takes the other 90% of the time.âAutomate good practicesThink about pathological dataâNobody cares about the golden path. Edge cases are our entire job.âBrianâs note: But also think about the happy path. Documenting and testing what you think of as the happy path is a testing start and helps others understand your idea of how things are supposed to work.Thereâs usually a simpler way to write itWrite code to be testableIt is insufficient for code to be provably correct; it should be obviously, visibly, trivially correctBrianâs note: Even if itâs obviously, visibly, trivially correct, it will still break. So test it anyway.Michael #4: Python 3.13.2 released
Python 3.13âs second maintenance release. About 250 changes went into this updateAlso Python 3.12.9, Python 3.12âs ninth maintenance release already. Just 180 changes for 3.12, but itâs still worth upgrading.For us, itâs simply rebuilding our Docker base (i.e. âno-cache) with these lines:RUN curl -LsSf https://astral.sh/uv/install.sh | shRUN --mount=type=cache,target=/root/.cache uv venv --python 3.13 /venvExtras
Brian:
Still thinking about pytest plugins a lot.The top pytest plugin listHas been updated for FebIs starting to include things without âpytestâ in the name, like Hypothesis and Syrupy. Eventually Iâll have to add âlooking at trove classifiersâ as part of the search, but for now, let me know if youâre favorite is missing.Includes T&C podcast episode links if Iâve covered it on the show. Thereâs 2 so farMichael:
There's a new release of PyScript out. All the details are here: Highlight is new PyGame-CE support. Go play!PEP 2026 â Calendar versioning for Python rejected. :(PEP 759 â External Wheel Hosting withdrawnJoke:
Pride Versioning -
Topics covered in this episode:
content-types package for better MIME types/Content-TypeWagtail 6.4Build It YourselfBuild backend popularity over timeExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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: content-types package for better MIME types/Content-Type
It started with this comment from Raf.mimetypes â Map filenames to MIME typesIt is oddly missing very common types and varies by platform, OS install and other factors (see this function).Search around and found python-magic. Seems great butImportError: failed to find libmagic. Check your installation â brew install libmagicmagic.from_file("testdata/test.pdf") â FileNotFoundError: [Errno 2] No such file or directory: 'testdata/test.pdf'hmmSo I had to create my own. Introducing content-typesA Python library to map file extensions to MIME types.Unlike other libraries, this one does not try to access the file or parse the bytes of the file or stream. It just looks at the extension.Better support than mimetypes builtin.Brian #2: Wagtail 6.4
Release notesLots of great updates, but I want to zoom in on background tasks.6.4 includes django-taskswhich is an available implementation of DEP 0014: Background workers This proposal is accepted and this thread includes a great talk from DjangoCon Europe 2024Why is this cool?Even though django-tasks says itâs âunder active developmentâ, as long as you pin the version and test your behavior depending on this, it must be ready to use if wagtail is going for it. Don't you think?Michael #3: Build It Yourself
from Armin Ronacher, sent in by Rafael WeingartnerAn excellent article pushing back on too many dependenciesMaybe the advice of always prefer code reuse isnât that great after all?Itâs much much easier to solve small little problems these days due to AI.Take Postmark as an example.
âIt's time to have a new perspective: we should give kudos to engineers who write a small function themselves instead of hooking in a transitive web of crates. We should be suspicious of big crate graphs. Celebrated are the minimal dependencies, the humble function that just quietly does the job, the code that doesn't need to be touched for years because it was done right once.â - Armin
Brian #4: Build backend popularity over time
Bastian VenthurThis is just for projects using pyproject.tomlApparently he did this last year as well, so we can see some trends.Resultssetuptools: ~50% (last year ~50%)poetry: ~30% (last year ~33%)hatchling: (percent not listed, but looks like 12-15%), (last year 10%)flit: ~5% (last year ~10%)other: (above flit now)Analysis:setuptools continues to grow in absolute numbers and maintain itâs percentage.poetry declininghatchling growingflit decliningBrian commentaryThis is not surprising to me. I generally use hatchling for more control, and setuptools for simple projects. I think we might end up with mostly setuptools and hatchling in a couple years.Extras
Brian:
Test & Code Archive is now all episodes on one pageOld method was 30 episodes per pageFor something completely differentNameGrapher - popularity of US namesNo wonder I donât meet a lot of kids named BrianMichael is #16 (#1 in 1950s - 1990s)Brian is #317 (#8 in 1970s)Joke: The long path to rejection.
-
Topics covered in this episode:
In memoriam: Michael Foord 1974-2025Valkey (Redis Replacement)30 best practices for software development and testingmimetype.ioExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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.
Brian #1: In memoriam: Michael Foord 1974-2025
Guido van Rossum and othersWeâve just lost Michael Foord this last weekend.From Guido:âMichael, an original thinker if there ever was one, started the tradition of having Language Summit events at PyCon, IIRC together with Barry Warsaw. He also wrote and contributed the influential mock library. ⊠â âPS. Feel free to post your own (positive) memories of meeting Michael â perhaps his children (10 and 13) will read them when theyâre older and this thread might help them remember their father.â Iâve added my memories. I think this is a great (and small) way to honor him.My friend Michael - Nicholas TolerveyAfter 5 years of trying, I did get an interview with Michael. I wish Iâd have gotten that followup.Test & Code episode with Michael, ep 145, âFor those about to mockâMichael #2: Valkey (Redis Replacement)
Thanks Calvin HPAn open source (BSD) high-performance key/value datastore that supports a variety of workloads such as caching, message queues.Can act as a primary database.Valkey can run as either a standalone daemon or in a cluster, with options for replication and high availability.Valkey natively supports a rich collection of datatypes, including strings, numbers, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs and more. You can operate on data structures in-place with an expressive collection of commands.Brian #3: 30 best practices for software development and testing
Michael Foord (from 2017)Some gems1 - YAGNI6 - Unit tests test to the unit of behavior, not the unit of implementation. 8 - Code is the enemy: It can go wrong, and it needs maintenance. Write less code. Delete code. Donât write code you donât need.15 - The more you have to mock out to test your code, the worse your code is.and so many more âŠMichael #4: mimetype.io
Iâm always forgetting content types!Also, shout out to httpstatuses.ioExtras
Brian:
Python 1.0.0 released 31 years agoMichael:
Python 3.14.0 alpha 4 is outJoke: Tea Time
-
Topics covered in this episode:
LLM CatcherOn PyPI Quarantine processRESPXUnpacking kwargs with custom objectsExtrasJokeWatch on YouTubeAbout the show
Sponsored by us! Support our work through:
Our courses at Talk Python TrainingThe Complete pytest CoursePatreon SupportersConnect with the hosts
Michael: @[email protected] / @mkennedy.codes (bsky)Brian: @[email protected] / @brianokken.bsky.socialShow: @[email protected] / @pythonbytes.fm (bsky)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: LLM Catcher
via Pat DeckerLarge language model diagnostics for python applications and FastAPI applications .FeaturesException diagnosis using LLMs (Ollama or OpenAI)Support for local LLMs through OllamaOpenAI integration for cloud-based modelsMultiple error handling approaches:Function decorators for automatic diagnosisTry/except blocks for manual controlGlobal exception handler for unhandled errors from imported modulesBoth synchronous and asynchronous APIsFlexible configuration through environment variables or config fileBrian #2: On PyPI Quarantine process
Mike FiedlerProject Lifecycle Status - Quarantine in his "Safety & Security Engineer: First Year in Review postâ Some more info now in Project QuarantineReports of malware in a project kick things offAdmins can now place a project in quarantine, allowing it to be unavailable for install, but still around for analysis.New process allows for packages to go back to normal if the report is false.HoweverSince August, the Quarantine feature has been in use, with PyPI Admins marking ~140 reported projects as Quarantined.Of these, only a single project has exited Quarantine, others have been removed.Michael #3: RESPX
Mock HTTPX with awesome request patterns and response side effects A simple, yet powerful, utility for mocking out the HTTPX, and HTTP Core, libraries.Start by patching HTTPX, using respx.mock, then add request routes to mock responses.For a neater pytest experience, RESPX includes a respx_mock fixtureBrian #4: Unpacking kwargs with custom objects
RodrigoA class needs to have a keys() method that returns an iterable.a __getitem__() method for lookupThen double splat ** works on objects of that type.Extras
Brian:
A surprising thing about PyPI's BigQuery data - HugovkTop PyPI Packages (and therefore also Top pytest Plugins) uses a BigQuery datasetHas grabbed 30-day data of 4,000, then 5,000, then 8,000 packages.Turns out 531,022 packages (amount returned when limit set to a million) is the same cost.SoâŠ. hoping future updates to these âTop âŠâ pages will have way more data. Also, was planning on recording a Test & Code episode on pytest-cov today, but havenât yet. Hopefully at least a couple of new episodes this week.Finally updated pythontest.com with BlueSky links on home page and contact page.Michael:
Follow up from Owen (uv-secure):Thanks for the multiple shout outs! uv-secure just uses the PyPi json API at present to query package vulnerabilities (same as default source for pip audit). I do smash it asynchronously for all dependencies at once... but it still takes a few seconds.Joke: Bugs hide from the light!
-
Topics covered in this episode:
Terminals & ShellsWinloop: An Alternative library for uvloop compatibility with windowsRuff & uvuv-secureExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/416 -
Topics covered in this episode:
dbos-transact-pyTyped Python in 2024: Well adopted, yet usability challenges persistRightTyperLazy self-installing Python scripts with uvExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/415 -
Topics covered in this episode:
New project to shorten django-admin to django because we are not monstersdjango-unicorn: The magical reactive component framework for Django Testing some tidbitsThe State of Python 2024 articleExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/414 -
Topics covered in this episode:
jiterA new home for python-build-standalonemoka-pyuv: An In-Depth GuideExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/413 -
Topics covered in this episode:
Loop targetsasyncstdlibBagels: TUI Expense Trackerrloop: An AsyncIO event loop implemented in RustExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/412 -
Topics covered in this episode:
Talk Python rewritten in QuartPyPI now supports digital attestationsDjango Rusty TemplatesPEP 639 is now supported by PYPIExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/411 -
Topics covered in this episode:
Thoughts on Djangoâs CorefuturepoolDon't return named tuples in new APIsZiglang: Migrating from AWS to Self-HostingExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/410 -
Topics covered in this episode:
terminal-treeposting: The API client that lives in your terminalExtra, extra, extraUV does everything or enough that I'm not sure what else it needs to doExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/409 -
Topics covered in this episode:
GitHub action security: zizmorPython is now the top language on GitHubPython 3.13, what didn't make the headlinesPyCon US 2025ExtrasJokeSee the full show notes for this episode on the website at pythonbytes.fm/408 - Laat meer zien