diff --git a/test/python/Project.toml b/test/python/Project.toml index 121f414718..1097d98286 100644 --- a/test/python/Project.toml +++ b/test/python/Project.toml @@ -1,13 +1,11 @@ [deps] DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" [compat] DifferentialEquations = "7.11" OrdinaryDiffEq = "6.33" -PyCall = "1.96" PythonCall = "0.9.14" SciMLBase = "2" diff --git a/test/python/pycall.jl b/test/python/pycall.jl deleted file mode 100644 index c3570ce97a..0000000000 --- a/test/python/pycall.jl +++ /dev/null @@ -1,46 +0,0 @@ -using PyCall, SciMLBase, OrdinaryDiffEq - -py""" # This is a mess because normal site-packages is not writeable in CI -import subprocess, sys, site -subprocess.run([sys.executable, '-m', 'pip', 'install', '--user', 'julia']) -subprocess.run([sys.executable, '-m', 'pip', 'install', '--user', 'diffeqpy']) -sys.path.append(site.getusersitepackages()) -""" - -@testset "numargs" begin - py""" - def three_arg(a, b, c): - return a + b + c - - def four_arg(a, b, c, d): - return a + b + c + d - - class MyClass: - def three_arg_method(self, a, b, c): - return a + b + c - - def four_arg_method(self, a, b, c, d): - return a + b + c + d - """ - - @test SciMLBase.numargs(py"three_arg") === 3 - @test SciMLBase.numargs(py"four_arg") === 4 - x = py"MyClass()" - @test SciMLBase.numargs(x.three_arg_method) === 3 - @test SciMLBase.numargs(x.four_arg_method) === 4 -end - -@testset "solution handling" begin - py""" - from julia import OrdinaryDiffEq as ode - - def f(u,p,t): - return -u - - u0 = 0.5 - tspan = (0., 1.) - prob = ode.ODEProblem(f, u0, tspan) - sol = ode.solve(prob, ode.Tsit5()) - """ - @test py"sol" isa ODESolution -end diff --git a/test/python/pythoncall.jl b/test/python/pythoncall.jl index 0d6ba72262..27693dd011 100644 --- a/test/python/pythoncall.jl +++ b/test/python/pythoncall.jl @@ -1,10 +1,13 @@ -# PyCall and PythonCall must use the same Python interpreter. This environment variable -# tells PythonCall to use the same Python interpreter as PyCall. See -# https://github.com/JuliaPy/PythonCall.jl/blob/5f56a9b96b867a9f6742ab1d1e2361abd844e19f/docs/src/pycall.md#tips -ENV["JULIA_PYTHONCALL_EXE"] = "@PyCall" - using DifferentialEquations, PythonCall +pyexec( + """ # This is a mess because normal site-packages is not writeable in CI +import subprocess, sys, site +subprocess.run([sys.executable, '-m', 'pip', 'install', '--user', 'julia']) +subprocess.run([sys.executable, '-m', 'pip', 'install', '--user', 'diffeqpy']) +sys.path.append(site.getusersitepackages()) +""", @__MODULE__) + @testset "Use of DifferentialEquations through PythonCall with user code written in Python" begin pyexec(""" from juliacall import Main diff --git a/test/runtests.jl b/test/runtests.jl index 985a71c648..b4e519d0f2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -151,9 +151,6 @@ end if !is_APPVEYOR && GROUP == "Python" activate_python_env() - @time @safetestset "PyCall" begin - include("python/pycall.jl") - end @time @safetestset "PythonCall" begin include("python/pythoncall.jl") end