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 12
12
13
13
jobs :
14
14
julia :
15
- name : Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }})
15
+ name : Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }} )
16
16
runs-on : ${{ matrix.os }}
17
17
strategy :
18
18
fail-fast : false
19
19
matrix :
20
20
arch : [x64] # x86 unsupported by MicroMamba
21
21
os : [ubuntu-latest, windows-latest, macos-latest]
22
22
jlversion : ['1','1.9']
23
+ python : ['@CondaPkg']
24
+ include :
25
+ - arch : x64
26
+ os : ubuntu-latest
27
+ jlversion : ' 1'
28
+ pythonexe : python
23
29
24
30
steps :
25
31
- uses : actions/checkout@v5
@@ -34,12 +40,16 @@ jobs:
34
40
35
41
- name : Build package
36
42
uses : julia-actions/julia-buildpkg@v1
43
+ env :
44
+ PYTHON : python
37
45
38
46
- name : Run tests
39
47
uses : julia-actions/julia-runtest@v1
40
48
env :
41
49
JULIA_DEBUG : PythonCall
42
50
JULIA_NUM_THREADS : ' 2'
51
+ PYTHON : python
52
+ JULIA_PYTHONCALL_EXE : ${{ matrix.pythonexe }}
43
53
44
54
- name : Process coverage
45
55
uses : julia-actions/julia-processcoverage@v1
Original file line number Diff line number Diff line change 38
38
# TODO
39
39
end
40
40
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
47
60
end
48
61
49
62
@testitem " Serialization.jl" begin
Original file line number Diff line number Diff line change 1
1
using TestItemRunner
2
2
3
3
@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