r/Python • u/Wheatley_soda • 14m ago
Discussion More Python projects should test what they actually ship, not just what's in the repository
A surprisingly embarrassing category of Python bugs is the stuff that works perfectly in development but breaks after installing the actual wheel.
Missing template files, undeclared dependencies, paths that assume you're running from the project root, etc.
I've become quite fond of having a separate CI job that builds the wheel, installs it into a fresh environment and runs a few basic functionality checks from an unrelated directory.
Nothing elaborate. Just enough to experience the package the way an actual user would.
It's interesting how much attention we give to test coverage while sometimes neglecting to test the very artifact we're distributing.
Editable installs are great for development, but I think they can make us a little too comfortable.
•
u/AtreidesPlum 4m ago
A passing test suite and a broken wheel aren't contradictory. You've just thoroughly tested something you're not shipping.
•
•
u/Exotic-Draft8802 6m ago
I was about to downvote - thanks for the explanation. I agree 👍