about summary refs log tree commit diff
path: root/pkgs/development/python-modules/debugpy
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/debugpy')
-rw-r--r--pkgs/development/python-modules/debugpy/default.nix150
-rw-r--r--pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch12
-rw-r--r--pkgs/development/python-modules/debugpy/hardcode-gdb.patch13
-rw-r--r--pkgs/development/python-modules/debugpy/hardcode-lldb.patch13
-rw-r--r--pkgs/development/python-modules/debugpy/hardcode-version.patch47
-rw-r--r--pkgs/development/python-modules/debugpy/skip-attach-pid-tests.patch27
6 files changed, 0 insertions, 262 deletions
diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix
deleted file mode 100644
index 92f42bd90d64..000000000000
--- a/pkgs/development/python-modules/debugpy/default.nix
+++ /dev/null
@@ -1,150 +0,0 @@
-{
-  lib,
-  stdenv,
-  buildPythonPackage,
-  pythonOlder,
-  fetchFromGitHub,
-  substituteAll,
-  gdb,
-  lldb,
-  pytestCheckHook,
-  pytest-xdist,
-  pytest-timeout,
-  importlib-metadata,
-  psutil,
-  django,
-  requests,
-  gevent,
-  numpy,
-  flask,
-}:
-
-buildPythonPackage rec {
-  pname = "debugpy";
-  version = "1.8.1";
-  format = "setuptools";
-
-  disabled = pythonOlder "3.8";
-
-  src = fetchFromGitHub {
-    owner = "microsoft";
-    repo = "debugpy";
-    rev = "refs/tags/v${version}";
-    hash = "sha256-2TkieSQYxnlUroSD9wNKNaHUTLRksFWL/6XmSNGTCA4=";
-  };
-
-  patches =
-    [
-      # Use nixpkgs version instead of versioneer
-      (substituteAll {
-        src = ./hardcode-version.patch;
-        inherit version;
-      })
-
-      # Fix importing debugpy in:
-      # - test_nodebug[module-launch(externalTerminal)]
-      # - test_nodebug[module-launch(integratedTerminal)]
-      #
-      # NOTE: The import failures seen in these tests without the patch
-      # will be seen if a user "installs" debugpy by adding it to PYTHONPATH.
-      # To avoid this issue, debugpy should be installed using python.withPackages:
-      # python.withPackages (ps: with ps; [ debugpy ])
-      ./fix-test-pythonpath.patch
-
-      # Attach pid tests are disabled by default on windows & macos,
-      # but are also flaky on linux:
-      # - https://github.com/NixOS/nixpkgs/issues/262000
-      # - https://github.com/NixOS/nixpkgs/issues/251045
-      ./skip-attach-pid-tests.patch
-    ]
-    ++ lib.optionals stdenv.isLinux [
-      # Hard code GDB path (used to attach to process)
-      (substituteAll {
-        src = ./hardcode-gdb.patch;
-        inherit gdb;
-      })
-    ]
-    ++ lib.optionals stdenv.isDarwin [
-      # Hard code LLDB path (used to attach to process)
-      (substituteAll {
-        src = ./hardcode-lldb.patch;
-        inherit lldb;
-      })
-    ];
-
-  # Remove pre-compiled "attach" libraries and recompile for host platform
-  # Compile flags taken from linux_and_mac/compile_linux.sh & linux_and_mac/compile_mac.sh
-  preBuild = ''
-    (
-        set -x
-        cd src/debugpy/_vendored/pydevd/pydevd_attach_to_process
-        rm *.so *.dylib *.dll *.exe *.pdb
-        $CXX linux_and_mac/attach.cpp -Ilinux_and_mac -std=c++11 -fPIC -nostartfiles ${
-          {
-            "x86_64-linux" = "-shared -o attach_linux_amd64.so";
-            "i686-linux" = "-shared -o attach_linux_x86.so";
-            "aarch64-linux" = "-shared -o attach_linux_arm64.so";
-            "x86_64-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_x86_64.dylib";
-            "i686-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_x86.dylib";
-            "aarch64-darwin" = "-D_REENTRANT -dynamiclib -lc -o attach_arm64.dylib";
-          }
-          .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}")
-        }
-      )'';
-
-  nativeCheckInputs = [
-    ## Used to run the tests:
-    pytestCheckHook
-    pytest-xdist
-    pytest-timeout
-
-    ## Used by test helpers:
-    importlib-metadata
-    psutil
-
-    ## Used in Python code that is run/debugged by the tests:
-    django
-    flask
-    gevent
-    numpy
-    requests
-  ];
-
-  preCheck =
-    ''
-      export DEBUGPY_PROCESS_SPAWN_TIMEOUT=0
-      export DEBUGPY_PROCESS_EXIT_TIMEOUT=0
-    ''
-    + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
-      # https://github.com/python/cpython/issues/74570#issuecomment-1093748531
-      export no_proxy='*';
-    '';
-
-  postCheck = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
-    unset no_proxy
-  '';
-
-  # Override default arguments in pytest.ini
-  pytestFlagsArray = [ "--timeout=0" ];
-
-  # Fixes hanging tests on Darwin
-  __darwinAllowLocalNetworking = true;
-
-  pythonImportsCheck = [ "debugpy" ];
-
-  meta = with lib; {
-    description = "Implementation of the Debug Adapter Protocol for Python";
-    homepage = "https://github.com/microsoft/debugpy";
-    changelog = "https://github.com/microsoft/debugpy/releases/tag/v${version}";
-    license = licenses.mit;
-    maintainers = with maintainers; [ kira-bruneau ];
-    platforms = [
-      "x86_64-linux"
-      "i686-linux"
-      "aarch64-linux"
-      "x86_64-darwin"
-      "i686-darwin"
-      "aarch64-darwin"
-    ];
-  };
-}
diff --git a/pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch b/pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
deleted file mode 100644
index e368357d5cc2..000000000000
--- a/pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/tests/debug/session.py b/tests/debug/session.py
-index d0921956..459c89c0 100644
---- a/tests/debug/session.py
-+++ b/tests/debug/session.py
-@@ -704,6 +704,7 @@ class Session(object):
-         if "PYTHONPATH" in self.config.env:
-             # If specified, launcher will use it in lieu of PYTHONPATH it inherited
-             # from the adapter when spawning debuggee, so we need to adjust again.
-+            self.config.env.prepend_to("PYTHONPATH", os.environ["PYTHONPATH"])
-             self.config.env.prepend_to("PYTHONPATH", DEBUGGEE_PYTHONPATH.strpath)
- 
-         # Adapter is going to start listening for server and spawn the launcher at
diff --git a/pkgs/development/python-modules/debugpy/hardcode-gdb.patch b/pkgs/development/python-modules/debugpy/hardcode-gdb.patch
deleted file mode 100644
index 5cc68b21b3c6..000000000000
--- a/pkgs/development/python-modules/debugpy/hardcode-gdb.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-index 85f3353b..56fab577 100644
---- a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-+++ b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-@@ -410,7 +410,7 @@ def run_python_code_linux(pid, python_code, connect_debugger_tracing=False, show
-     is_debug = 0
-     # Note that the space in the beginning of each line in the multi-line is important!
-     cmd = [
--        'gdb',
-+        '@gdb@/bin/gdb',
-         '--nw',  # no gui interface
-         '--nh',  # no ~/.gdbinit
-         '--nx',  # no .gdbinit
diff --git a/pkgs/development/python-modules/debugpy/hardcode-lldb.patch b/pkgs/development/python-modules/debugpy/hardcode-lldb.patch
deleted file mode 100644
index 215e7ee0f9ca..000000000000
--- a/pkgs/development/python-modules/debugpy/hardcode-lldb.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-index 56fab577..989ede03 100644
---- a/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-+++ b/src/debugpy/_vendored/pydevd/pydevd_attach_to_process/add_code_to_python_process.py
-@@ -500,7 +500,7 @@ def run_python_code_mac(pid, python_code, connect_debugger_tracing=False, show_d
-     is_debug = 0
-     # Note that the space in the beginning of each line in the multi-line is important!
-     cmd = [
--        'lldb',
-+        '@lldb@/bin/lldb',
-         '--no-lldbinit',  # Do not automatically parse any '.lldbinit' files.
-         # '--attach-pid',
-         # str(pid),
diff --git a/pkgs/development/python-modules/debugpy/hardcode-version.patch b/pkgs/development/python-modules/debugpy/hardcode-version.patch
deleted file mode 100644
index 9fa42a0605f8..000000000000
--- a/pkgs/development/python-modules/debugpy/hardcode-version.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 1bfba237..414bb4d5 100644
---- a/setup.py
-+++ b/setup.py
-@@ -12,7 +12,6 @@ import sys
- 
- 
- sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
--import versioneer  # noqa
- 
- del sys.path[0]
- 
-@@ -145,13 +144,13 @@ if __name__ == "__main__":
-     if platforms is not None:
-         extras["platforms"] = platforms
- 
--    cmds = versioneer.get_cmdclass()
-+    cmds = {}
-     override_build(cmds)
-     override_build_py(cmds)
- 
-     setuptools.setup(
-         name="debugpy",
--        version=versioneer.get_version(),
-+        version="@version@",
-         description="An implementation of the Debug Adapter Protocol for Python",  # noqa
-         long_description=long_description,
-         long_description_content_type="text/markdown",
-diff --git a/src/debugpy/public_api.py b/src/debugpy/public_api.py
-index 9d0f705a..ee0b26ca 100644
---- a/src/debugpy/public_api.py
-+++ b/src/debugpy/public_api.py
-@@ -7,8 +7,6 @@ from __future__ import annotations
- import functools
- import typing
- 
--from debugpy import _version
--
- 
- # Expose debugpy.server API from subpackage, but do not actually import it unless
- # and until a member is invoked - we don't want the server package loaded in the
-@@ -191,4 +189,4 @@ def trace_this_thread(__should_trace: bool):
-     """
- 
- 
--__version__: str = _version.get_versions()["version"]
-+__version__: str = "@version@"
diff --git a/pkgs/development/python-modules/debugpy/skip-attach-pid-tests.patch b/pkgs/development/python-modules/debugpy/skip-attach-pid-tests.patch
deleted file mode 100644
index a993940f7266..000000000000
--- a/pkgs/development/python-modules/debugpy/skip-attach-pid-tests.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/tests/debug/runners.py b/tests/debug/runners.py
-index dc60d0ae..cf4a06a3 100644
---- a/tests/debug/runners.py
-+++ b/tests/debug/runners.py
-@@ -163,7 +163,7 @@ def _attach_common_config(session, target, cwd):
- @_runner
- @contextlib.contextmanager
- def attach_pid(session, target, cwd=None, wait=True):
--    if wait and not sys.platform.startswith("linux"):
-+    if wait:
-         pytest.skip("https://github.com/microsoft/ptvsd/issues/1926")
- 
-     log.info("Attaching {0} to {1} by PID.", session, target)
-diff --git a/tests/debugpy/test_attach.py b/tests/debugpy/test_attach.py
-index afabc1ac..2fff3982 100644
---- a/tests/debugpy/test_attach.py
-+++ b/tests/debugpy/test_attach.py
-@@ -151,8 +151,7 @@ def test_reattach(pyfile, target, run):
- 
- 
- @pytest.mark.parametrize("pid_type", ["int", "str"])
--@pytest.mark.skipif(
--    not sys.platform.startswith("linux"),
-+@pytest.mark.skip(
-     reason="https://github.com/microsoft/debugpy/issues/311",
- )
- def test_attach_pid_client(pyfile, target, pid_type):