Python Bytes

Auteur(s): Michael Kennedy and Brian Okken
  • Résumé

  • Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.
    Copyright 2016-2025
    Voir plus Voir moins
Épisodes
  • #419 Is your back end popular?
    Feb 4 2025
    Topics covered in this episode: content-types package for better MIME types/Content-TypeWagtail 6.4Build It YourselfBuild backend popularity over timeExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @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 but ImportError: 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-types A 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-tasks which 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.Results setuptools: ~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 commentary This 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 page Old method was 30 episodes per pageFor something completely different NameGrapher - 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.
    Voir plus Voir moins
    30 min
  • #418 I'm a tea pot
    Jan 27 2025
    Topics covered in this episode: In memoriam: Michael Foord 1974-2025Valkey (Redis Replacement)30 best practices for software development and testingmimetype.ioExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @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 gems 1 - 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.io Extras Brian: Python 1.0.0 released 31 years ago Michael: Python 3.14.0 alpha 4 is out Joke: Tea Time
    Voir plus Voir moins
    20 min
  • #417 Bugs hide from the light
    Jan 21 2025
    Topics covered in this episode: LLM CatcherOn PyPI Quarantine processRESPXUnpacking kwargs with custom objectsExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @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 .Features Exception 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 file Brian #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.However Since 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 fixture Brian #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 - Hugovk Top 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!
    Voir plus Voir moins
    24 min

Ce que les auditeurs disent de Python Bytes

Moyenne des évaluations de clients

Évaluations – Cliquez sur les onglets pour changer la source des évaluations.