Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Libdl = "1"
MacroTools = "0.5"
Markdown = "1"
Pkg = "1"
PyCall = "1"
Requires = "1"
Serialization = "1"
Tables = "1"
Expand All @@ -33,8 +34,9 @@ julia = "1.9"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[targets]
test = ["Aqua", "Test", "TestItemRunner"]
test = ["Aqua", "PyCall", "Test", "TestItemRunner"]
6 changes: 1 addition & 5 deletions src/Compat/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ using Serialization: Serialization, AbstractSerializer, serialize, deserialize
using Tables: Tables
using Requires: @require

import ..PythonCall:
event_loop_on,
event_loop_off,
fix_qt_plugin_path,
pytable
import ..PythonCall: event_loop_on, event_loop_off, fix_qt_plugin_path, pytable

include("gui.jl")
include("ipython.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/Compat/pycall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function init_pycall(PyCall::Module)
- Set the environment variable `PYTHON` to `PythonCall.C.CTX.exe_path` and rebuild PyCall. This forces PyCall
to use the same interpreter as PythonCall, but needs to be repeated whenever you switch Julia environment.
"""
@eval function Core.Py(x::$PyCall.PyObject)
@eval function PythonCall.Py(x::$PyCall.PyObject)
C.CTX.matches_pycall::Bool || error($errmsg)
return pynew(C.PyPtr($PyCall.pyreturn(x)))
end
Expand Down
9 changes: 7 additions & 2 deletions test/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ end
# TODO
end

@testitem "PyCall.jl" begin
# TODO
@testitem "PyCall.jl" setup = [PyCall] begin
x1 = pylist()
x2 = PyCall.PyObject(x1)
x3 = Py(x2)
@test PythonCall.C.CTX.matches_pycall
@test pyisinstance(x3, pybuiltins.list)
@test pyis(x3, x1)
end

@testitem "Serialization.jl" begin
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
using TestItemRunner

@run_package_tests

@testmodule PyCall begin
using PythonCall: PythonCall
using Pkg: Pkg
ENV["PYTHON"] = PythonCall.python_executable_path()
@info "Building PyCall..." ENV["PYTHON"]
Pkg.build("PyCall")
using PyCall
end
Loading