Topics include How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project, difftastic, Quarto, and constable.

Python Bytes

Michael Kennedy and Brian Okken

#379 Constable on the debugging case

APR 16, 202420 MIN
Python Bytes

#379 Constable on the debugging case

APR 16, 202420 MIN

Description

<strong>Topics covered in this episode:</strong><br> <ul> <li><a href="https://stefaniemolin.com/articles/devx/pre-commit/setup-guide/">How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project</a>.</li> <li><a href="https://difftastic.wilfred.me.uk"><strong>difftastic</strong></a></li> <li><a href="https://quarto.org"><strong>Quarto</strong></a></li> <li><a href="https://github.com/saurabh0719/constable"><strong>constable</strong></a></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=4PoBtLFRWGU' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="379">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@[email protected]</strong></a></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@[email protected]</strong></a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes"><strong>@[email protected]</strong></a></li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.</p> <p>Finally, if you want an artisanal, hand-crafted digest of every week of </p> <p>the show notes in email form? Add your name and email to <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Michael #1:</strong> <a href="https://stefaniemolin.com/articles/devx/pre-commit/setup-guide/">How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project</a>.</p> <ul> <li>by <a href="https://stefaniemolin.com/"><strong>Stefanie Molin</strong></a></li> <li>Pre-commit hooks are code checks that run as part of the “pre-commit” stage of the git commit process. </li> <li>If any of these checks fail, git aborts the commit</li> <li>Sometimes, we need to bypass the hooks temporarily. For these instances, we can pass the --no-verify option when we run git commit</li> </ul> <p><strong>Brian #2:</strong> <a href="https://difftastic.wilfred.me.uk"><strong>difftastic</strong></a></p> <ul> <li>Found this a couple years ago, but really using it a lot now.</li> <li>Excellent structurally diff tool that compares code based on syntax, not line by line.</li> </ul> <p><strong>Michael #3:</strong> <a href="https://quarto.org"><strong>Quarto</strong></a></p> <ul> <li>via Mathias Johansson</li> <li>An open-source scientific and technical publishing system</li> <li>Transforming a notebook into a pdf / HTML / MS Word / ePub with minimal effort, or even all formats at once.</li> <li>Author using <a href="https://jupyter.org/">Jupyter</a> notebooks or with plain text markdown in your favorite editor.</li> <li>Write using <a href="https://pandoc.org/">Pandoc</a> markdown, including equations, citations, crossrefs, figure panels, callouts, advanced layout, and more.</li> </ul> <p><strong>Brian #4:</strong> <a href="https://github.com/saurabh0719/constable"><strong>constable</strong></a></p> <ul> <li>“inserts print statements directly into the AST at runtime “</li> <li>“If you find yourself aimlessly adding print statements while debugging your code, this is for you. !”</li> <li>Add decorators like @constable.trace('a', 'b') to functions and you’ll get nice output showing when and how a and b changed.</li> <li>see also <a href="https://github.com/gruns/icecream">icecream</a> for another fun debugging with print project.</li> </ul> <p><strong>Extras</strong> </p> <p>Brian:</p> <ul> <li><a href="https://www.reddit.com/r/Python/comments/1bt7rnw/pointerspy_being_added_to_the_standard_library/"><strong>pointers being added to the standard library</strong></a> <ul> <li>A couple weeks old, but still worth covering</li> <li>Guido’s take on adding this, "Why the hell not?"</li> </ul></li> </ul> <p>Michael:</p> <ul> <li><a href="https://docs.python.org/release/3.12.3/whatsnew/changelog.html#python-3-12-2">Python 3.12.3 is out</a></li> </ul> <p><strong>Joke:</strong> <a href="https://twitter.com/hynek/status/1777377316269883420">Hugo SciFi Award</a></p>