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.

#353 Hatching Another Episode

September 19, 2023 00:29:27 28.4 MB Downloads: 0
Topics covered in this episode:
Watch on YouTube

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: OverflowAI

  • Integration of generative AI into our public platform, Stack Overflow for Teams, and brand new product areas, like an IDE integration.
  • Have a conversation about the search results and proposed answer with GenAI
  • Coming with IDE integration too.
  • Check out the video on their page for some more detail than the article.

Brian #2: Switching to Hatch

  • Oliver Andrich
  • Hatch has some interesting features
    • Template built from hatch new myproject includes isolating dev, test, lint virtual environments.
    • Each env can have scripts
    • Test matrix ala tox, but possibly easier to express complex matrices.
    • May not even need tox then, but then now you have hatch.
    • A way to specify which optional dependencies needed for default environment.
  • Notes from Brian
    • One premise is that lots of projects are now using hatch.
    • I don’t know if that’s true. A quick spot check of a few projects include projects that use hatchling. While hatchling is the back end to hatch, they are not the same. I use hatchling a lot now, but haven’t picked up using hatch. But I do want to try it more after reading this article.

Michael #3: Alpha release of the Ruff formatter

  • vis Sky Kasko
  • Charlie Marsh announced that an alpha version of a Ruff formatter has been released in Ruff v0.0.289.
  • The formatter is designed to be a drop-in replacement for Black, but with an excessive focus on performance and direct integration with Ruff.
  • Sky says: I can't find any benchmarks that have been released yet, but I did some extremely unscientific testing and found the Ruff formatter to be around 5 to 10 times faster than Black when running on already-formatted code or in a small codebase, and 75 times faster when running on a large codebase of unformatted code. (The second outcome probably isn't very important since most people would not often be formatting thousands of lines of completely unformatted code.)
  • For more info, see the README: https://github.com/astral-sh/ruff/blob/main/crates/ruff_python_formatter/README.md

Brian #4: What is wrong with TOML?


  • Colm O'Connor
  • Suggested by Will McGugan
  • This is a comparison of TOML vs StrictYAML under the use case of “readable story tests”.
  • TLDR; For smallish things like pyproject.toml, toml is fine. For huge files, something like StrictYAML may be less horrible.
  • from Brian:
    • Short answer: Nothing, unless you’re doing crazy things with it.
    • Re “readable story tests”: WTF? Neither of these are something I’d like to maintain.

Extras

Brian:

  • Python Testing with pytest, the course
    • New intro video to explain what the course is about
    • Using Teachable video
      • like notes, mini-viewer, and speed controls
    • Chapter on “Testing Strategy” is next

Michael:

Joke: The 5 stages of debugging