Skip to content

Commit fbaded9

Browse files
committed
Add CI diagnostics
1 parent bd1f04d commit fbaded9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/system.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ jobs:
6666
env:
6767
PYTHON: python
6868
- run: julia test/check_deps_version.jl ${{ matrix.python-version }}
69+
- run: python -c "import numpy; print(numpy.__version__)"
70+
- run: python -c "import numpy; print(numpy.__file__)"
71+
- run: python -c "import sys; print(sys.path)"
72+
- run: python -c "import os; import inspect; print(inspect.getfile(os))"
6973
- uses: julia-actions/julia-runtest@v1
7074
env:
7175
# Windows temp directories break the CI:

test/runtests.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,25 @@ PYTHONHOME=get(ENV,"PYTHONHOME","")
1111
PYTHONEXECUTABLE=get(ENV,"PYTHONEXECUTABLE","")
1212
@info "Python version $pyversion from $(PyCall.libpython), PYTHONHOME=$(PyCall.PYTHONHOME)\nENV[PYTHONPATH]=$PYTHONPATH\nENV[PYTHONHOME]=$PYTHONHOME\nENV[PYTHONEXECUTABLE]=$PYTHONEXECUTABLE"
1313

14+
os = pyimport("os")
15+
sys = pyimport("sys")
16+
pushfirst!(sys."path", "")
17+
1418
@testset "CI setup" begin
1519
if lowercase(get(ENV, "CI", "false")) == "true"
20+
# Diagnose the actual error if numpy fails to import
21+
py"""
22+
import sys, struct
23+
print(f"Python arch (pointer size): {struct.calcsize('P') * 8}-bit", file=sys.stderr)
24+
print(f"Python platform: {sys.platform}", file=sys.stderr)
25+
try:
26+
import numpy
27+
print(f"numpy loaded from {numpy.__file__}", file=sys.stderr)
28+
except Exception as e:
29+
print(f"Failed to import numpy: {e}", file=sys.stderr)
30+
import traceback
31+
traceback.print_exc(file=sys.stderr)
32+
"""
1633
@test !ispynull(pyimport_e("numpy"))
1734
end
1835
end

0 commit comments

Comments
 (0)