summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Schütz <dev@schuetz-co.de>2021-06-23 00:46:58 +0200
committerRobert Schütz <dev@schuetz-co.de>2021-06-23 11:52:05 +0200
commitcf4e702b2c990fe39248fb31936aea56cbfe7e96 (patch)
tree037281e016ab12149058fae6083c85da902ff300
parentb51d8262d556ca3bfdc9ac443e0135133285a99f (diff)
downloadnixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar.gz
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar.bz2
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar.lz
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar.xz
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.tar.zst
nixpkgs-cf4e702b2c990fe39248fb31936aea56cbfe7e96.zip
cq-editor: use default version of spyder
-rw-r--r--pkgs/applications/graphics/cq-editor/default.nix6
-rw-r--r--pkgs/applications/graphics/cq-editor/spyder4.patch58
2 files changed, 63 insertions, 1 deletions
diff --git a/pkgs/applications/graphics/cq-editor/default.nix b/pkgs/applications/graphics/cq-editor/default.nix
index cf94f4fa32d..b9b2eb36873 100644
--- a/pkgs/applications/graphics/cq-editor/default.nix
+++ b/pkgs/applications/graphics/cq-editor/default.nix
@@ -16,13 +16,17 @@ mkDerivationWith python3Packages.buildPythonApplication rec {
     sha256 = "1970izjaa60r5cg9i35rzz9lk5c5d8q1vw1rh2skvfbf63z1hnzv";
   };
 
+  patches = [
+    ./spyder4.patch
+  ];
+
   propagatedBuildInputs = with python3Packages; [
     cadquery
     Logbook
     pyqt5
     pyparsing
     pyqtgraph
-    spyder_3
+    spyder
     pathpy
     qtconsole
     requests
diff --git a/pkgs/applications/graphics/cq-editor/spyder4.patch b/pkgs/applications/graphics/cq-editor/spyder4.patch
new file mode 100644
index 00000000000..49813b18a0c
--- /dev/null
+++ b/pkgs/applications/graphics/cq-editor/spyder4.patch
@@ -0,0 +1,58 @@
+diff --git a/cq_editor/widgets/debugger.py b/cq_editor/widgets/debugger.py
+index b7398fb..d039db5 100644
+--- a/cq_editor/widgets/debugger.py
++++ b/cq_editor/widgets/debugger.py
+@@ -162,7 +162,7 @@ class Debugger(QObject,ComponentMixin):
+ 
+     def get_breakpoints(self):
+ 
+-        return self.parent().components['editor'].get_breakpoints()
++        return self.parent().components['editor'].debugger.get_breakpoints()
+ 
+     def compile_code(self,cq_script):
+ 
+@@ -178,12 +178,14 @@ class Debugger(QObject,ComponentMixin):
+     def _exec(self, code, locals_dict, globals_dict):
+ 
+         with ExitStack() as stack:
+-            p = Path(self.parent().components['editor'].filename).dirname()
+-            if self.preferences['Add script dir to path'] and p:
++            fname = self.parent().components['editor'].filename
++            p = Path(fname if fname else '').abspath().dirname()
++            if self.preferences['Add script dir to path'] and p.exists():
+                 sys.path.append(p)
+                 stack.callback(sys.path.remove, p)
+-            if self.preferences['Change working dir to script dir'] and p:
++            if self.preferences['Change working dir to script dir'] and p.exists():
+                 stack.enter_context(p)
++
+             exec(code, locals_dict, globals_dict)
+             
+     def _inject_locals(self,module):
+diff --git a/cq_editor/widgets/editor.py b/cq_editor/widgets/editor.py
+index 45aa048..2763469 100644
+--- a/cq_editor/widgets/editor.py
++++ b/cq_editor/widgets/editor.py
+@@ -1,4 +1,4 @@
+-from spyder.widgets.sourcecode.codeeditor import  CodeEditor
++from spyder.plugins.editor.widgets.codeeditor import  CodeEditor
+ from PyQt5.QtCore import pyqtSignal, QFileSystemWatcher, QTimer
+ from PyQt5.QtWidgets import QAction, QFileDialog
+ from PyQt5.QtGui import QFontDatabase
+@@ -32,6 +32,8 @@ class Editor(CodeEditor,ComponentMixin):
+ 
+     def __init__(self,parent=None):
+ 
++        self._watched_file = None
++
+         super(Editor,self).__init__(parent)
+         ComponentMixin.__init__(self)
+ 
+@@ -83,7 +85,6 @@ class Editor(CodeEditor,ComponentMixin):
+ 
+         # autoreload support
+         self._file_watcher = QFileSystemWatcher(self)
+-        self._watched_file = None
+         # we wait for 50ms after a file change for the file to be written completely
+         self._file_watch_timer = QTimer(self)
+         self._file_watch_timer.setInterval(50)