File tree Expand file tree Collapse file tree 3 files changed +30
-16
lines changed Expand file tree Collapse file tree 3 files changed +30
-16
lines changed Original file line number Diff line number Diff line change 1212
1313jobs :
1414 julia :
15- name : Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }})
15+ name : Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }} )
1616 runs-on : ${{ matrix.os }}
1717 strategy :
1818 fail-fast : false
1919 matrix :
2020 arch : [x64] # x86 unsupported by MicroMamba
2121 os : [ubuntu-latest, windows-latest, macos-latest]
2222 jlversion : ['1','1.9']
23+ python : ['@CondaPkg']
24+ include :
25+ - arch : x64
26+ os : ubuntu-latest
27+ jlversion : ' 1'
28+ pythonexe : python
2329
2430 steps :
2531 - uses : actions/checkout@v5
@@ -34,12 +40,16 @@ jobs:
3440
3541 - name : Build package
3642 uses : julia-actions/julia-buildpkg@v1
43+ env :
44+ PYTHON : python
3745
3846 - name : Run tests
3947 uses : julia-actions/julia-runtest@v1
4048 env :
4149 JULIA_DEBUG : PythonCall
4250 JULIA_NUM_THREADS : ' 2'
51+ PYTHON : python
52+ JULIA_PYTHONCALL_EXE : ${{ matrix.pythonexe }}
4353
4454 - name : Process coverage
4555 uses : julia-actions/julia-processcoverage@v1
Original file line number Diff line number Diff line change 3838 # TODO
3939end
4040
41- @testitem " PyCall.jl" setup = [PyCall] begin
42- @test Base. get_extension (PythonCall, :PyCallExt ). SAME[]
43- x1 = pylist ()
44- x2 = PyCall. PyObject (x1)
45- x3 = Py (x2)
46- @test pyis (x3, x1)
41+ @testitem " PyCall.jl" begin
42+ using PyCall
43+ same = Base. get_extension (PythonCall, :PyCallExt ). SAME[]:: Bool
44+ @info " testing PyCall" same
45+ if get (ENV , " CI" , " " ) != " "
46+ # ensure we test both `same` and `!same` in CI
47+ @test same == (ENV [" JULIA_PYTHONCALL_EXE" ] == " python" )
48+ end
49+ if same
50+ x1 = pylist ():: Py
51+ x2 = PyCall. PyObject (x1):: PyCall.PyObject
52+ x3 = Py (x2):: Py
53+ @test pyis (x3, x1)
54+ else
55+ x1 = pylist ():: Py
56+ @test_throws " only possible when using the same Python" PyCall. PyObject (x1)
57+ x2 = PyCall. pybuiltin (" list" )():: PyCall.PyObject
58+ @test_throws " only possible when using the same Python" Py (x2)
59+ end
4760end
4861
4962@testitem " Serialization.jl" begin
Original file line number Diff line number Diff line change 11using TestItemRunner
22
33@run_package_tests
4-
5- @testmodule PyCall begin
6- using PythonCall: PythonCall
7- using Pkg: Pkg
8- ENV [" PYTHON" ] = PythonCall. python_executable_path ()
9- @info " Building PyCall..." ENV [" PYTHON" ]
10- Pkg. build (" PyCall" )
11- using PyCall
12- end
You can’t perform that action at this time.
0 commit comments