Skip to content

Commit 5901dea

Browse files
author
Christopher Doris
committed
fix #676 and test GUI compat better along the way
1 parent 71666ca commit 5901dea

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

CondaPkg.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
[deps.libstdcxx]
1+
2+
[deps.openssl]
23
version = "<=julia"
34

4-
[deps.libstdcxx-ng]
5+
[deps.libstdcxx]
56
version = "<=julia"
67

7-
[deps.openssl]
8+
[deps.libstdcxx-ng]
89
version = "<=julia"
910

1011
[deps.python]
1112
build = "**cpython**"
1213
version = ">=3.9,<4"
14+
15+
[dev.deps]
16+
matplotlib = ""
17+
pyside6 = ""

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
1717
[compat]
1818
Aqua = "0 - 999"
1919
CategoricalArrays = "0.10, 1"
20-
CondaPkg = "0.2.30"
20+
CondaPkg = "0.2.33"
2121
Dates = "1"
2222
Libdl = "1"
2323
MacroTools = "0.5"

src/Compat/gui.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function init_gui()
159159

160160
# add a hook to automatically call fix_qt_plugin_path()
161161
fixqthook =
162-
Py(() -> (Core.CONFIG.auto_fix_qt_plugin_path && fix_qt_plugin_path(); nothing))
162+
Py(() -> (PythonCall.CONFIG.auto_fix_qt_plugin_path && fix_qt_plugin_path(); nothing))
163163
pymodulehooks.add_hook("PyQt4", fixqthook)
164164
pymodulehooks.add_hook("PyQt5", fixqthook)
165165
pymodulehooks.add_hook("PySide", fixqthook)

src/Core/stdlib.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ function init_stdlib()
4040
class JuliaCompatHooks:
4141
def __init__(self):
4242
self.hooks = {}
43-
def find_module(self, name, path=None):
43+
def find_spec(self, name, path=None, target=None):
44+
print("find_spec:", name)
4445
hs = self.hooks.get(name)
4546
if hs is not None:
4647
for h in hs:

test/Compat.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
@test PythonCall.fix_qt_plugin_path() === false
66
end
77
@testset "event_loop_on/off" begin
8-
for g in [:pyqt4, :pyqt5, :pyside, :pyside2, :pyside6, :gtk, :gtk3, :wx]
8+
@testset "$g" for g in [:pyqt4, :pyqt5, :pyside, :pyside2, :pyside6, :gtk, :gtk3, :wx]
99
# TODO: actually test the various GUIs somehow?
10-
@show g
11-
@test_throws PyException PythonCall.event_loop_on(g)
10+
if g == :pyside6
11+
# pyside6 is installed as a dev dependency
12+
# AND it's a dependency of matplotlib, which is also a dev dependency
13+
@test PythonCall.event_loop_on(g) isa Timer
14+
else
15+
@test_throws PyException PythonCall.event_loop_on(g)
16+
end
1217
@test PythonCall.event_loop_off(g) === nothing
1318
end
1419
end
20+
@testset "matplotlib issue 676" begin
21+
plt = pyimport("matplotlib.pyplot")
22+
@test plt.get_backend() isa Py
23+
end
1524
end
1625

1726
@testitem "ipython" begin

0 commit comments

Comments
 (0)