Merge pull request #127846 from dotlambda/spyder_3-drop

This commit is contained in:
Martin Weinelt 2021-06-23 21:15:20 +02:00 committed by GitHub
commit b262d7d569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 125 deletions

View file

@ -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

View file

@ -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)

View file

@ -1,72 +0,0 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, cloudpickle
, ipykernel
, wurlitzer
, jupyter_client
, pyzmq
, numpy
, pandas
, scipy
, matplotlib
, xarray
, pytestCheckHook
, flaky
, isPy3k
}:
buildPythonPackage rec {
pname = "spyder-kernels";
version = "0.5.2";
src = fetchFromGitHub {
owner = "spyder-ide";
repo = "spyder-kernels";
rev = "v${version}";
sha256 = "1yan589g0470y61bcyjy3wj13i94ndyffckqdyrg97vw2qhfrisb";
};
# requirement xarray not available on Py2k
disabled = !isPy3k;
propagatedBuildInputs = [
cloudpickle
ipykernel
wurlitzer
jupyter_client
pyzmq
];
checkInputs = [
numpy
pandas
scipy
matplotlib
xarray
pytestCheckHook
flaky
];
preCheck = ''
export JUPYTER_RUNTIME_DIR=$(mktemp -d)
'';
# skipped tests:
# turtle requires graphics
# cython test fails, I don't think this can ever access cython?
# umr pathlist test assumes standard directories, not compatible with nix
disabledTests = [
"test_turtle_launc"
"test_umr_skip_cython"
"test_umr_pathlist"
"test_user_sitepackages_in_pathlist"
];
meta = with lib; {
description = "Jupyter kernels for Spyder's console";
homepage = "https://github.com/spyder-ide/spyder-kernels";
license = licenses.mit;
maintainers = with maintainers; [ gebner marcus7070 ];
};
}

View file

@ -1,48 +0,0 @@
{ lib, buildPythonPackage, fetchFromGitHub, jedi, pycodestyle,
psutil, pyflakes, rope, pylint, keyring, numpydoc,
qtconsole, qtawesome, nbconvert, mccabe, pyopengl, cloudpickle, pygments,
spyder-kernels_0_5, qtpy, pyzmq, chardet, pyqtwebengine
}:
buildPythonPackage rec {
pname = "spyder";
version = "3.3.6";
src = fetchFromGitHub {
owner = "spyder-ide";
repo = "spyder";
rev = "v3.3.6";
sha256 = "1sk9xajhzpklk5bcbdhpfhx3gxhyrahsmj9bv2m6kvbqxdlx6bq6";
};
propagatedBuildInputs = [
jedi pycodestyle psutil pyflakes rope pylint keyring numpydoc
qtconsole qtawesome nbconvert mccabe pyopengl cloudpickle spyder-kernels_0_5
pygments qtpy pyzmq chardet pyqtwebengine
];
# tests fail with a segfault
doCheck = false;
postPatch = ''
# remove dependency on pyqtwebengine
# this is still part of the pyqt 5.13 version we have in nixpkgs
sed -i /pyqtwebengine/d setup.py
substituteInPlace setup.py --replace "pyqt5<5.13" "pyqt5"
'';
pythonImportsCheck = [ "spyder" ];
meta = with lib; {
description = "Library providing a scientific python development environment";
longDescription = ''
Spyder (previously known as Pydee) is a powerful interactive development
environment for the Python language with advanced editing, interactive
testing, debugging and introspection features.
'';
homepage = "https://github.com/spyder-ide/spyder/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ gebner marcus7070 ];
};
}

View file

@ -8146,12 +8146,8 @@ in {
spyder = callPackage ../development/python-modules/spyder { };
spyder_3 = callPackage ../development/python-modules/spyder/3.nix { };
spyder-kernels = callPackage ../development/python-modules/spyder-kernels { };
spyder-kernels_0_5 = callPackage ../development/python-modules/spyder-kernels/0.x.nix { };
sqlalchemy = callPackage ../development/python-modules/sqlalchemy { };
sqlalchemy-citext = callPackage ../development/python-modules/sqlalchemy-citext { };