Only run the msgspec tests if the msgspec library is installed#271
Conversation
Some packaging systems, e.g. the Debian GNU/Linux one, only build the msgspec library for a limited set of architectures. As cappa is packaged in turn, it may happen that a package build may be triggered on an architecture that does not have a msgspec package (such as, in the Debian case, i386). Let the test handle that case; the cappa.class_inspect module will already only import msgspec if it is actually required.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
=======================================
Coverage 99.45% 99.45%
=======================================
Files 28 28
Lines 2960 2960
Branches 671 671
=======================================
Hits 2944 2944
Misses 12 12
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
...I don't think the typos failed CI job has anything to do with this change :) |
|
Sidebar, do you know offhand what, if anything, this is being packaged because of? Presumably i need to publish a new version for this to be available to whatever that is? |
|
Well, I'm packaging it because I use cappa in a couple of my personal projects, such as media-type-version, uvoxen, or wrap-nix-shell, and I intend to provide at least some of those as Debian packages as time goes by. But the Debian packaging system allows me to add a patch that will be applied during the package build, so no worries for now. And thanks A LOT for your lightning-fast reaction! :) |
|
This may be a bit off-topic, but @DanCardin, how important would you consider running the test suite during packaging is? I'd assume every new release passes all tests (afterall, the CI for it is there). I'd also like to ask the same question about one of Asking because I maintain relevant AUR packages for both cappa and type-lens. |
|
I do maintain type-lens, yes! Both are pure python packages with ci that should always be passing, particularly for released versions. Practically its probably not that important but you'd know better than me AUR standards. I dont currently, for example, run tests as a prerequisite for the release CI so teeeechnically i could mess something up |
|
Well, it is encouraged to run checks for Arch and AUR packages, but not a lot of packages actually do so - and those are mostly VCS packages. I only package stable releases for |
Hi,
First of all, thanks a lot for writing and maintaining cappa!
What do you think about the following change that will make the test suite run even in weird cases when the msgpack library is not available? As explained in the commit message, this can happen if a packaged version of cappa is built in an environment where the corresponding packaging system does not build the msgspec package at all, even though it may build it for other platforms/architectures.
Thanks in advance for looking into this, and keep up the great work!
G'luck,
Peter