Commit 6da0cf6
committed
Fix C extension import in CI tests
The C extension was being built but not imported during tests due to
Python's sys.path ordering. The project root directory was appearing
first in sys.path, causing Python to import from the source directory
(which doesn't have the compiled .so file) instead of the installed
package in site-packages.
Changes:
- Add pytest --import-mode=importlib to prevent pytest from adding the
project root to sys.path, ensuring tests import from the installed
package in the tox virtualenv
- Add MAXMINDDB_REQUIRE_EXTENSION=1 to the "Setup test suite" step to
ensure the extension is built during CI setup1 parent 4fa310f commit 6da0cf6
2 files changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
| |||
0 commit comments