summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/debugpy
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-12-02 18:12:14 +0000
committerRobert Hensing <robert@roberthensing.nl>2022-12-02 18:12:14 +0000
commit7bfbf037d7fea8edca0ef75edd15ce4534052c5c (patch)
tree114669c9b210ea663710cd403350a43288b60e51 /pkgs/development/python-modules/debugpy
parent4e502a1c4d207610b0964b92bb41e574ed62e9c9 (diff)
parentfad052f056576d04a8eb7a6b374584a740e10706 (diff)
Merge remote-tracking branch 'upstream/master' into allow-configuration-of-roles
Diffstat (limited to 'pkgs/development/python-modules/debugpy')
-rw-r--r--pkgs/development/python-modules/debugpy/default.nix46
-rw-r--r--pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch4
-rw-r--r--pkgs/development/python-modules/debugpy/hardcode-gdb.patch2
-rw-r--r--pkgs/development/python-modules/debugpy/hardcode-version.patch32
4 files changed, 41 insertions, 43 deletions
diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix
index 9f6026ce7360..1441dced7158 100644
--- a/pkgs/development/python-modules/debugpy/default.nix
+++ b/pkgs/development/python-modules/debugpy/default.nix
@@ -1,6 +1,7 @@
{ lib
, stdenv
, buildPythonPackage
+, pythonOlder
, fetchFromGitHub
, substituteAll
, gdb
@@ -12,20 +13,20 @@
, pytest-xdist
, pytestCheckHook
, requests
-, isPy3k
-, pythonAtLeast
}:
buildPythonPackage rec {
pname = "debugpy";
- version = "1.6.0";
+ version = "1.6.4";
format = "setuptools";
+ disabled = pythonOlder "3.7";
+
src = fetchFromGitHub {
owner = "Microsoft";
repo = pname;
- rev = "v${version}";
- sha256 = "sha256-WfZz2SimOTpG8CWNUic8NSp4Qd2JTXk+7JSUEPhuQ6Q=";
+ rev = "refs/tags/v${version}";
+ sha256 = "sha256-THhu6Oa4x2b0chLFrJR7FF1z8X3/dsHzXosBmSqaDeI=";
};
patches = [
@@ -59,17 +60,15 @@ buildPythonPackage rec {
cd src/debugpy/_vendored/pydevd/pydevd_attach_to_process
rm *.so *.dylib *.dll *.exe *.pdb
${stdenv.cc}/bin/c++ linux_and_mac/attach.cpp -Ilinux_and_mac -fPIC -nostartfiles ${{
- "x86_64-linux" = "-shared -m64 -o attach_linux_amd64.so";
- "i686-linux" = "-shared -m32 -o attach_linux_x86.so";
+ "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" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -arch x86_64 -o attach_x86_64.dylib";
- "i686-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -arch i386 -o attach_x86.dylib";
- "aarch64-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -arch arm64 -o attach_arm64.dylib";
+ "x86_64-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -o attach_x86_64.dylib";
+ "i686-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -o attach_x86.dylib";
+ "aarch64-darwin" = "-std=c++11 -lc -D_REENTRANT -dynamiclib -o attach_arm64.dylib";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}")}
)'';
- doCheck = isPy3k;
-
checkInputs = [
django
flask
@@ -81,22 +80,22 @@ buildPythonPackage rec {
requests
];
+ preCheck = 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"
- "-n=$NIX_BUILD_CORES"
];
- disabledTests = lib.optionals (pythonAtLeast "3.10") [
- "test_flask_breakpoint_multiproc"
- "test_subprocess[program-launch-None]"
- "test_systemexit[0-zero-uncaught-raised-launch(integratedTerminal)-module]"
- "test_systemexit[0-zero-uncaught--attach_pid-program]"
- "test_success_exitcodes[-break_on_system_exit_zero-0-attach_listen(cli)-module]"
- "test_success_exitcodes[--0-attach_connect(api)-program]"
- "test_run[code-attach_connect(api)]"
- "test_subprocess[program-launch-None]"
- ];
+ # Fixes hanging tests on Darwin
+ __darwinAllowLocalNetworking = true;
pythonImportsCheck = [
"debugpy"
@@ -105,6 +104,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "An 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
index 537531cd9747..0f51106988d9 100644
--- a/pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
+++ b/pkgs/development/python-modules/debugpy/fix-test-pythonpath.patch
@@ -1,8 +1,8 @@
diff --git a/tests/debug/session.py b/tests/debug/session.py
-index 101492fc..4ee7cfbe 100644
+index af242877..30b21a1e 100644
--- a/tests/debug/session.py
+++ b/tests/debug/session.py
-@@ -630,6 +630,7 @@ class Session(object):
+@@ -622,6 +622,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.
diff --git a/pkgs/development/python-modules/debugpy/hardcode-gdb.patch b/pkgs/development/python-modules/debugpy/hardcode-gdb.patch
index 09851260233f..ad40a504c9dc 100644
--- a/pkgs/development/python-modules/debugpy/hardcode-gdb.patch
+++ b/pkgs/development/python-modules/debugpy/hardcode-gdb.patch
@@ -1,5 +1,5 @@
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 3c0e1b94..e995a20f 100644
+index 462feae9..eb2aa945 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
@@ -399,7 +399,7 @@ def run_python_code_linux(pid, python_code, connect_debugger_tracing=False, show
diff --git a/pkgs/development/python-modules/debugpy/hardcode-version.patch b/pkgs/development/python-modules/debugpy/hardcode-version.patch
index 7d3fd5abfc2d..440513e26c1c 100644
--- a/pkgs/development/python-modules/debugpy/hardcode-version.patch
+++ b/pkgs/development/python-modules/debugpy/hardcode-version.patch
@@ -1,5 +1,5 @@
diff --git a/setup.py b/setup.py
-index e7487100..10d36520 100644
+index 5fc40070..775a08ec 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,6 @@ import sys
@@ -26,24 +26,22 @@ index e7487100..10d36520 100644
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/__init__.py b/src/debugpy/__init__.py
-index baa5a7c5..53553272 100644
---- a/src/debugpy/__init__.py
-+++ b/src/debugpy/__init__.py
-@@ -27,7 +27,6 @@ __all__ = [
- import codecs
- import os
+diff --git a/src/debugpy/public_api.py b/src/debugpy/public_api.py
+index 3c800898..27743245 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
- from debugpy.common import compat
+-
+ # 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
+@@ -182,4 +180,4 @@ def trace_this_thread(__should_trace: bool):
+ """
-@@ -204,7 +203,7 @@ def trace_this_thread(should_trace):
- return api.trace_this_thread(should_trace)
-
--__version__ = _version.get_versions()["version"]
-+__version__ = "@version@"
-
- # Force absolute path on Python 2.
- __file__ = os.path.abspath(__file__)
+-__version__: str = _version.get_versions()["version"]
++__version__: str = "@version@"