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

#369: The Readability Episode

Published Tue, Jan 30, 2024, recorded Tue, Jan 30, 2024
Watch this episode on YouTube
Play on YouTube
Watch the live stream replay

About the show

Sponsored by us! Support our work through:

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.

Michael #1: Granian

  • via Andy Shapiro and Bill Crook
  • A Rust HTTP server for Python applications.
  • Granian design goals are:
    • Have a single, correct HTTP implementation, supporting versions 1, 2 (and eventually 3)
    • Provide a single package for several platforms
    • Avoid the usual Gunicorn + uvicorn + http-tools dependency composition on unix systems
    • Provide stable performance when compared to existing alternatives
  • Could use better logging
  • Originates from the Emmett framework.

Brian #2: pytest 8 is here

  • Improved diffs:
    • Very verbose -vv is a colored diff, instead of a big chunk of red.
    • Python code in error reports is now syntax-highlighted as Python.
    • The sections in the error reports are now better separated.
    • Diff for standard library container types are improved.
    • Added more comprehensive set assertion rewrites for comparisons other than equality ==, with the following operations now providing better failure messages: !=, <=, >=, <, and >.
  • Improvements to -r for xfailures and xpasses
    • Report tracebacks for xfailures when -rx is set.
    • Report captured output for xpasses when -rX is set.
    • For xpasses, add - in summary between test name and reason, to match how xfail is displayed.
    • This one was important to me. Massively helps when checking/debugging xfail/xpass outcomes in CI. Thanks to Fabian Sturm, Bruno Oliviera, and Ran Benita for help to get this release.
  • Lots of other improvements
  • See full changelog for all the juicy details. And then upgrade and try it out!
  • pip install -U pytest

Michael #3: Assorted Docker Goodies

  • OrbStack
    • Say goodbye to slow, clunky containers and VMs
    • OrbStack is the fast, light, and easy way to run Docker containers and Linux. Develop at lightspeed with our Docker Desktop alternative.
  • Podman
    • Podman is an open source container, pod, and container image management engine. Podman makes it easy to find, run, build, and share containers.
      • Manage containers (not just Podman.)
      • Podman Desktop allows you to list, view, and manage containers from multiple supported container engines* in a single unified view.
      • Gain easy access to a shell inside the container, logs, and basic controls.
      • Works on Podman, Docker, Lima, kind, Red Hat OpenShift, Red Hat OpenShift Developer Sandbox.
  • CasaOS
    • Your Personal Cloud OS.
    • Community-based open source software focused on delivering simple personal cloud experience around Docker ecosystem.
    • Also have the ZimaCube hardware (Personal cloud. Re-invented.)

Brian #4: New GitHub Copilot Research Finds 'Downward Pressure on Code Quality'

  • David Ramel
  • Regarding “…the quality and maintainability of AI-assisted code compared to what would have been written by a human.”
  • Q: "Is it more similar to the careful, refined contributions of a Senior Developer, or more akin to the disjointed work of a short-term contractor?"
  • A: "We find disconcerting trends for maintainability. Code churn -- the percentage of lines that are reverted or updated less than two weeks after being authored -- is projected to double in 2024 compared to its 2021, pre-AI baseline. We further find that the percentage of 'added code' and 'copy/pasted code' is increasing in proportion to 'updated,' 'deleted,' and 'moved 'code. In this regard, AI-generated code resembles an itinerant contributor, prone to violate the DRY-ness [don't repeat yourself] of the repos visited."

Extras

Brian:

Michael:

Joke:


Want to go deeper? Check our projects