__init__.py
in tests directory results in shared library not being found?
#1530
-
Hello! I'm having an issue where whether or not I make my I made a minimal repository demonstrating the issue here: The build backend is CMake via scikit-build-core. A diff of the resulting wheel contents shows they are identical. A diff of the GitHub Actions output shows no significant difference (except time, hashes, etc) until the test fail. Here's the passing test without the Here's the failing test with the The difference is only the addition of the I'm having trouble understanding why making the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It turns out the issue was also occurring locally, and I had just missed that because I was resolving other issues at the same time. The issue was that with |
Beta Was this translation helpful? Give feedback.
The default mechanism (prepend) for loading has drawbacks in pytest - it's prepending the path that the tests module is in to the path before running python, which is why it's picking the unbuilt package up. I highly recommend the
src/<package>
structure. Anyway, could you try using Python's import system (--import-mode=importlib
)?