Python Bytes

#443 Patching Multiprocessing


Listen Later

Topics covered in this episode:
  • rumdl - A Markdown Linter written in Rust
  • * Coverage 7.10.0: patch*
  • * aioboto3*
  • * You might not need a Python class*
  • Extras
  • Joke
  • Watch on YouTube

    About the show

    Connect with the hosts

    • Michael: @[email protected] / @mkennedy.codes (bsky)
    • Brian: @[email protected] / @brianokken.bsky.social
    • Show: @[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: rumdl - A Markdown Linter written in Rust

      • via Owen Lamont
      • Supports toml file config settings
      • Install via uv tool install rumdl.
      • ⚡️ Built for speed with Rust - significantly faster than alternatives
      • 🔍 54 lint rules covering common Markdown issues
      • 🛠️ Automatic fixing with -fix for most rules
      • 📦 Zero dependencies - single binary with no runtime requirements
      • 🔧 Highly configurable with TOML-based config files
      • 🌐 Multiple installation options - Rust, Python, standalone binaries
      • 🐍 Installable via pip for Python users
      • 📏 Modern CLI with detailed error reporting
      • 🔄 CI/CD friendly with non-zero exit code on errors
      • Brian #2: Coverage 7.10.0: patch

        • Ned Batchelder

        • Actually up to 7.10.2 as of today

        • patch allows coverage to run better when a covered project uses

          • subprocesses
          • os._exit()
          • execv family of functions
          • Looking at subprocess

            • “Coverage works great when you start your program with coverage measurement, but has long had the problem of how to also measure the coverage of sub-processes that your program created. The existing solution had been a complicated two-step process of creating obscure .pth files and setting environment variables. Whole projects appeared on PyPI to handle this for you.”
            • From release notes

            • for 7.10.0

              • A new configuration option: “[run] patch” specifies named patches to work around some limitations in coverage measurement. These patches are available:

                • patch = _exit lets coverage save its data even when os._exit() is used to abruptly end the process. This closes long-standing issue 310 as well as its duplicates: issue 312, issue 1673, issue 1845, and issue 1941.
                • patch = subprocess measures coverage in Python subprocesses created with subprocess, os.system(), or one of the execv or spawnv family of functions. Closes old issue 367 and duplicate issue 378.
                • patch = execv adjusts the execv family of functions to save coverage data before ending the current program and starting the next. Not available on Windows. Closes issue 43 after 15 years!
                • Michael #3: aioboto3

                  • via Pat Decker
                  • Wrapper to use boto3 resources with the aiobotocore async backend
                  • aiobotocore allows you to use near enough all of the boto3 client commands in an async manner just by prefixing the command with await.
                  • With aioboto3 you can now use the higher level APIs provided by boto3 in an asynchronous manner.
                  • Brian #4: You might not need a Python class

                    • Adam Grant
                    • This is an important periodic reminder to everyone coming into Python from other languages.
                      • Many other languages lean on classes a lot more than we need to in Python
                      • Adams suggestions
                        • Simple Data Containers: Use Named Tuples or Data Classes
                        • Stateless Utility Functions: Just Use Functions
                        • Grouping Constants: Use Modules
                        • Managing State with Simple Structures: Use Dictionaries or Lists
                        • Simple One-off Operations: Use Lambdas or Comprehensions
                          • I’ll add “just use functions”
                          • Avoiding Complexity: Built-in Libraries
                          • When You Actually Need a Class
                            • I’ll add
                              • You probably don’t
                              • If you think you do, ask a friend. Friends don’t let friends create extraneous classes in Python.
                              • If you think your case is an exception, it probably isn’t
                              • If you think dataclasses aren’t right for you, check out attrs
                              • Extras

                                Brian:

                                • PyPI Incident Report: Phishing Attack -Sent in by listener John Hagen
                                • Both of Adam Johnson’s recent-ish interviews are now up on Test & Code
                                  • 236: Git Tips for Testing - Adam Johnson
                                  • 235: pytest-django - Adam Johnson
                                  • Michael:

                                    • Dive into uv webcast with me and Will Vincent
                                    • Joke: Default text editor

                                      ...more
                                      View all episodesView all episodes
                                      Download on the App Store

                                      Python BytesBy Michael Kennedy and Brian Okken

                                      • 4.7
                                      • 4.7
                                      • 4.7
                                      • 4.7
                                      • 4.7

                                      4.7

                                      212 ratings


                                      More shows like Python Bytes

                                      View all
                                      Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

                                      Software Engineering Radio - the podcast for professional software developers

                                      271 Listeners

                                      The Changelog: Software Development, Open Source by Changelog Media

                                      The Changelog: Software Development, Open Source

                                      283 Listeners

                                      Data Skeptic by Kyle Polich

                                      Data Skeptic

                                      477 Listeners

                                      Talk Python To Me by Michael Kennedy

                                      Talk Python To Me

                                      584 Listeners

                                      Software Engineering Daily by Software Engineering Daily

                                      Software Engineering Daily

                                      626 Listeners

                                      Test & Code by Brian Okken

                                      Test & Code

                                      70 Listeners

                                      Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

                                      Super Data Science: ML & AI Podcast with Jon Krohn

                                      295 Listeners

                                      Data Engineering Podcast by Tobias Macey

                                      Data Engineering Podcast

                                      141 Listeners

                                      Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

                                      Syntax - Tasty Web Development Treats

                                      987 Listeners

                                      CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

                                      CoRecursive: Coding Stories

                                      189 Listeners

                                      DataFramed by DataCamp

                                      DataFramed

                                      269 Listeners

                                      Practical AI by Practical AI LLC

                                      Practical AI

                                      189 Listeners

                                      The Stack Overflow Podcast by The Stack Overflow Podcast

                                      The Stack Overflow Podcast

                                      64 Listeners

                                      The Real Python Podcast by Real Python

                                      The Real Python Podcast

                                      141 Listeners

                                      Oxide and Friends by Oxide Computer Company

                                      Oxide and Friends

                                      58 Listeners