git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #127846 from dotlambda/spyder_3-drop
commitb262d7d5690515eddf8d6d8ac046241d1598cbbd authorMartin Weinelt <mweinelt@users.noreply.github.com> dateWed 23 Jun 2021, 21:15 (5 years ago) parent917be311dc70c3
5 files changed+63−125
pkgs/applications/graphics/cq-editor/default.nix+5−1 pkgs/applications/graphics/cq-editor/spyder4.patch+58 pkgs/development/python-modules/spyder-kernels/0.x.nix−72 pkgs/development/python-modules/spyder/3.nix−48 pkgs/top-level/python-packages.nix−4
pkgs/applications/graphics/cq-editor/default.nix+5−1
@@ -16,13 +16,17 @@ mkDerivationWith python3Packages.buildPythonApplication rec {
1616 sha256 = "1970izjaa60r5cg9i35rzz9lk5c5d8q1vw1rh2skvfbf63z1hnzv";
1717 };
1818
19+ patches = [
20+ ./spyder4.patch
21+ ];
22+
1923 propagatedBuildInputs = with python3Packages; [
2024 cadquery
2125 Logbook
2226 pyqt5
2327 pyparsing
2428 pyqtgraph
25− spyder_3
29+ spyder
2630 pathpy
2731 qtconsole
2832 requests
pkgs/applications/graphics/cq-editor/spyder4.patchnew file+58
@@ -0,0 +1,58 @@
1+diff --git a/cq_editor/widgets/debugger.py b/cq_editor/widgets/debugger.py
2+index b7398fb..d039db5 100644
3+--- a/cq_editor/widgets/debugger.py
4++++ b/cq_editor/widgets/debugger.py
5+@@ -162,7 +162,7 @@ class Debugger(QObject,ComponentMixin):
6+
7+ def get_breakpoints(self):
8+
9+- return self.parent().components['editor'].get_breakpoints()
10++ return self.parent().components['editor'].debugger.get_breakpoints()
11+
12+ def compile_code(self,cq_script):
13+
14+@@ -178,12 +178,14 @@ class Debugger(QObject,ComponentMixin):
15+ def _exec(self, code, locals_dict, globals_dict):
16+
17+ with ExitStack() as stack:
18+- p = Path(self.parent().components['editor'].filename).dirname()
19+- if self.preferences['Add script dir to path'] and p:
20++ fname = self.parent().components['editor'].filename
21++ p = Path(fname if fname else '').abspath().dirname()
22++ if self.preferences['Add script dir to path'] and p.exists():
23+ sys.path.append(p)
24+ stack.callback(sys.path.remove, p)
25+- if self.preferences['Change working dir to script dir'] and p:
26++ if self.preferences['Change working dir to script dir'] and p.exists():
27+ stack.enter_context(p)
28++
29+ exec(code, locals_dict, globals_dict)
30+
31+ def _inject_locals(self,module):
32+diff --git a/cq_editor/widgets/editor.py b/cq_editor/widgets/editor.py
33+index 45aa048..2763469 100644
34+--- a/cq_editor/widgets/editor.py
35++++ b/cq_editor/widgets/editor.py
36+@@ -1,4 +1,4 @@
37+-from spyder.widgets.sourcecode.codeeditor import CodeEditor
38++from spyder.plugins.editor.widgets.codeeditor import CodeEditor
39+ from PyQt5.QtCore import pyqtSignal, QFileSystemWatcher, QTimer
40+ from PyQt5.QtWidgets import QAction, QFileDialog
41+ from PyQt5.QtGui import QFontDatabase
42+@@ -32,6 +32,8 @@ class Editor(CodeEditor,ComponentMixin):
43+
44+ def __init__(self,parent=None):
45+
46++ self._watched_file = None
47++
48+ super(Editor,self).__init__(parent)
49+ ComponentMixin.__init__(self)
50+
51+@@ -83,7 +85,6 @@ class Editor(CodeEditor,ComponentMixin):
52+
53+ # autoreload support
54+ self._file_watcher = QFileSystemWatcher(self)
55+- self._watched_file = None
56+ # we wait for 50ms after a file change for the file to be written completely
57+ self._file_watch_timer = QTimer(self)
58+ self._file_watch_timer.setInterval(50)
pkgs/development/python-modules/spyder-kernels/0.x.nixdeleted−72
@@ -1,72 +0,0 @@
1−{ lib
2−, buildPythonPackage
3−, fetchFromGitHub
4−, cloudpickle
5−, ipykernel
6−, wurlitzer
7−, jupyter_client
8−, pyzmq
9−, numpy
10−, pandas
11−, scipy
12−, matplotlib
13−, xarray
14−, pytestCheckHook
15−, flaky
16−, isPy3k
17−}:
18−
19−buildPythonPackage rec {
20− pname = "spyder-kernels";
21− version = "0.5.2";
22−
23− src = fetchFromGitHub {
24− owner = "spyder-ide";
25− repo = "spyder-kernels";
26− rev = "v${version}";
27− sha256 = "1yan589g0470y61bcyjy3wj13i94ndyffckqdyrg97vw2qhfrisb";
28− };
29−
30− # requirement xarray not available on Py2k
31− disabled = !isPy3k;
32−
33− propagatedBuildInputs = [
34− cloudpickle
35− ipykernel
36− wurlitzer
37− jupyter_client
38− pyzmq
39− ];
40−
41− checkInputs = [
42− numpy
43− pandas
44− scipy
45− matplotlib
46− xarray
47− pytestCheckHook
48− flaky
49− ];
50−
51− preCheck = ''
52− export JUPYTER_RUNTIME_DIR=$(mktemp -d)
53− '';
54−
55− # skipped tests:
56− # turtle requires graphics
57− # cython test fails, I don't think this can ever access cython?
58− # umr pathlist test assumes standard directories, not compatible with nix
59− disabledTests = [
60− "test_turtle_launc"
61− "test_umr_skip_cython"
62− "test_umr_pathlist"
63− "test_user_sitepackages_in_pathlist"
64− ];
65−
66− meta = with lib; {
67− description = "Jupyter kernels for Spyder's console";
68− homepage = "https://github.com/spyder-ide/spyder-kernels";
69− license = licenses.mit;
70− maintainers = with maintainers; [ gebner marcus7070 ];
71− };
72−}
pkgs/development/python-modules/spyder/3.nixdeleted−48
@@ -1,48 +0,0 @@
1−{ lib, buildPythonPackage, fetchFromGitHub, jedi, pycodestyle,
2− psutil, pyflakes, rope, pylint, keyring, numpydoc,
3− qtconsole, qtawesome, nbconvert, mccabe, pyopengl, cloudpickle, pygments,
4− spyder-kernels_0_5, qtpy, pyzmq, chardet, pyqtwebengine
5−}:
6−
7−buildPythonPackage rec {
8− pname = "spyder";
9− version = "3.3.6";
10−
11− src = fetchFromGitHub {
12− owner = "spyder-ide";
13− repo = "spyder";
14− rev = "v3.3.6";
15− sha256 = "1sk9xajhzpklk5bcbdhpfhx3gxhyrahsmj9bv2m6kvbqxdlx6bq6";
16− };
17−
18− propagatedBuildInputs = [
19− jedi pycodestyle psutil pyflakes rope pylint keyring numpydoc
20− qtconsole qtawesome nbconvert mccabe pyopengl cloudpickle spyder-kernels_0_5
21− pygments qtpy pyzmq chardet pyqtwebengine
22− ];
23−
24− # tests fail with a segfault
25− doCheck = false;
26−
27− postPatch = ''
28− # remove dependency on pyqtwebengine
29− # this is still part of the pyqt 5.13 version we have in nixpkgs
30− sed -i /pyqtwebengine/d setup.py
31− substituteInPlace setup.py --replace "pyqt5<5.13" "pyqt5"
32− '';
33−
34− pythonImportsCheck = [ "spyder" ];
35−
36− meta = with lib; {
37− description = "Library providing a scientific python development environment";
38− longDescription = ''
39− Spyder (previously known as Pydee) is a powerful interactive development
40− environment for the Python language with advanced editing, interactive
41− testing, debugging and introspection features.
42− '';
43− homepage = "https://github.com/spyder-ide/spyder/";
44− license = licenses.mit;
45− platforms = platforms.linux;
46− maintainers = with maintainers; [ gebner marcus7070 ];
47− };
48−}
pkgs/top-level/python-packages.nix−4
@@ -8146,12 +8146,8 @@ in {
81468146
81478147 spyder = callPackage ../development/python-modules/spyder { };
81488148
8149− spyder_3 = callPackage ../development/python-modules/spyder/3.nix { };
8150−
81518149 spyder-kernels = callPackage ../development/python-modules/spyder-kernels { };
81528150
8153− spyder-kernels_0_5 = callPackage ../development/python-modules/spyder-kernels/0.x.nix { };
8154−
81558151 sqlalchemy = callPackage ../development/python-modules/sqlalchemy { };
81568152
81578153 sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };