Python Bytes cover art

Python Bytes

Written by: Michael Kennedy and Brian Okken
  • Summary

  • 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-2024
    Show more Show less
Episodes
  • #379 Constable on the debugging case
    Apr 16 2024
    Topics covered in this episode: How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project.difftasticQuartoconstableExtrasJokeExtrasJokeExtrasJokeWatch 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.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org 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. 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: How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project. by Stefanie MolinPre-commit hooks are code checks that run as part of the “pre-commit” stage of the git commit process. If any of these checks fail, git aborts the commitSometimes, we need to bypass the hooks temporarily. For these instances, we can pass the --no-verify option when we run git commit Brian #2: difftastic Found this a couple years ago, but really using it a lot now.Excellent structurally diff tool that compares code based on syntax, not line by line. Michael #3: Quarto via Mathias JohanssonAn open-source scientific and technical publishing systemTransforming a notebook into a pdf / HTML / MS Word / ePub with minimal effort, or even all formats at once.Author using Jupyter notebooks or with plain text markdown in your favorite editor.Write using Pandoc markdown, including equations, citations, crossrefs, figure panels, callouts, advanced layout, and more. Brian #4: constable “inserts print statements directly into the AST at runtime ““If you find yourself aimlessly adding print statements while debugging your code, this is for you. !”Add decorators like @constable.trace('a', 'b') to functions and you’ll get nice output showing when and how a and b changed.see also icecream for another fun debugging with print project. Extras Brian: pointers being added to the standard library A couple weeks old, but still worth coveringGuido’s take on adding this, "Why the hell not?" Michael: Python 3.12.3 is out Joke: Hugo SciFi Award
    Show more Show less
    20 mins
  • #378 Python is on the edge
    Apr 9 2024
    Topics covered in this episode: pacemaker - For controlling time per iteration loop in Python.PyPI suspends new user registration to block malware campaignPython Project-Local Virtualenv Management ReduxPython Edge Workers at CloudflareExtrasJokeExtrasJokeWatch 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.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org 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. 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: pacemaker - For controlling time per iteration loop in Python. Brandon RohrerGood example of a small bit of code made into a small package.With speedups to dependencies, like with uv, for example, I think we’ll see more small projects.Cool stuff Great README, including quirks that need to be understood by users. “If the pacemaker experiences a delay, it will allow faster iterations to try to catch up. Heads up: because of this, any individual iteration might end up being much shorter than suggested by the pacemaker's target rate.”Nice use of time.monotonic() deltas are guaranteed to never go back in time regardless of what adjustments are made to the system clock.Watch out for pip install pacemaker-lite NOT pacemakerpacemaker is taken by a package named PaceMaker with a repo named pace-maker, that hasn’t been updated in 3 years. Not sure if it’s alive. No tests (yet). I’m sure they’re coming. ;) Seriously though, Brandon says this is “a glorified snippet”. And I love the use of packaging to encapsulate shared code. Realistically, small snippet like packages have functionality that’s probably going to be tested by end user code.And even if there are tests, users should test the functionality they are depending on. Michael #2: PyPI suspends new user registration to block malware campaign Incident Report for Python InfrastructurePyPi Is Under Attack: Project Creation and User Registration Suspended — Here’s the details I hate medium, but it’s the best details I’ve found so far Brian #3: Python Project-Local Virtualenv Management Redux HynekConcise writeup of how Hynek uses various tools for dealing with environmentsCovers (paren notes are from Brian) In project .venv directoriesdirenv for handling .envrc files per project (time for me to try this again)uv for pip and pip-compile functionalityInstalling Python via python.orgUsing a .python-version-default file (I’ll need to play with this a bit) Works with GH Action setup-python. (ok. that’s cool)Some fish shell scriptingBonus tip on using requires-python in .pyproject.toml and extracting it in GH actions to be able to get the python exe name, and then be able to pass it to Docker and reference it in a Dockerfile. (very cool) Michael #4: Python Edge Workers at Cloudflare What are edge workers?Based on workers using Pyodide and WebAssemblyThis new support for Python is different from how Workers have historically supported languages beyond JavaScript — in this case, we have directly integrated a Python implementation into workerd, the open-source Workers runtime.Python Workers can import a subset of popular Python packages including FastAPI, Langchain, numpyCheck out the examples repo. Extras Michael: LPython follow up from Brian SkinnFeatured on Python Bytes badgeA little downtime, thanks for the understanding We were rocking a 99.98% uptime until then. :) Joke: C++ is not safe for people under 18Baseball joke
    Show more Show less
    31 mins
  • #377 A Dramatic Episode
    Apr 2 2024
    Topics covered in this episode: justpathxz back doorLPythondramaticExtrasJokeExtrasJokeExtrasJokeWatch on YouTube About the show Sponsored by ScoutAPM: pythonbytes.fm/scout Connect with the hosts Michael: @mkennedy@fosstodon.orgBrian: @brianokken@fosstodon.orgShow: @pythonbytes@fosstodon.org 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. 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: justpath Inspect and refine PATH environment variable on both Windows and Linux.Raw, count, duplicates, invalids, corrections, excellent stuff.Check out the video Brian #2: xz back door In case you kinda heard about this, but not really.Very short version: A Microsoft engineer noticed a performance problem with ssh and tracked it to a particular version update of xz.Further investigations found a multi-year installation of a fairly complex back door into the xz by a new-ish contributor. But still contributing over several years. First commit in early 2022.The problem is caught. But if it had succeeded, it would have been bad.Part of the issue of how this happened is due to having one primary maintainer on a very widely used tool included in tons-o-Linux distributions.Some useful articles Everything I Know About the XZ Backdoor - Evan Boehs - recommended readDon’t think your affected? Think again if you use homebrew, for example: Update and upgrade Homebrew and xz versionsNotes Open source maintenance burnout is realLots of open source projects are maintained by unpaid individuals for long periods of time.Multi-year sneakiness and social bullying is pretty hard to defend against.Handing off projects to another primary maintainer has to be doable. But now I think we need better tools to vet contributors. Maybe? Or would that just suppress contributions?One option to help with burnout: JGMM, Just Give Maintainers Money: Software Needs To Be More Expensive - Glyph Michael #3: LPython LPython aggressively optimizes type-annotated Python code. It has several backends, including LLVM, C, C++, and WASM. LPython’s primary tenet is speed.Play with the wasm version here: dev.lpython.orgStill in alpha, so keep that in mind. Brian #4: dramatic Trey HunnerMore drama in the software world. This time in the Python. Actually, this is just a fun utility to make your Python output more dramatic.More fun output with terminaltexteffects suggested by Allan Extras Brian: Textual how has a new inline feature in the new release. Michael: My keynote talk is out: The State of Python in 2024Have you browsed your github feed lately?3.10, 3.9, 3.8 security updates Joke: Definition of terms
    Show more Show less
    33 mins

What listeners say about Python Bytes

Average Customer Ratings

Reviews - Please select the tabs below to change the source of reviews.