Python
,Today I Learned
🐍 TIL build-and-inspect-python-package GitHub Action workflow plus some bonus Nox + Tox
TIL: via @joshthomas via @treyhunner via @hynek about the hynek/build-and-inspect-python-package GitHub Action.
This workflow makes it possible for GitHub Actions to read your Python version classifiers to build a matrix or, as Trey put it, “Remove so much junk” which is a pretty good example.
As a bonus, check out Hynek’s video on NOX vs TOX – WHAT are they for & HOW do you CHOOSE? 🐍
https://www.youtube.com/watch?v=ImBvrDvK-1U
Both Nox and Tox are great tools that automate testing in multiple Python environments.
I prefer Nox because it uses Python to write configs, which fits my brain better. I used Tox for over a decade, and there are some tox.ini files that I dread updating because I can only remember how I got here after a few hours of tinkering. That’s not Tox’s fault. I think that’s just a limitation of ini
files and the frustration that comes from being unable to use Python when you have a complex matrix to try and sort out.
I recommend trying them out and using the best tool for your brain. There is no wrong path here.
PS: Thank you, Josh, for bringing this to my attention.
Friday May 10, 2024