Received: (at 70995) by debbugs.gnu.org; 15 Jun 2024 15:29:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 15 11:29:27 2024 Received: from localhost ([127.0.0.1]:54743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sIVLK-0007Mu-3L for submit <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:29:27 -0400 Received: from 11.mo581.mail-out.ovh.net ([87.98.173.157]:39229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sIVLF-0007MS-V0 for 70995 <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:29:24 -0400 Received: from director1.ghost.mail-out.ovh.net (unknown [10.109.176.211]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 4W1g6l3DWzz19m6 for <70995 <at> debbugs.gnu.org>; Sat, 15 Jun 2024 15:29:19 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tl4dq (unknown [10.110.178.126]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 2ABFC1FD38; Sat, 15 Jun 2024 15:29:18 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-tl4dq with ESMTPSA id 2R3IDU6zbWaAbwAAlPdCyQ (envelope-from <ngraves@HIDDEN>); Sat, 15 Jun 2024 15:29:18 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-108S0021de79a1a-c3eb-433a-a40a-fa54c5d7df4d, 3204031AF3E0A1C7A33289AFCB3553C5868BE597) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v4 2/2] gnu: python-debugpy: Update to 1.8.0. Date: Sat, 15 Jun 2024 17:29:00 +0200 Message-ID: <20240615152915.12986-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240615152915.12986-1-ngraves@HIDDEN> References: <20240615152915.12986-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12920545859131532002 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvuddgkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhephedvtdffvdduudeluefhffdufeehleeffeevuefhjeevleelkeehkeeljeeiveevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsuhhsvghrtghonhhtvghnthdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): Update to 1.8.0. * gnu/packages/patches/python-debugpy-unbundle-pydevd.patch: Update it. Change-Id: Ice5f869fc36b29cb9d0ad998684b0526c16ab79d --- .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- gnu/packages/python-xyz.scm | 6 +- 2 files changed, 201 insertions(+), 123 deletions(-) diff --git a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch index 7a6ad544896..dabdbd2b526 100644 --- a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch +++ b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch @@ -1,137 +1,194 @@ Allow using pydevd as a regular dependency. -Submitted upstream at: https://github.com/microsoft/debugpy/pull/902 +Submitted upstream at: https://github.com/microsoft/debugpy/pull/1586 diff --git a/setup.py b/setup.py -index 5fc40070..3a530a29 100644 +index 0bb4f00c..59fab822 100644 --- a/setup.py +++ b/setup.py -@@ -11,6 +11,9 @@ import subprocess +@@ -11,6 +11,8 @@ import subprocess import sys -+DEBUGPY_BUNDLING_DISABLED = bool(os.getenv('DEBUGPY_BUNDLING_DISABLED')) -+ ++BUNDLE_DEBUGPY = not (os.getenv("BUNDLE_DEBUGPY").strip().lower() == "0") + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import versioneer # noqa -@@ -18,12 +21,15 @@ del sys.path[0] +@@ -18,12 +20,14 @@ del sys.path[0] sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")) import debugpy -import debugpy._vendored + -+if not DEBUGPY_BUNDLING_DISABLED: ++if BUNDLE_DEBUGPY: + import debugpy._vendored del sys.path[0] - +- -PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") -+PYDEVD_ROOT = (None if DEBUGPY_BUNDLING_DISABLED else -+ debugpy._vendored.project_root("pydevd")) ++if BUNDLE_DEBUGPY: ++ PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__)) -@@ -67,7 +73,7 @@ def iter_vendored_files(): +@@ -46,7 +50,7 @@ def get_buildplatform(): # relevant setuptools versions. class ExtModules(list): def __bool__(self): - return True -+ return not DEBUGPY_BUNDLING_DISABLED ++ return BUNDLE_DEBUGPY def override_build(cmds): -@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh: +@@ -147,7 +151,28 @@ if __name__ == "__main__": - - if __name__ == "__main__": -- if not os.getenv("SKIP_CYTHON_BUILD"): -+ if not (os.getenv("SKIP_CYTHON_BUILD") or DEBUGPY_BUNDLING_DISABLED): - cython_build() - -+ # Etch bundling status in the source. -+ if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED: -+ -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f: -+ lines = f.readlines() -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'w') as f: -+ edited = [] -+ for line in lines: -+ if line.startswith('__bundling_disabled__'): -+ edited.append( -+ f'__bundling_disabled__ = {DEBUGPY_BUNDLING_DISABLED}\n') -+ else: -+ edited.append(line) -+ f.writelines(edited) -+ - extras = {} - platforms = get_buildplatform() - if platforms is not None: -@@ -145,6 +166,18 @@ if __name__ == "__main__": + cmds = versioneer.get_cmdclass() override_build(cmds) - override_build_py(cmds) - +- override_build_py(cmds) ++ if BUNDLE_DEBUGPY: ++ override_build_py(cmds) ++ + data = {"debugpy": ["ThirdPartyNotices.txt"]} + packages = [ -+ "debugpy", -+ "debugpy.adapter", -+ "debugpy.common", -+ "debugpy.launcher", -+ "debugpy.server", -+ ] -+ if not DEBUGPY_BUNDLING_DISABLED: -+ data.update({"debugpy._vendored": list(iter_vendored_files())}) ++ "debugpy", ++ "debugpy.adapter", ++ "debugpy.common", ++ "debugpy.launcher", ++ "debugpy.server", ++ ] ++ if BUNDLE_DEBUGPY: ++ data.update( ++ { ++ "debugpy._vendored": [ ++ # pydevd extensions must be built before this list can ++ # be computed properly, so it is populated in the ++ # overridden build_py.finalize_options(). ++ ] ++ } ++ ) + packages.append("debugpy._vendored") -+ + setuptools.setup( name="debugpy", - version=versioneer.get_version(), -@@ -173,20 +206,10 @@ if __name__ == "__main__": +@@ -176,16 +201,10 @@ if __name__ == "__main__": "License :: OSI Approved :: MIT License", ], package_dir={"": "src"}, -- packages=[ -- "debugpy", -- "debugpy.adapter", -- "debugpy.common", -- "debugpy.launcher", -- "debugpy.server", -- "debugpy._vendored", -- ], +- packages=setuptools.find_namespace_packages(where="src", include=["debugpy*"]), - package_data={ - "debugpy": ["ThirdPartyNotices.txt"], -- "debugpy._vendored": list(iter_vendored_files()), +- "debugpy._vendored": [ +- # pydevd extensions must be built before this list can be computed properly, +- # so it is populated in the overridden build_py.finalize_options(). +- ], - }, + packages=packages, + package_data=data, ext_modules=ExtModules(), - has_ext_modules=lambda: True, -+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED, ++ has_ext_modules=lambda: BUNDLE_DEBUGPY, cmdclass=cmds, **extras ) diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py -index baa5a7c5..7b7a29aa 100644 +index 975bec79..512219d7 100644 --- a/src/debugpy/__init__.py +++ b/src/debugpy/__init__.py -@@ -206,6 +206,8 @@ def trace_this_thread(should_trace): +@@ -24,6 +24,13 @@ __all__ = [ # noqa - __version__ = _version.get_versions()["version"] + import sys -+__bundling_disabled__ = False ++try: ++ import debugpy._vendored # noqa + - # Force absolute path on Python 2. - __file__ = os.path.abspath(__file__) ++ is_pydevd_bundled = True ++except ImportError: ++ is_pydevd_bundled = False ++ + assert sys.version_info >= (3, 7), ( + "Python 3.6 and below is not supported by this version of debugpy; " + "use debugpy 1.5.1 or earlier." +diff --git a/src/debugpy/_vendored/force_pydevd.py b/src/debugpy/_vendored/force_pydevd.py +index cfd89275..99622f8c 100644 +--- a/src/debugpy/_vendored/force_pydevd.py ++++ b/src/debugpy/_vendored/force_pydevd.py +@@ -3,7 +3,6 @@ + # for license information. + from importlib import import_module +-import os + import warnings + + from . import check_modules, prefix_matcher, preimport, vendored +@@ -17,23 +16,12 @@ if _unvendored: + # raise ImportError(msg) + warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored))) + +-# If debugpy logging is enabled, enable it for pydevd as well +-if "DEBUGPY_LOG_DIR" in os.environ: +- os.environ[str("PYDEVD_DEBUG")] = str("True") +- os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") +- +-# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. +-if "PYDEVD_USE_FRAME_EVAL" not in os.environ: +- os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") +- + # Constants must be set before importing any other pydevd module +-# # due to heavy use of "from" in them. ++# due to heavy use of "from" in them. + with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=DeprecationWarning) + with vendored('pydevd'): + pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') +-# We limit representation size in our representation provider when needed. +-pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 + + # Now make sure all the top-level modules and packages in pydevd are + # loaded. Any pydevd modules that aren't loaded at this point, will +@@ -50,32 +38,3 @@ with warnings.catch_warnings(): + 'pydevd_plugins', + 'pydevd', + ]) +- +-# When pydevd is imported it sets the breakpoint behavior, but it needs to be +-# overridden because by default pydevd will connect to the remote debugger using +-# its own custom protocol rather than DAP. +-import pydevd # noqa +-import debugpy # noqa +- +- +-def debugpy_breakpointhook(): +- debugpy.breakpoint() +- +- +-pydevd.install_breakpointhook(debugpy_breakpointhook) +- +-# Ensure that pydevd uses JSON protocol +-from _pydevd_bundle import pydevd_constants +-from _pydevd_bundle import pydevd_defaults +-pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL +- +-# Enable some defaults related to debugpy such as sending a single notification when +-# threads pause and stopping on any exception. +-pydevd_defaults.PydevdCustomization.DEBUG_MODE = 'debugpy-dap' +- +-# This is important when pydevd attaches automatically to a subprocess. In this case, we have to +-# make sure that debugpy is properly put back in the game for users to be able to use it. +-pydevd_defaults.PydevdCustomization.PREIMPORT = '%s;%s' % ( +- os.path.dirname(os.path.dirname(debugpy.__file__)), +- 'debugpy._vendored.force_pydevd' +-) diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py -index e6a1ad66..5f29a87a 100644 +index 42d5367f..a27c6bf4 100644 --- a/src/debugpy/server/__init__.py +++ b/src/debugpy/server/__init__.py -@@ -4,6 +4,50 @@ - - from __future__ import absolute_import, division, print_function, unicode_literals +@@ -2,6 +2,70 @@ + # Licensed under the MIT License. See LICENSE in the project root + # for license information. ++from __future__ import absolute_import, division, print_function, unicode_literals ++ +from importlib import import_module +import os + @@ -139,52 +196,70 @@ index e6a1ad66..5f29a87a 100644 # that the debugpy-vendored copy of pydevd gets used. -import debugpy._vendored.force_pydevd # noqa +import debugpy -+if debugpy.__bundling_disabled__: -+ # Do what force_pydevd.py does, but using the system-provided -+ # pydevd. + -+ # XXX: This is copied here so that the whole '_vendored' directory -+ # can be deleted when DEBUGPY_BUNDLING_DISABLED is set. ++# If debugpy logging is enabled, enable it for pydevd as well ++if "DEBUGPY_LOG_DIR" in os.environ: ++ os.environ[str("PYDEVD_DEBUG")] = str("True") ++ os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str( ++ "/debugpy.pydevd.log" ++ ) + -+ # If debugpy logging is enabled, enable it for pydevd as well -+ if "DEBUGPY_LOG_DIR" in os.environ: -+ os.environ[str("PYDEVD_DEBUG")] = str("True") -+ os.environ[str("PYDEVD_DEBUG_FILE")] = \ -+ os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") ++# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. ++if "PYDEVD_USE_FRAME_EVAL" not in os.environ: ++ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") + -+ # Work around https://github.com/microsoft/debugpy/issues/346. -+ # Disable pydevd frame-eval optimizations only if unset, to allow opt-in. -+ if "PYDEVD_USE_FRAME_EVAL" not in os.environ: -+ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") ++BUNDLE_DEBUGPY = bool(os.getenv("BUNDLE_DEBUGPY")) + -+ # Constants must be set before importing any other pydevd module -+ # due to heavy use of "from" in them. -+ pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') -+ # The default pydevd value is 1000. -+ pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 -+ -+ # When pydevd is imported it sets the breakpoint behavior, but it needs to be -+ # overridden because by default pydevd will connect to the remote debugger using -+ # its own custom protocol rather than DAP. -+ import pydevd # noqa -+ import debugpy # noqa -+ -+ def debugpy_breakpointhook(): -+ debugpy.breakpoint() -+ -+ pydevd.install_breakpointhook(debugpy_breakpointhook) -+ -+ # Ensure that pydevd uses JSON protocol -+ from _pydevd_bundle import pydevd_constants -+ from _pydevd_bundle import pydevd_defaults -+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL ++# Constants must be set before importing any other pydevd module ++# due to heavy use of "from" in them. ++if BUNDLE_DEBUGPY: ++ try: ++ import debugpy._vendored.force_pydevd # noqa ++ except Exception as e: ++ raise e +else: -+ import debugpy._vendored.force_pydevd # noqa ++ pydevd_constants = import_module("_pydevd_bundle.pydevd_constants") ++ ++# We limit representation size in our representation provider when needed. ++pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32 ++ ++# When pydevd is imported it sets the breakpoint behavior, but it needs to be ++# overridden because by default pydevd will connect to the remote debugger using ++# its own custom protocol rather than DAP. ++import pydevd # noqa ++import debugpy # noqa ++ ++ ++def debugpy_breakpointhook(): ++ debugpy.breakpoint() ++ ++ ++pydevd.install_breakpointhook(debugpy_breakpointhook) ++ ++# Ensure that pydevd uses JSON protocol ++from _pydevd_bundle import pydevd_constants ++from _pydevd_bundle import pydevd_defaults ++ ++pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = ( ++ pydevd_constants.HTTP_JSON_PROTOCOL ++) ++ ++# Enable some defaults related to debugpy such as sending a single notification when ++# threads pause and stopping on any exception. ++pydevd_defaults.PydevdCustomization.DEBUG_MODE = "debugpy-dap" ++ ++# This is important when pydevd attaches automatically to a subprocess. In this case, we have to ++# make sure that debugpy is properly put back in the game for users to be able to use it. ++if not BUNDLE_DEBUGPY: ++ pydevd_defaults.PydevdCustomization.PREIMPORT = "%s;%s" % ( ++ os.path.dirname(os.path.dirname(debugpy.__file__)), ++ "debugpy._vendored.force_pydevd", ++ ) diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py -index e6345996..87cfdd53 100644 +index a8df6e1e..06e49600 100644 --- a/src/debugpy/server/attach_pid_injected.py +++ b/src/debugpy/server/attach_pid_injected.py -@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera +@@ -6,6 +6,7 @@ import os @@ -192,7 +267,7 @@ index e6345996..87cfdd53 100644 __file__ = os.path.abspath(__file__) _debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) -@@ -30,25 +31,29 @@ def attach(setup): +@@ -28,25 +29,29 @@ def attach(setup): def on_critical(msg): print(msg, file=sys.stderr) @@ -205,10 +280,7 @@ index e6345996..87cfdd53 100644 - ) - assert os.path.exists(pydevd_attach_to_process_path) - sys.path.insert(0, pydevd_attach_to_process_path) -- -- # NOTE: that it's not a part of the pydevd PYTHONPATH -- import attach_script -+ if debugpy.__bundling_disabled__: ++ if not debugpy.is_pydevd_bundled: + from pydevd_attach_to_process import attach_script + else: + pydevd_attach_to_process_path = os.path.join( @@ -220,7 +292,9 @@ index e6345996..87cfdd53 100644 + ) + assert os.path.exists(pydevd_attach_to_process_path) + sys.path.insert(0, pydevd_attach_to_process_path) -+ + +- # NOTE: that it's not a part of the pydevd PYTHONPATH +- import attach_script + # NOTE: that it's not a part of the pydevd PYTHONPATH + import attach_script @@ -230,25 +304,29 @@ index e6345996..87cfdd53 100644 - # NOTE: At this point it should be safe to remove this. - sys.path.remove(pydevd_attach_to_process_path) -+ if not debugpy.__bundling_disabled__: ++ if debugpy.is_pydevd_bundled: + # NOTE: At this point it should be safe to remove this. + sys.path.remove(pydevd_attach_to_process_path) except: import traceback diff --git a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py -index dd6c4269..28c03702 100644 +index 9cf44220..3188eb9e 100644 --- a/tests/tests/test_vendoring.py +++ b/tests/tests/test_vendoring.py -@@ -1,3 +1,8 @@ +@@ -3,6 +3,12 @@ + # for license information. + + +import pytest + +import debugpy + -+@pytest.mark.skipif(debugpy.__bundling_disabled__, reason='Bundling disabled') ++ ++@pytest.mark.skipif(not debugpy.is_pydevd_bundled, reason="pydevd is not bundled") def test_vendoring(pyfile): @pyfile def import_debugpy(): -- -2.34.0 +2.41.0 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index bdf841521fa..d4b5976218b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16841,7 +16841,7 @@ (define-public python-pydevd (define-public python-debugpy (package (name "python-debugpy") - (version "1.6.0") + (version "1.8.0") (source (origin (method git-fetch) @@ -16856,7 +16856,7 @@ (define-public python-debugpy (patches (search-patches "python-debugpy-unbundle-pydevd.patch")) (sha256 (base32 - "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) + "0li02v3d6msr9qp12znzq2h1dki2zsivz6gzi0x06rskrdxxbnd7")))) (build-system pyproject-build-system) (arguments (list @@ -16888,7 +16888,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) + (setenv "BUNDLE_DEBUGPY" "0")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.45.1
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 15 Jun 2024 15:29:24 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 15 11:29:24 2024 Received: from localhost ([127.0.0.1]:54740 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sIVLH-0007Mf-EJ for submit <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:29:24 -0400 Received: from 9.mo576.mail-out.ovh.net ([46.105.56.78]:34597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sIVLE-0007MQ-FE for 70995 <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:29:21 -0400 Received: from director10.ghost.mail-out.ovh.net (unknown [10.108.25.166]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 4W1g6j5ZSYz1hVk for <70995 <at> debbugs.gnu.org>; Sat, 15 Jun 2024 15:29:17 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-mcx2r (unknown [10.110.113.149]) by director10.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 7EBDF1FDEA; Sat, 15 Jun 2024 15:29:17 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-mcx2r with ESMTPSA id dHLDHU2zbWbU7xkAwfDIow (envelope-from <ngraves@HIDDEN>); Sat, 15 Jun 2024 15:29:17 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G00232e6a136-3bbc-4283-9ab1-1b6eff1be18e, 3204031AF3E0A1C7A33289AFCB3553C5868BE597) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v4 1/2] gnu: python-debugpy: Move to pyproject-build-system. Date: Sat, 15 Jun 2024 17:28:59 +0200 Message-ID: <20240615152915.12986-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12919982909101564642 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvuddgledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeegtdeihfffkeejteffkefhveeileeiteekudduffekvdeguefhvdeguedvgeelgfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgihhthhhusghushgvrhgtohhnthgvnhhtrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): [build-system]: Move to pyproject-build-system. [arguments]<#:test-flags>: Superset 'check phase replacement. Change-Id: Ie112f4b25df8f7996124b465b81c84403294f2d5 --- gnu/packages/python-xyz.scm | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index bde5c92bf84..bdf841521fa 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16857,10 +16857,20 @@ (define-public python-debugpy (sha256 (base32 "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:tests? #f ; Fail on systems with YAMA LSM’s ptrace scope > 0. + #:test-flags + '(list "-n" (number->string (parallel-job-count)) + "-k" (string-append + ;; These tests cannot be run in parallel because their + ;; test data would not be copied by xdist and lead to + ;; import errors. (see: + ;; https://github.com/microsoft/debugpy/issues/342 and + ;; https://github.com/microsoft/debugpy/issues/880). + "not test_custom_python_args " + "and not test_autokill ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-sh-in-tests @@ -16878,21 +16888,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" - "-n" (number->string (parallel-job-count)) - "-k" - (string-append - ;; These tests cannot be run in parallel because their - ;; test data would not be copied by xdist and lead to - ;; import errors. (see: - ;; https://github.com/microsoft/debugpy/issues/342 and - ;; https://github.com/microsoft/debugpy/issues/880). - "not test_custom_python_args " - "and not test_autokill ")))))))) + (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.45.1
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 15 Jun 2024 15:27:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 15 11:27:00 2024 Received: from localhost ([127.0.0.1]:54568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sIVIx-0007Fm-NN for submit <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:26:59 -0400 Received: from 10.mo581.mail-out.ovh.net ([178.33.250.56]:35867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sIVIv-0007FW-3u for 70995 <at> debbugs.gnu.org; Sat, 15 Jun 2024 11:26:58 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.148.34]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id 4W1g3y6pJGz1DwK for <70995 <at> debbugs.gnu.org>; Sat, 15 Jun 2024 15:26:54 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-bm5gz (unknown [10.110.168.164]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D68E21FD47; Sat, 15 Jun 2024 15:26:53 +0000 (UTC) Received: from ngraves.fr ([37.59.142.102]) by ghost-submission-6684bf9d7b-bm5gz with ESMTPSA id UnI+M72ybWb99AUAxv7ynA (envelope-from <ngraves@HIDDEN>); Sat, 15 Jun 2024 15:26:53 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-102R004916e886a-de7b-4c75-9039-e5c3442f2248, 3204031AF3E0A1C7A33289AFCB3553C5868BE597) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: Christopher Baines <mail@HIDDEN> Subject: Re: [bug#70995] [PATCH v3 0/2] Update python-debugpy. In-Reply-To: <87ed8y46b3.fsf@HIDDEN> References: <20240517054144.15296-1-ngraves@HIDDEN> <20240528084745.3953-1-ngraves@HIDDEN> <875xufbw0t.fsf@HIDDEN> <87ed8y46b3.fsf@HIDDEN> Date: Sat, 15 Jun 2024 17:26:49 +0200 Message-ID: <875xua447a.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 12879731984340935285 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvuddgkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufgjfhffkfggtgesthdtredttddttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevkeelueejtdehgfffkeelkefhhffftefgvdehkeeluefhheeuleejtdejhfdvgfenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70995 Cc: 70995 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-06-15 16:41, Nicolas Graves via Guix-patches via wrote: > On 2024-06-11 11:42, Christopher Baines wrote: > >> Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> writes: >> >>> Nicolas Graves (2): >>> gnu: python-debugpy: Move to pyproject-build-system. >>> gnu: python-debugpy: Update to 1.8.0. >>> >>> .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- >>> gnu/packages/python-xyz.scm | 32 +- >>> 2 files changed, 212 insertions(+), 138 deletions(-) >> >> From looking at QA, it seems like this change might break >> python-ipykernel, any ideas? > > I'm not sure it breaks, QA is not available anymore and I can build it > without any issues on my side. I've probably forgotten to block this > patch by the pydevd update though, will do. > > Should I submit again after this? > > IIRC, the merging order for the extend work around this is > 70393/71037/70995. In fact, it is properly blocked, and I don't see any issue locally with python-ipykernel. This looks good for a review to me. I'll submit again to give it another go with QA. -- Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 15 Jun 2024 14:41:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 15 10:41:32 2024 Received: from localhost ([127.0.0.1]:51524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sIUay-0002Hu-H7 for submit <at> debbugs.gnu.org; Sat, 15 Jun 2024 10:41:32 -0400 Received: from 1.mo576.mail-out.ovh.net ([178.33.251.173]:53973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sIUav-0002Hf-PB for 70995 <at> debbugs.gnu.org; Sat, 15 Jun 2024 10:41:30 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.9.167]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 4W1f3T5lNdz1hQh for <70995 <at> debbugs.gnu.org>; Sat, 15 Jun 2024 14:41:25 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-4z9br (unknown [10.110.113.13]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 626511FD39; Sat, 15 Jun 2024 14:41:24 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-4z9br with ESMTPSA id 2IYXExSobWY8qQYAEbZ4Wg (envelope-from <ngraves@HIDDEN>); Sat, 15 Jun 2024 14:41:24 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S0048d5b8675-3f87-47d2-905b-bdc047f68959, 3204031AF3E0A1C7A33289AFCB3553C5868BE597) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: Christopher Baines <mail@HIDDEN> Subject: Re: [bug#70995] [PATCH v3 0/2] Update python-debugpy. In-Reply-To: <875xufbw0t.fsf@HIDDEN> References: <20240517054144.15296-1-ngraves@HIDDEN> <20240528084745.3953-1-ngraves@HIDDEN> <875xufbw0t.fsf@HIDDEN> Date: Sat, 15 Jun 2024 16:41:20 +0200 Message-ID: <87ed8y46b3.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 12111586775763903093 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvuddgkedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufgjfhffkfggtgesthdtredttddttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevkeelueejtdehgfffkeelkefhhffftefgvdehkeeluefhheeuleejtdejhfdvgfenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70995 Cc: 70995 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 2024-06-11 11:42, Christopher Baines wrote: > Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> writes: > >> Nicolas Graves (2): >> gnu: python-debugpy: Move to pyproject-build-system. >> gnu: python-debugpy: Update to 1.8.0. >> >> .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- >> gnu/packages/python-xyz.scm | 32 +- >> 2 files changed, 212 insertions(+), 138 deletions(-) > > From looking at QA, it seems like this change might break > python-ipykernel, any ideas? I'm not sure it breaks, QA is not available anymore and I can build it without any issues on my side. I've probably forgotten to block this patch by the pydevd update though, will do. Should I submit again after this? IIRC, the merging order for the extend work around this is 70393/71037/70995. -- Best regards, Nicolas Graves
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 11 Jun 2024 20:33:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 11 16:33:13 2024 Received: from localhost ([127.0.0.1]:36538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sH8B7-0005u2-Cn for submit <at> debbugs.gnu.org; Tue, 11 Jun 2024 16:33:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:47004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1sH8B6-0005td-DJ for submit <at> debbugs.gnu.org; Tue, 11 Jun 2024 16:33:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1sGyxi-000111-NJ for guix-patches@HIDDEN; Tue, 11 Jun 2024 06:42:46 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1sGyxh-0004aF-0h for guix-patches@HIDDEN; Tue, 11 Jun 2024 06:42:46 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id D945027BBE9; Tue, 11 Jun 2024 11:42:42 +0100 (BST) Received: from felis (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id a0c7359d; Tue, 11 Jun 2024 10:42:42 +0000 (UTC) From: Christopher Baines <mail@HIDDEN> To: Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> Subject: Re: [bug#70995] [PATCH v3 0/2] Update python-debugpy. In-Reply-To: <20240528084745.3953-1-ngraves@HIDDEN> (Nicolas Graves via Guix-patches via's message of "Tue, 28 May 2024 10:46:09 +0200") References: <20240517054144.15296-1-ngraves@HIDDEN> <20240528084745.3953-1-ngraves@HIDDEN> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Tue, 11 Jun 2024 11:42:42 +0100 Message-ID: <875xufbw0t.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@HIDDEN; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: 70995 <at> debbugs.gnu.org, Nicolas Graves <ngraves@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> writes: > This proposed update is downgraded to the previous version, because of > the following issue: https://github.com/microsoft/debugpy/issues/1585 > > Nicolas Graves (2): > gnu: python-debugpy: Move to pyproject-build-system. > gnu: python-debugpy: Update to 1.8.0. > > .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- > gnu/packages/python-xyz.scm | 32 +- > 2 files changed, 212 insertions(+), 138 deletions(-) From=20looking at QA, it seems like this change might break python-ipykernel, any ideas? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZoKiJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xesiw/+MXt7nuFhQ3MI65YRBg3urvdZrCfj74R9 uqF5uMxpyQ2neQp+Qo2QXKRoeCV6dyVVrGu2XVBF7jFm0OIsp9tDZLsEMhF+2Zm7 u33D+KJDjazcB49tHxAZbXhKdBo4Dgv3HIA9V3ahtBi+JugmTH5819yFZD+BCf8S 2WwkGOTd6miW4H35w0p+jeTNfVG/LmH5fNbQ1PPuuEMP2Oe60e5c5Mxnb+evwwKE kIPc/XxYgizf9GJAuG3lZwsZa+ndeqilT7TOzXlvnfHawF/2DqhHR9QWpUsHiTBN bi0xPyEexsve51cHOzgZlUxdeos6ZFQQ55azVNg6NqbKj2S/Mju8KDvQR5Tkoq0I zflfb+LRci8B5Ip1x2hhEfHKzjnwMCQ1cSUxQhCSlAuXfwfrDs3/pElKWNM1GWbD chgdqIo6supUNpQWuNkwKzSFqsP49cPAkwrtIynA8Z3M1NW9e8FIOt74oVOBMW71 mHWHi0dU/UdBnC82hGmh+U+Ar8qLc4xTnJUVPCPC0sBp9YUefQGNlmpT34Lf4cXF 0DPP7rWIfLXJNkfECSHME2mjlNEbFdf0DQOBriK3SoDKMAJv35oPN6oUsonbsl9v nocZypy92QUbtNwBiVnn5KjDUipJ/hqPjhq+2Bs8bL+T/vZ2qdah2rUEYb5uzdbs BILzGGQjz4w= =jfCV -----END PGP SIGNATURE----- --=-=-=--
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 11 Jun 2024 16:41:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 11 12:41:14 2024 Received: from localhost ([127.0.0.1]:36098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sH4Yc-00053A-E7 for submit <at> debbugs.gnu.org; Tue, 11 Jun 2024 12:41:14 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mail@HIDDEN>) id 1sH4Ya-00052x-LN for 70995 <at> debbugs.gnu.org; Tue, 11 Jun 2024 12:41:13 -0400 Received: from localhost (unknown [212.132.255.10]) by mira.cbaines.net (Postfix) with ESMTPSA id D945027BBE9; Tue, 11 Jun 2024 11:42:42 +0100 (BST) Received: from felis (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id a0c7359d; Tue, 11 Jun 2024 10:42:42 +0000 (UTC) From: Christopher Baines <mail@HIDDEN> To: Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> Subject: Re: [bug#70995] [PATCH v3 0/2] Update python-debugpy. In-Reply-To: <20240528084745.3953-1-ngraves@HIDDEN> (Nicolas Graves via Guix-patches via's message of "Tue, 28 May 2024 10:46:09 +0200") References: <20240517054144.15296-1-ngraves@HIDDEN> <20240528084745.3953-1-ngraves@HIDDEN> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Tue, 11 Jun 2024 11:42:42 +0100 Message-ID: <875xufbw0t.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 70995 Cc: 70995 <at> debbugs.gnu.org, Nicolas Graves <ngraves@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Graves via Guix-patches via <guix-patches@HIDDEN> writes: > This proposed update is downgraded to the previous version, because of > the following issue: https://github.com/microsoft/debugpy/issues/1585 > > Nicolas Graves (2): > gnu: python-debugpy: Move to pyproject-build-system. > gnu: python-debugpy: Update to 1.8.0. > > .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- > gnu/packages/python-xyz.scm | 32 +- > 2 files changed, 212 insertions(+), 138 deletions(-) From=20looking at QA, it seems like this change might break python-ipykernel, any ideas? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmZoKiJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xesiw/+MXt7nuFhQ3MI65YRBg3urvdZrCfj74R9 uqF5uMxpyQ2neQp+Qo2QXKRoeCV6dyVVrGu2XVBF7jFm0OIsp9tDZLsEMhF+2Zm7 u33D+KJDjazcB49tHxAZbXhKdBo4Dgv3HIA9V3ahtBi+JugmTH5819yFZD+BCf8S 2WwkGOTd6miW4H35w0p+jeTNfVG/LmH5fNbQ1PPuuEMP2Oe60e5c5Mxnb+evwwKE kIPc/XxYgizf9GJAuG3lZwsZa+ndeqilT7TOzXlvnfHawF/2DqhHR9QWpUsHiTBN bi0xPyEexsve51cHOzgZlUxdeos6ZFQQ55azVNg6NqbKj2S/Mju8KDvQR5Tkoq0I zflfb+LRci8B5Ip1x2hhEfHKzjnwMCQ1cSUxQhCSlAuXfwfrDs3/pElKWNM1GWbD chgdqIo6supUNpQWuNkwKzSFqsP49cPAkwrtIynA8Z3M1NW9e8FIOt74oVOBMW71 mHWHi0dU/UdBnC82hGmh+U+Ar8qLc4xTnJUVPCPC0sBp9YUefQGNlmpT34Lf4cXF 0DPP7rWIfLXJNkfECSHME2mjlNEbFdf0DQOBriK3SoDKMAJv35oPN6oUsonbsl9v nocZypy92QUbtNwBiVnn5KjDUipJ/hqPjhq+2Bs8bL+T/vZ2qdah2rUEYb5uzdbs BILzGGQjz4w= =jfCV -----END PGP SIGNATURE----- --=-=-=--
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 28 May 2024 08:48:08 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 04:48:08 2024 Received: from localhost ([127.0.0.1]:45676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sBsV5-0004zp-2T for submit <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:08 -0400 Received: from 15.mo561.mail-out.ovh.net ([87.98.150.177]:34219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sBsV0-0004zD-M5 for 70995 <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:04 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.139.183]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 4VpR3r0mGTz1QVW for <70995 <at> debbugs.gnu.org>; Tue, 28 May 2024 08:47:51 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-v9dj5 (unknown [10.110.113.153]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 8E0131FED4; Tue, 28 May 2024 08:47:51 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-v9dj5 with ESMTPSA id DSLHHTeaVWY0AgAAmdhdeA (envelope-from <ngraves@HIDDEN>); Tue, 28 May 2024 08:47:51 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R002944aab32-3ea8-485e-82f6-313843995080, 82F8FC4CBDF1420FC49AACA8B22D65D2A430FDE8) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v3 2/2] gnu: python-debugpy: Update to 1.8.0. Date: Tue, 28 May 2024 10:46:11 +0200 Message-ID: <20240528084745.3953-3-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240528084745.3953-1-ngraves@HIDDEN> References: <20240528084745.3953-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11112350607946474210 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdejiedgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhephedvtdffvdduudeluefhffdufeehleeffeevuefhjeevleelkeehkeeljeeiveevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsuhhsvghrtghonhhtvghnthdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdelleehseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): Update to 1.8.0. * gnu/packages/patches/python-debugpy-unbundle-pydevd.patch: Update it. Change-Id: Ice5f869fc36b29cb9d0ad998684b0526c16ab79d --- .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- gnu/packages/python-xyz.scm | 6 +- 2 files changed, 201 insertions(+), 123 deletions(-) diff --git a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch index 7a6ad544896..dabdbd2b526 100644 --- a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch +++ b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch @@ -1,137 +1,194 @@ Allow using pydevd as a regular dependency. -Submitted upstream at: https://github.com/microsoft/debugpy/pull/902 +Submitted upstream at: https://github.com/microsoft/debugpy/pull/1586 diff --git a/setup.py b/setup.py -index 5fc40070..3a530a29 100644 +index 0bb4f00c..59fab822 100644 --- a/setup.py +++ b/setup.py -@@ -11,6 +11,9 @@ import subprocess +@@ -11,6 +11,8 @@ import subprocess import sys -+DEBUGPY_BUNDLING_DISABLED = bool(os.getenv('DEBUGPY_BUNDLING_DISABLED')) -+ ++BUNDLE_DEBUGPY = not (os.getenv("BUNDLE_DEBUGPY").strip().lower() == "0") + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import versioneer # noqa -@@ -18,12 +21,15 @@ del sys.path[0] +@@ -18,12 +20,14 @@ del sys.path[0] sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")) import debugpy -import debugpy._vendored + -+if not DEBUGPY_BUNDLING_DISABLED: ++if BUNDLE_DEBUGPY: + import debugpy._vendored del sys.path[0] - +- -PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") -+PYDEVD_ROOT = (None if DEBUGPY_BUNDLING_DISABLED else -+ debugpy._vendored.project_root("pydevd")) ++if BUNDLE_DEBUGPY: ++ PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__)) -@@ -67,7 +73,7 @@ def iter_vendored_files(): +@@ -46,7 +50,7 @@ def get_buildplatform(): # relevant setuptools versions. class ExtModules(list): def __bool__(self): - return True -+ return not DEBUGPY_BUNDLING_DISABLED ++ return BUNDLE_DEBUGPY def override_build(cmds): -@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh: +@@ -147,7 +151,28 @@ if __name__ == "__main__": - - if __name__ == "__main__": -- if not os.getenv("SKIP_CYTHON_BUILD"): -+ if not (os.getenv("SKIP_CYTHON_BUILD") or DEBUGPY_BUNDLING_DISABLED): - cython_build() - -+ # Etch bundling status in the source. -+ if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED: -+ -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f: -+ lines = f.readlines() -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'w') as f: -+ edited = [] -+ for line in lines: -+ if line.startswith('__bundling_disabled__'): -+ edited.append( -+ f'__bundling_disabled__ = {DEBUGPY_BUNDLING_DISABLED}\n') -+ else: -+ edited.append(line) -+ f.writelines(edited) -+ - extras = {} - platforms = get_buildplatform() - if platforms is not None: -@@ -145,6 +166,18 @@ if __name__ == "__main__": + cmds = versioneer.get_cmdclass() override_build(cmds) - override_build_py(cmds) - +- override_build_py(cmds) ++ if BUNDLE_DEBUGPY: ++ override_build_py(cmds) ++ + data = {"debugpy": ["ThirdPartyNotices.txt"]} + packages = [ -+ "debugpy", -+ "debugpy.adapter", -+ "debugpy.common", -+ "debugpy.launcher", -+ "debugpy.server", -+ ] -+ if not DEBUGPY_BUNDLING_DISABLED: -+ data.update({"debugpy._vendored": list(iter_vendored_files())}) ++ "debugpy", ++ "debugpy.adapter", ++ "debugpy.common", ++ "debugpy.launcher", ++ "debugpy.server", ++ ] ++ if BUNDLE_DEBUGPY: ++ data.update( ++ { ++ "debugpy._vendored": [ ++ # pydevd extensions must be built before this list can ++ # be computed properly, so it is populated in the ++ # overridden build_py.finalize_options(). ++ ] ++ } ++ ) + packages.append("debugpy._vendored") -+ + setuptools.setup( name="debugpy", - version=versioneer.get_version(), -@@ -173,20 +206,10 @@ if __name__ == "__main__": +@@ -176,16 +201,10 @@ if __name__ == "__main__": "License :: OSI Approved :: MIT License", ], package_dir={"": "src"}, -- packages=[ -- "debugpy", -- "debugpy.adapter", -- "debugpy.common", -- "debugpy.launcher", -- "debugpy.server", -- "debugpy._vendored", -- ], +- packages=setuptools.find_namespace_packages(where="src", include=["debugpy*"]), - package_data={ - "debugpy": ["ThirdPartyNotices.txt"], -- "debugpy._vendored": list(iter_vendored_files()), +- "debugpy._vendored": [ +- # pydevd extensions must be built before this list can be computed properly, +- # so it is populated in the overridden build_py.finalize_options(). +- ], - }, + packages=packages, + package_data=data, ext_modules=ExtModules(), - has_ext_modules=lambda: True, -+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED, ++ has_ext_modules=lambda: BUNDLE_DEBUGPY, cmdclass=cmds, **extras ) diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py -index baa5a7c5..7b7a29aa 100644 +index 975bec79..512219d7 100644 --- a/src/debugpy/__init__.py +++ b/src/debugpy/__init__.py -@@ -206,6 +206,8 @@ def trace_this_thread(should_trace): +@@ -24,6 +24,13 @@ __all__ = [ # noqa - __version__ = _version.get_versions()["version"] + import sys -+__bundling_disabled__ = False ++try: ++ import debugpy._vendored # noqa + - # Force absolute path on Python 2. - __file__ = os.path.abspath(__file__) ++ is_pydevd_bundled = True ++except ImportError: ++ is_pydevd_bundled = False ++ + assert sys.version_info >= (3, 7), ( + "Python 3.6 and below is not supported by this version of debugpy; " + "use debugpy 1.5.1 or earlier." +diff --git a/src/debugpy/_vendored/force_pydevd.py b/src/debugpy/_vendored/force_pydevd.py +index cfd89275..99622f8c 100644 +--- a/src/debugpy/_vendored/force_pydevd.py ++++ b/src/debugpy/_vendored/force_pydevd.py +@@ -3,7 +3,6 @@ + # for license information. + from importlib import import_module +-import os + import warnings + + from . import check_modules, prefix_matcher, preimport, vendored +@@ -17,23 +16,12 @@ if _unvendored: + # raise ImportError(msg) + warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored))) + +-# If debugpy logging is enabled, enable it for pydevd as well +-if "DEBUGPY_LOG_DIR" in os.environ: +- os.environ[str("PYDEVD_DEBUG")] = str("True") +- os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") +- +-# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. +-if "PYDEVD_USE_FRAME_EVAL" not in os.environ: +- os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") +- + # Constants must be set before importing any other pydevd module +-# # due to heavy use of "from" in them. ++# due to heavy use of "from" in them. + with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=DeprecationWarning) + with vendored('pydevd'): + pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') +-# We limit representation size in our representation provider when needed. +-pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 + + # Now make sure all the top-level modules and packages in pydevd are + # loaded. Any pydevd modules that aren't loaded at this point, will +@@ -50,32 +38,3 @@ with warnings.catch_warnings(): + 'pydevd_plugins', + 'pydevd', + ]) +- +-# When pydevd is imported it sets the breakpoint behavior, but it needs to be +-# overridden because by default pydevd will connect to the remote debugger using +-# its own custom protocol rather than DAP. +-import pydevd # noqa +-import debugpy # noqa +- +- +-def debugpy_breakpointhook(): +- debugpy.breakpoint() +- +- +-pydevd.install_breakpointhook(debugpy_breakpointhook) +- +-# Ensure that pydevd uses JSON protocol +-from _pydevd_bundle import pydevd_constants +-from _pydevd_bundle import pydevd_defaults +-pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL +- +-# Enable some defaults related to debugpy such as sending a single notification when +-# threads pause and stopping on any exception. +-pydevd_defaults.PydevdCustomization.DEBUG_MODE = 'debugpy-dap' +- +-# This is important when pydevd attaches automatically to a subprocess. In this case, we have to +-# make sure that debugpy is properly put back in the game for users to be able to use it. +-pydevd_defaults.PydevdCustomization.PREIMPORT = '%s;%s' % ( +- os.path.dirname(os.path.dirname(debugpy.__file__)), +- 'debugpy._vendored.force_pydevd' +-) diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py -index e6a1ad66..5f29a87a 100644 +index 42d5367f..a27c6bf4 100644 --- a/src/debugpy/server/__init__.py +++ b/src/debugpy/server/__init__.py -@@ -4,6 +4,50 @@ - - from __future__ import absolute_import, division, print_function, unicode_literals +@@ -2,6 +2,70 @@ + # Licensed under the MIT License. See LICENSE in the project root + # for license information. ++from __future__ import absolute_import, division, print_function, unicode_literals ++ +from importlib import import_module +import os + @@ -139,52 +196,70 @@ index e6a1ad66..5f29a87a 100644 # that the debugpy-vendored copy of pydevd gets used. -import debugpy._vendored.force_pydevd # noqa +import debugpy -+if debugpy.__bundling_disabled__: -+ # Do what force_pydevd.py does, but using the system-provided -+ # pydevd. + -+ # XXX: This is copied here so that the whole '_vendored' directory -+ # can be deleted when DEBUGPY_BUNDLING_DISABLED is set. ++# If debugpy logging is enabled, enable it for pydevd as well ++if "DEBUGPY_LOG_DIR" in os.environ: ++ os.environ[str("PYDEVD_DEBUG")] = str("True") ++ os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str( ++ "/debugpy.pydevd.log" ++ ) + -+ # If debugpy logging is enabled, enable it for pydevd as well -+ if "DEBUGPY_LOG_DIR" in os.environ: -+ os.environ[str("PYDEVD_DEBUG")] = str("True") -+ os.environ[str("PYDEVD_DEBUG_FILE")] = \ -+ os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") ++# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. ++if "PYDEVD_USE_FRAME_EVAL" not in os.environ: ++ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") + -+ # Work around https://github.com/microsoft/debugpy/issues/346. -+ # Disable pydevd frame-eval optimizations only if unset, to allow opt-in. -+ if "PYDEVD_USE_FRAME_EVAL" not in os.environ: -+ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") ++BUNDLE_DEBUGPY = bool(os.getenv("BUNDLE_DEBUGPY")) + -+ # Constants must be set before importing any other pydevd module -+ # due to heavy use of "from" in them. -+ pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') -+ # The default pydevd value is 1000. -+ pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 -+ -+ # When pydevd is imported it sets the breakpoint behavior, but it needs to be -+ # overridden because by default pydevd will connect to the remote debugger using -+ # its own custom protocol rather than DAP. -+ import pydevd # noqa -+ import debugpy # noqa -+ -+ def debugpy_breakpointhook(): -+ debugpy.breakpoint() -+ -+ pydevd.install_breakpointhook(debugpy_breakpointhook) -+ -+ # Ensure that pydevd uses JSON protocol -+ from _pydevd_bundle import pydevd_constants -+ from _pydevd_bundle import pydevd_defaults -+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL ++# Constants must be set before importing any other pydevd module ++# due to heavy use of "from" in them. ++if BUNDLE_DEBUGPY: ++ try: ++ import debugpy._vendored.force_pydevd # noqa ++ except Exception as e: ++ raise e +else: -+ import debugpy._vendored.force_pydevd # noqa ++ pydevd_constants = import_module("_pydevd_bundle.pydevd_constants") ++ ++# We limit representation size in our representation provider when needed. ++pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32 ++ ++# When pydevd is imported it sets the breakpoint behavior, but it needs to be ++# overridden because by default pydevd will connect to the remote debugger using ++# its own custom protocol rather than DAP. ++import pydevd # noqa ++import debugpy # noqa ++ ++ ++def debugpy_breakpointhook(): ++ debugpy.breakpoint() ++ ++ ++pydevd.install_breakpointhook(debugpy_breakpointhook) ++ ++# Ensure that pydevd uses JSON protocol ++from _pydevd_bundle import pydevd_constants ++from _pydevd_bundle import pydevd_defaults ++ ++pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = ( ++ pydevd_constants.HTTP_JSON_PROTOCOL ++) ++ ++# Enable some defaults related to debugpy such as sending a single notification when ++# threads pause and stopping on any exception. ++pydevd_defaults.PydevdCustomization.DEBUG_MODE = "debugpy-dap" ++ ++# This is important when pydevd attaches automatically to a subprocess. In this case, we have to ++# make sure that debugpy is properly put back in the game for users to be able to use it. ++if not BUNDLE_DEBUGPY: ++ pydevd_defaults.PydevdCustomization.PREIMPORT = "%s;%s" % ( ++ os.path.dirname(os.path.dirname(debugpy.__file__)), ++ "debugpy._vendored.force_pydevd", ++ ) diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py -index e6345996..87cfdd53 100644 +index a8df6e1e..06e49600 100644 --- a/src/debugpy/server/attach_pid_injected.py +++ b/src/debugpy/server/attach_pid_injected.py -@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera +@@ -6,6 +6,7 @@ import os @@ -192,7 +267,7 @@ index e6345996..87cfdd53 100644 __file__ = os.path.abspath(__file__) _debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) -@@ -30,25 +31,29 @@ def attach(setup): +@@ -28,25 +29,29 @@ def attach(setup): def on_critical(msg): print(msg, file=sys.stderr) @@ -205,10 +280,7 @@ index e6345996..87cfdd53 100644 - ) - assert os.path.exists(pydevd_attach_to_process_path) - sys.path.insert(0, pydevd_attach_to_process_path) -- -- # NOTE: that it's not a part of the pydevd PYTHONPATH -- import attach_script -+ if debugpy.__bundling_disabled__: ++ if not debugpy.is_pydevd_bundled: + from pydevd_attach_to_process import attach_script + else: + pydevd_attach_to_process_path = os.path.join( @@ -220,7 +292,9 @@ index e6345996..87cfdd53 100644 + ) + assert os.path.exists(pydevd_attach_to_process_path) + sys.path.insert(0, pydevd_attach_to_process_path) -+ + +- # NOTE: that it's not a part of the pydevd PYTHONPATH +- import attach_script + # NOTE: that it's not a part of the pydevd PYTHONPATH + import attach_script @@ -230,25 +304,29 @@ index e6345996..87cfdd53 100644 - # NOTE: At this point it should be safe to remove this. - sys.path.remove(pydevd_attach_to_process_path) -+ if not debugpy.__bundling_disabled__: ++ if debugpy.is_pydevd_bundled: + # NOTE: At this point it should be safe to remove this. + sys.path.remove(pydevd_attach_to_process_path) except: import traceback diff --git a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py -index dd6c4269..28c03702 100644 +index 9cf44220..3188eb9e 100644 --- a/tests/tests/test_vendoring.py +++ b/tests/tests/test_vendoring.py -@@ -1,3 +1,8 @@ +@@ -3,6 +3,12 @@ + # for license information. + + +import pytest + +import debugpy + -+@pytest.mark.skipif(debugpy.__bundling_disabled__, reason='Bundling disabled') ++ ++@pytest.mark.skipif(not debugpy.is_pydevd_bundled, reason="pydevd is not bundled") def test_vendoring(pyfile): @pyfile def import_debugpy(): -- -2.34.0 +2.41.0 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1a3c825faab..1468da48999 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16801,7 +16801,7 @@ (define-public python-pydevd (define-public python-debugpy (package (name "python-debugpy") - (version "1.6.0") + (version "1.8.0") (source (origin (method git-fetch) @@ -16816,7 +16816,7 @@ (define-public python-debugpy (patches (search-patches "python-debugpy-unbundle-pydevd.patch")) (sha256 (base32 - "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) + "0li02v3d6msr9qp12znzq2h1dki2zsivz6gzi0x06rskrdxxbnd7")))) (build-system pyproject-build-system) (arguments (list @@ -16848,7 +16848,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) + (setenv "BUNDLE_DEBUGPY" "0")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.41.0
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 28 May 2024 08:48:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 04:48:07 2024 Received: from localhost ([127.0.0.1]:45674 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sBsV4-0004zn-Kr for submit <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:07 -0400 Received: from 1.mo560.mail-out.ovh.net ([46.105.63.121]:56201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sBsV0-0004z2-5K for 70995 <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:03 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.176.211]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4VpR3p4Xpbz1Pqp for <70995 <at> debbugs.gnu.org>; Tue, 28 May 2024 08:47:50 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-xrbqj (unknown [10.110.178.153]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 4E4B61FEF5; Tue, 28 May 2024 08:47:50 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-xrbqj with ESMTPSA id m64cEDaaVWaRWgAAej6yrg (envelope-from <ngraves@HIDDEN>); Tue, 28 May 2024 08:47:50 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R0021370ec27-911e-4e3b-b38c-17c699b4e9db, 82F8FC4CBDF1420FC49AACA8B22D65D2A430FDE8) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v3 1/2] gnu: python-debugpy: Move to pyproject-build-system. Date: Tue, 28 May 2024 10:46:10 +0200 Message-ID: <20240528084745.3953-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240528084745.3953-1-ngraves@HIDDEN> References: <20240528084745.3953-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11112069134025745122 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdejiedgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeevffelhedvfefgieejueejkeeileegheevudehgfdtffejkeegiefhvdevgfdvgfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgihhthhhusghushgvrhgtohhnthgvnhhtrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrdelkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): [build-system]: Move to pyproject-build-system. [arguments]<#:test-flags>: Superset 'check phase replacement. Change-Id: Ie112f4b25df8f7996124b465b81c84403294f2d5 --- gnu/packages/python-xyz.scm | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index e9c89a15dbb..1a3c825faab 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16817,10 +16817,20 @@ (define-public python-debugpy (sha256 (base32 "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:tests? #f ; Fail on systems with YAMA LSM’s ptrace scope > 0. + #:test-flags + '(list "-n" (number->string (parallel-job-count)) + "-k" (string-append + ;; These tests cannot be run in parallel because their + ;; test data would not be copied by xdist and lead to + ;; import errors. (see: + ;; https://github.com/microsoft/debugpy/issues/342 and + ;; https://github.com/microsoft/debugpy/issues/880). + "not test_custom_python_args " + "and not test_autokill ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-sh-in-tests @@ -16838,21 +16848,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" - "-n" (number->string (parallel-job-count)) - "-k" - (string-append - ;; These tests cannot be run in parallel because their - ;; test data would not be copied by xdist and lead to - ;; import errors. (see: - ;; https://github.com/microsoft/debugpy/issues/342 and - ;; https://github.com/microsoft/debugpy/issues/880). - "not test_custom_python_args " - "and not test_autokill ")))))))) + (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.41.0
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 28 May 2024 08:48:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 28 04:48:02 2024 Received: from localhost ([127.0.0.1]:45670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1sBsV0-0004zS-9l for submit <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:02 -0400 Received: from 6.mo560.mail-out.ovh.net ([87.98.165.38]:36249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1sBsUx-0004yy-Bg for 70995 <at> debbugs.gnu.org; Tue, 28 May 2024 04:48:01 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.109.139.176]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4VpR3l6LMmz1Wmt for <70995 <at> debbugs.gnu.org>; Tue, 28 May 2024 08:47:47 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-5sbtl (unknown [10.108.42.240]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 759D81FE58; Tue, 28 May 2024 08:47:47 +0000 (UTC) Received: from ngraves.fr ([37.59.142.98]) by ghost-submission-6684bf9d7b-5sbtl with ESMTPSA id 6ehRFDOaVWZSZQAAvJrnoQ (envelope-from <ngraves@HIDDEN>); Tue, 28 May 2024 08:47:47 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-98R00268f4b979-de1d-4274-8442-630f91b4b1d7, 82F8FC4CBDF1420FC49AACA8B22D65D2A430FDE8) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v3 0/2] Update python-debugpy. Date: Tue, 28 May 2024 10:46:09 +0200 Message-ID: <20240528084745.3953-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11111224708717929186 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdejiedgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepteeffefhfffhjeevleeuvdehgffgveekheeuhfekhfehuefgheffhedugfegleeinecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddrleeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdelleehseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This proposed update is downgraded to the previous version, because of the following issue: https://github.com/microsoft/debugpy/issues/1585 Nicolas Graves (2): gnu: python-debugpy: Move to pyproject-build-system. gnu: python-debugpy: Update to 1.8.0. .../python-debugpy-unbundle-pydevd.patch | 318 +++++++++++------- gnu/packages/python-xyz.scm | 32 +- 2 files changed, 212 insertions(+), 138 deletions(-) -- 2.41.0
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Nicolas Graves <ngraves@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 18 May 2024 10:00:58 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 18 06:00:58 2024 Received: from localhost ([127.0.0.1]:60759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s8Gs5-0000r4-1d for submit <at> debbugs.gnu.org; Sat, 18 May 2024 06:00:58 -0400 Received: from 1.mo575.mail-out.ovh.net ([46.105.41.146]:38929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s8Grz-0000qm-Qo for 70995 <at> debbugs.gnu.org; Sat, 18 May 2024 06:00:54 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.140.229]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4VhK8b1c2Dz1T8c for <70995 <at> debbugs.gnu.org>; Sat, 18 May 2024 10:00:47 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-24qr6 (unknown [10.111.182.119]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id EBC401FE51; Sat, 18 May 2024 10:00:46 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-24qr6 with ESMTPSA id Hy1/Mk58SGZEawQAbAqwSg (envelope-from <ngraves@HIDDEN>); Sat, 18 May 2024 10:00:46 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G004be5e1e59-7ca7-4a39-9ebe-2f74cda620d2, BDB7418199CE68AC6294CEC755C667778ECDC1D2) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v2 2/2] gnu: python-debugpy: Update to 1.8.1. Date: Sat, 18 May 2024 12:00:31 +0200 Message-ID: <20240518100040.13601-2-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240518100040.13601-1-ngraves@HIDDEN> References: <20240518100040.13601-1-ngraves@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 8957378186718208738 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdehiedgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhephedvtdffvdduudeluefhffdufeehleeffeevuefhjeevleelkeehkeeljeeiveevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsuhhsvghrtghonhhtvghnthdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepjedtleelheesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): Update to 1.8.1. * gnu/packages/patches/python-debugpy-unbundle-pydevd.patch: Update it. Change-Id: Ice5f869fc36b29cb9d0ad998684b0526c16ab79d --- .../python-debugpy-unbundle-pydevd.patch | 309 +++++++++++------- gnu/packages/python-xyz.scm | 6 +- 2 files changed, 200 insertions(+), 115 deletions(-) diff --git a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch index 7a6ad544896..899dea70577 100644 --- a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch +++ b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch @@ -1,93 +1,77 @@ Allow using pydevd as a regular dependency. -Submitted upstream at: https://github.com/microsoft/debugpy/pull/902 +Submitted upstream at: https://github.com/microsoft/debugpy/pull/1586 diff --git a/setup.py b/setup.py -index 5fc40070..3a530a29 100644 +index 1bfba237..afffc6b2 100644 --- a/setup.py +++ b/setup.py -@@ -11,6 +11,9 @@ import subprocess +@@ -11,6 +11,8 @@ import subprocess import sys -+DEBUGPY_BUNDLING_DISABLED = bool(os.getenv('DEBUGPY_BUNDLING_DISABLED')) -+ ++BUNDLE_DEBUGPY = not (os.getenv("BUNDLE_DEBUGPY").strip().lower() == "0") + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import versioneer # noqa -@@ -18,12 +21,15 @@ del sys.path[0] +@@ -18,12 +20,14 @@ del sys.path[0] sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")) import debugpy -import debugpy._vendored + -+if not DEBUGPY_BUNDLING_DISABLED: ++if BUNDLE_DEBUGPY: + import debugpy._vendored del sys.path[0] - +- -PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") -+PYDEVD_ROOT = (None if DEBUGPY_BUNDLING_DISABLED else -+ debugpy._vendored.project_root("pydevd")) ++if BUNDLE_DEBUGPY: ++ PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__)) -@@ -67,7 +73,7 @@ def iter_vendored_files(): +@@ -46,7 +50,7 @@ def get_buildplatform(): # relevant setuptools versions. class ExtModules(list): def __bool__(self): - return True -+ return not DEBUGPY_BUNDLING_DISABLED ++ return BUNDLE_DEBUGPY def override_build(cmds): -@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh: +@@ -147,7 +151,28 @@ if __name__ == "__main__": - - if __name__ == "__main__": -- if not os.getenv("SKIP_CYTHON_BUILD"): -+ if not (os.getenv("SKIP_CYTHON_BUILD") or DEBUGPY_BUNDLING_DISABLED): - cython_build() - -+ # Etch bundling status in the source. -+ if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED: -+ -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f: -+ lines = f.readlines() -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'w') as f: -+ edited = [] -+ for line in lines: -+ if line.startswith('__bundling_disabled__'): -+ edited.append( -+ f'__bundling_disabled__ = {DEBUGPY_BUNDLING_DISABLED}\n') -+ else: -+ edited.append(line) -+ f.writelines(edited) -+ - extras = {} - platforms = get_buildplatform() - if platforms is not None: -@@ -145,6 +166,18 @@ if __name__ == "__main__": + cmds = versioneer.get_cmdclass() override_build(cmds) - override_build_py(cmds) - +- override_build_py(cmds) ++ if BUNDLE_DEBUGPY: ++ override_build_py(cmds) ++ + data = {"debugpy": ["ThirdPartyNotices.txt"]} + packages = [ -+ "debugpy", -+ "debugpy.adapter", -+ "debugpy.common", -+ "debugpy.launcher", -+ "debugpy.server", -+ ] -+ if not DEBUGPY_BUNDLING_DISABLED: -+ data.update({"debugpy._vendored": list(iter_vendored_files())}) ++ "debugpy", ++ "debugpy.adapter", ++ "debugpy.common", ++ "debugpy.launcher", ++ "debugpy.server", ++ ] ++ if BUNDLE_DEBUGPY: ++ data.update( ++ { ++ "debugpy._vendored": [ ++ # pydevd extensions must be built before this list can ++ # be computed properly, so it is populated in the ++ # overridden build_py.finalize_options(). ++ ] ++ } ++ ) + packages.append("debugpy._vendored") -+ + setuptools.setup( name="debugpy", - version=versioneer.get_version(), -@@ -173,20 +206,10 @@ if __name__ == "__main__": +@@ -177,23 +202,10 @@ if __name__ == "__main__": "License :: OSI Approved :: MIT License", ], package_dir={"": "src"}, @@ -101,37 +85,117 @@ index 5fc40070..3a530a29 100644 - ], - package_data={ - "debugpy": ["ThirdPartyNotices.txt"], -- "debugpy._vendored": list(iter_vendored_files()), +- "debugpy._vendored": [ +- # pydevd extensions must be built before this list can be computed properly, +- # so it is populated in the overridden build_py.finalize_options(). +- ], - }, + packages=packages, + package_data=data, ext_modules=ExtModules(), - has_ext_modules=lambda: True, -+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED, ++ has_ext_modules=lambda: BUNDLE_DEBUGPY, cmdclass=cmds, **extras ) diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py -index baa5a7c5..7b7a29aa 100644 +index 975bec79..512219d7 100644 --- a/src/debugpy/__init__.py +++ b/src/debugpy/__init__.py -@@ -206,6 +206,8 @@ def trace_this_thread(should_trace): +@@ -24,6 +24,13 @@ __all__ = [ # noqa - __version__ = _version.get_versions()["version"] + import sys -+__bundling_disabled__ = False ++try: ++ import debugpy._vendored # noqa + - # Force absolute path on Python 2. - __file__ = os.path.abspath(__file__) ++ is_pydevd_bundled = True ++except ImportError: ++ is_pydevd_bundled = False ++ + assert sys.version_info >= (3, 7), ( + "Python 3.6 and below is not supported by this version of debugpy; " + "use debugpy 1.5.1 or earlier." +diff --git a/src/debugpy/_vendored/force_pydevd.py b/src/debugpy/_vendored/force_pydevd.py +index cfd89275..99622f8c 100644 +--- a/src/debugpy/_vendored/force_pydevd.py ++++ b/src/debugpy/_vendored/force_pydevd.py +@@ -3,7 +3,6 @@ + # for license information. + from importlib import import_module +-import os + import warnings + + from . import check_modules, prefix_matcher, preimport, vendored +@@ -17,23 +16,12 @@ if _unvendored: + # raise ImportError(msg) + warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored))) + +-# If debugpy logging is enabled, enable it for pydevd as well +-if "DEBUGPY_LOG_DIR" in os.environ: +- os.environ[str("PYDEVD_DEBUG")] = str("True") +- os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") +- +-# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. +-if "PYDEVD_USE_FRAME_EVAL" not in os.environ: +- os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") +- + # Constants must be set before importing any other pydevd module +-# # due to heavy use of "from" in them. ++# due to heavy use of "from" in them. + with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=DeprecationWarning) + with vendored('pydevd'): + pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') +-# We limit representation size in our representation provider when needed. +-pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 + + # Now make sure all the top-level modules and packages in pydevd are + # loaded. Any pydevd modules that aren't loaded at this point, will +@@ -50,32 +38,3 @@ with warnings.catch_warnings(): + 'pydevd_plugins', + 'pydevd', + ]) +- +-# When pydevd is imported it sets the breakpoint behavior, but it needs to be +-# overridden because by default pydevd will connect to the remote debugger using +-# its own custom protocol rather than DAP. +-import pydevd # noqa +-import debugpy # noqa +- +- +-def debugpy_breakpointhook(): +- debugpy.breakpoint() +- +- +-pydevd.install_breakpointhook(debugpy_breakpointhook) +- +-# Ensure that pydevd uses JSON protocol +-from _pydevd_bundle import pydevd_constants +-from _pydevd_bundle import pydevd_defaults +-pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL +- +-# Enable some defaults related to debugpy such as sending a single notification when +-# threads pause and stopping on any exception. +-pydevd_defaults.PydevdCustomization.DEBUG_MODE = 'debugpy-dap' +- +-# This is important when pydevd attaches automatically to a subprocess. In this case, we have to +-# make sure that debugpy is properly put back in the game for users to be able to use it. +-pydevd_defaults.PydevdCustomization.PREIMPORT = '%s;%s' % ( +- os.path.dirname(os.path.dirname(debugpy.__file__)), +- 'debugpy._vendored.force_pydevd' +-) diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py -index e6a1ad66..5f29a87a 100644 +index 42d5367f..a27c6bf4 100644 --- a/src/debugpy/server/__init__.py +++ b/src/debugpy/server/__init__.py -@@ -4,6 +4,50 @@ - - from __future__ import absolute_import, division, print_function, unicode_literals +@@ -2,6 +2,70 @@ + # Licensed under the MIT License. See LICENSE in the project root + # for license information. ++from __future__ import absolute_import, division, print_function, unicode_literals ++ +from importlib import import_module +import os + @@ -139,52 +203,70 @@ index e6a1ad66..5f29a87a 100644 # that the debugpy-vendored copy of pydevd gets used. -import debugpy._vendored.force_pydevd # noqa +import debugpy -+if debugpy.__bundling_disabled__: -+ # Do what force_pydevd.py does, but using the system-provided -+ # pydevd. + -+ # XXX: This is copied here so that the whole '_vendored' directory -+ # can be deleted when DEBUGPY_BUNDLING_DISABLED is set. ++# If debugpy logging is enabled, enable it for pydevd as well ++if "DEBUGPY_LOG_DIR" in os.environ: ++ os.environ[str("PYDEVD_DEBUG")] = str("True") ++ os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str( ++ "/debugpy.pydevd.log" ++ ) + -+ # If debugpy logging is enabled, enable it for pydevd as well -+ if "DEBUGPY_LOG_DIR" in os.environ: -+ os.environ[str("PYDEVD_DEBUG")] = str("True") -+ os.environ[str("PYDEVD_DEBUG_FILE")] = \ -+ os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") ++# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. ++if "PYDEVD_USE_FRAME_EVAL" not in os.environ: ++ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") + -+ # Work around https://github.com/microsoft/debugpy/issues/346. -+ # Disable pydevd frame-eval optimizations only if unset, to allow opt-in. -+ if "PYDEVD_USE_FRAME_EVAL" not in os.environ: -+ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") ++BUNDLE_DEBUGPY = bool(os.getenv("BUNDLE_DEBUGPY")) + -+ # Constants must be set before importing any other pydevd module -+ # due to heavy use of "from" in them. -+ pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') -+ # The default pydevd value is 1000. -+ pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 -+ -+ # When pydevd is imported it sets the breakpoint behavior, but it needs to be -+ # overridden because by default pydevd will connect to the remote debugger using -+ # its own custom protocol rather than DAP. -+ import pydevd # noqa -+ import debugpy # noqa -+ -+ def debugpy_breakpointhook(): -+ debugpy.breakpoint() -+ -+ pydevd.install_breakpointhook(debugpy_breakpointhook) -+ -+ # Ensure that pydevd uses JSON protocol -+ from _pydevd_bundle import pydevd_constants -+ from _pydevd_bundle import pydevd_defaults -+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL ++# Constants must be set before importing any other pydevd module ++# due to heavy use of "from" in them. ++if BUNDLE_DEBUGPY: ++ try: ++ import debugpy._vendored.force_pydevd # noqa ++ except Exception as e: ++ raise e +else: -+ import debugpy._vendored.force_pydevd # noqa ++ pydevd_constants = import_module("_pydevd_bundle.pydevd_constants") ++ ++# We limit representation size in our representation provider when needed. ++pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32 ++ ++# When pydevd is imported it sets the breakpoint behavior, but it needs to be ++# overridden because by default pydevd will connect to the remote debugger using ++# its own custom protocol rather than DAP. ++import pydevd # noqa ++import debugpy # noqa ++ ++ ++def debugpy_breakpointhook(): ++ debugpy.breakpoint() ++ ++ ++pydevd.install_breakpointhook(debugpy_breakpointhook) ++ ++# Ensure that pydevd uses JSON protocol ++from _pydevd_bundle import pydevd_constants ++from _pydevd_bundle import pydevd_defaults ++ ++pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = ( ++ pydevd_constants.HTTP_JSON_PROTOCOL ++) ++ ++# Enable some defaults related to debugpy such as sending a single notification when ++# threads pause and stopping on any exception. ++pydevd_defaults.PydevdCustomization.DEBUG_MODE = "debugpy-dap" ++ ++# This is important when pydevd attaches automatically to a subprocess. In this case, we have to ++# make sure that debugpy is properly put back in the game for users to be able to use it. ++if not BUNDLE_DEBUGPY: ++ pydevd_defaults.PydevdCustomization.PREIMPORT = "%s;%s" % ( ++ os.path.dirname(os.path.dirname(debugpy.__file__)), ++ "debugpy._vendored.force_pydevd", ++ ) diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py -index e6345996..87cfdd53 100644 +index a8df6e1e..06e49600 100644 --- a/src/debugpy/server/attach_pid_injected.py +++ b/src/debugpy/server/attach_pid_injected.py -@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera +@@ -6,6 +6,7 @@ import os @@ -192,7 +274,7 @@ index e6345996..87cfdd53 100644 __file__ = os.path.abspath(__file__) _debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) -@@ -30,25 +31,29 @@ def attach(setup): +@@ -28,25 +29,29 @@ def attach(setup): def on_critical(msg): print(msg, file=sys.stderr) @@ -205,10 +287,7 @@ index e6345996..87cfdd53 100644 - ) - assert os.path.exists(pydevd_attach_to_process_path) - sys.path.insert(0, pydevd_attach_to_process_path) -- -- # NOTE: that it's not a part of the pydevd PYTHONPATH -- import attach_script -+ if debugpy.__bundling_disabled__: ++ if not debugpy.is_pydevd_bundled: + from pydevd_attach_to_process import attach_script + else: + pydevd_attach_to_process_path = os.path.join( @@ -220,7 +299,9 @@ index e6345996..87cfdd53 100644 + ) + assert os.path.exists(pydevd_attach_to_process_path) + sys.path.insert(0, pydevd_attach_to_process_path) -+ + +- # NOTE: that it's not a part of the pydevd PYTHONPATH +- import attach_script + # NOTE: that it's not a part of the pydevd PYTHONPATH + import attach_script @@ -230,25 +311,29 @@ index e6345996..87cfdd53 100644 - # NOTE: At this point it should be safe to remove this. - sys.path.remove(pydevd_attach_to_process_path) -+ if not debugpy.__bundling_disabled__: ++ if debugpy.is_pydevd_bundled: + # NOTE: At this point it should be safe to remove this. + sys.path.remove(pydevd_attach_to_process_path) except: import traceback diff --git a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py -index dd6c4269..28c03702 100644 +index 9cf44220..3188eb9e 100644 --- a/tests/tests/test_vendoring.py +++ b/tests/tests/test_vendoring.py -@@ -1,3 +1,8 @@ +@@ -3,6 +3,12 @@ + # for license information. + + +import pytest + +import debugpy + -+@pytest.mark.skipif(debugpy.__bundling_disabled__, reason='Bundling disabled') ++ ++@pytest.mark.skipif(not debugpy.is_pydevd_bundled, reason="pydevd is not bundled") def test_vendoring(pyfile): @pyfile def import_debugpy(): -- -2.34.0 +2.41.0 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index cf953674b09..0be2f8dc08a 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16807,7 +16807,7 @@ (define-public python-pydevd (define-public python-debugpy (package (name "python-debugpy") - (version "1.6.0") + (version "1.8.1") (source (origin (method git-fetch) @@ -16822,7 +16822,7 @@ (define-public python-debugpy (patches (search-patches "python-debugpy-unbundle-pydevd.patch")) (sha256 (base32 - "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) + "1nnm62c1x06vyq52h0dmyvc78gf7c20474x2mi07x3ab9kf1q3hh")))) (build-system pyproject-build-system) (arguments (list @@ -16854,7 +16854,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) + (setenv "BUNDLE_DEBUGPY" "0")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.41.0
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at 70995) by debbugs.gnu.org; 18 May 2024 10:00:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 18 06:00:55 2024 Received: from localhost ([127.0.0.1]:60757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s8Gs2-0000qx-LN for submit <at> debbugs.gnu.org; Sat, 18 May 2024 06:00:54 -0400 Received: from 3.mo575.mail-out.ovh.net ([46.105.58.60]:40943) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s8Grz-0000ql-Qw for 70995 <at> debbugs.gnu.org; Sat, 18 May 2024 06:00:53 -0400 Received: from director4.ghost.mail-out.ovh.net (unknown [10.109.139.172]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4VhK8Z1dt3z1T52 for <70995 <at> debbugs.gnu.org>; Sat, 18 May 2024 10:00:46 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-jgd8b (unknown [10.110.96.170]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id BE1FD1FDB5; Sat, 18 May 2024 10:00:45 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-jgd8b with ESMTPSA id O+A7Kk18SGbt0gYAblO6Mw (envelope-from <ngraves@HIDDEN>); Sat, 18 May 2024 10:00:45 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G0046ad6237f-513a-4639-a299-236cd54c45b6, BDB7418199CE68AC6294CEC755C667778ECDC1D2) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: 70995 <at> debbugs.gnu.org Subject: [PATCH v2 1/2] gnu: python-debugpy: Move to pyproject-build-system. Date: Sat, 18 May 2024 12:00:30 +0200 Message-ID: <20240518100040.13601-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 8957096710014952162 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdehiedgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeegtdeihfffkeejteffkefhveeileeiteekudduffekvdeguefhvdeguedvgeelgfenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhgihhthhhusghushgvrhgtohhnthgvnhhtrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugeeirddvtdekpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeejtdelleehseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeehpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 70995 Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.3 (/) * gnu/packages/python-xyz.scm (python-debugpy): [build-system]: Move to pyproject-build-system. [arguments]<#:test-flags>: Superset 'check phase replacement. Change-Id: Ie112f4b25df8f7996124b465b81c84403294f2d5 --- gnu/packages/python-xyz.scm | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index da01c71ce03..cf953674b09 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16823,10 +16823,20 @@ (define-public python-debugpy (sha256 (base32 "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:tests? #f ; Fail on systems with YAMA LSM’s ptrace scope > 0. + #:test-flags + '(list "-n" (number->string (parallel-job-count)) + "-k" (string-append + ;; These tests cannot be run in parallel because their + ;; test data would not be copied by xdist and lead to + ;; import errors. (see: + ;; https://github.com/microsoft/debugpy/issues/342 and + ;; https://github.com/microsoft/debugpy/issues/880). + "not test_custom_python_args " + "and not test_autokill ")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-sh-in-tests @@ -16844,21 +16854,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" - "-n" (number->string (parallel-job-count)) - "-k" - (string-append - ;; These tests cannot be run in parallel because their - ;; test data would not be copied by xdist and lead to - ;; import errors. (see: - ;; https://github.com/microsoft/debugpy/issues/342 and - ;; https://github.com/microsoft/debugpy/issues/880). - "not test_custom_python_args " - "and not test_autokill ")))))))) + (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.41.0
guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 17 May 2024 05:42:14 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 17 01:42:14 2024 Received: from localhost ([127.0.0.1]:53144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1s7qM9-0001Zz-L7 for submit <at> debbugs.gnu.org; Fri, 17 May 2024 01:42:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:34724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ngraves@HIDDEN>) id 1s7qM4-0001Zs-MP for submit <at> debbugs.gnu.org; Fri, 17 May 2024 01:42:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>) id 1s7qM0-0007kP-M0 for guix-patches@HIDDEN; Fri, 17 May 2024 01:42:04 -0400 Received: from 6.mo560.mail-out.ovh.net ([87.98.165.38]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ngraves@HIDDEN>) id 1s7qLx-0005pd-Bg for guix-patches@HIDDEN; Fri, 17 May 2024 01:42:04 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.176.211]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 4VgbSG0DC5z1WQK for <guix-patches@HIDDEN>; Fri, 17 May 2024 05:41:49 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-srntm (unknown [10.111.182.37]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 98C311FD83; Fri, 17 May 2024 05:41:49 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-srntm with ESMTPSA id ko+cGR3uRmZyVAYAGZcKFA (envelope-from <ngraves@HIDDEN>); Fri, 17 May 2024 05:41:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-108S002bb8a9f90-516f-4c20-8de2-c46fc75198c5, 375CAD67068A5CA8855CDFAF83AA84566408B2D6) smtp.auth=ngraves@HIDDEN X-OVh-ClientIp: 81.67.146.208 From: Nicolas Graves <ngraves@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH] gnu: python-debugpy: Update to 1.8.1. Date: Fri, 17 May 2024 07:41:41 +0200 Message-ID: <20240517054144.15296-1-ngraves@HIDDEN> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 17157870158962090722 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdehfedgfeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleevteekhffhtdelhfetvddvfeevieefffefjeevteeitedvhefgjefhteekhfeinecuffhomhgrihhnpehgihhthhhusgdrtghomhdpghhithhhuhgsuhhsvghrtghonhhtvghnthdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=87.98.165.38; envelope-from=ngraves@HIDDEN; helo=6.mo560.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: submit Cc: ngraves@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.6 (-) * gnu/packages/python-xyz.scm (python-debugpy): Update to 1.8.1. * gnu/packages/patches/python-debugpy-unbundle-pydevd.patch: Update it. Change-Id: Ice5f869fc36b29cb9d0ad998684b0526c16ab79d --- .../python-debugpy-unbundle-pydevd.patch | 309 +++++++++++------- gnu/packages/python-xyz.scm | 6 +- 2 files changed, 200 insertions(+), 115 deletions(-) diff --git a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch index 7a6ad544896..899dea70577 100644 --- a/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch +++ b/gnu/packages/patches/python-debugpy-unbundle-pydevd.patch @@ -1,93 +1,77 @@ Allow using pydevd as a regular dependency. -Submitted upstream at: https://github.com/microsoft/debugpy/pull/902 +Submitted upstream at: https://github.com/microsoft/debugpy/pull/1586 diff --git a/setup.py b/setup.py -index 5fc40070..3a530a29 100644 +index 1bfba237..afffc6b2 100644 --- a/setup.py +++ b/setup.py -@@ -11,6 +11,9 @@ import subprocess +@@ -11,6 +11,8 @@ import subprocess import sys -+DEBUGPY_BUNDLING_DISABLED = bool(os.getenv('DEBUGPY_BUNDLING_DISABLED')) -+ ++BUNDLE_DEBUGPY = not (os.getenv("BUNDLE_DEBUGPY").strip().lower() == "0") + sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import versioneer # noqa -@@ -18,12 +21,15 @@ del sys.path[0] +@@ -18,12 +20,14 @@ del sys.path[0] sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")) import debugpy -import debugpy._vendored + -+if not DEBUGPY_BUNDLING_DISABLED: ++if BUNDLE_DEBUGPY: + import debugpy._vendored del sys.path[0] - +- -PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") -+PYDEVD_ROOT = (None if DEBUGPY_BUNDLING_DISABLED else -+ debugpy._vendored.project_root("pydevd")) ++if BUNDLE_DEBUGPY: ++ PYDEVD_ROOT = debugpy._vendored.project_root("pydevd") DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__)) -@@ -67,7 +73,7 @@ def iter_vendored_files(): +@@ -46,7 +50,7 @@ def get_buildplatform(): # relevant setuptools versions. class ExtModules(list): def __bool__(self): - return True -+ return not DEBUGPY_BUNDLING_DISABLED ++ return BUNDLE_DEBUGPY def override_build(cmds): -@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh: +@@ -147,7 +151,28 @@ if __name__ == "__main__": - - if __name__ == "__main__": -- if not os.getenv("SKIP_CYTHON_BUILD"): -+ if not (os.getenv("SKIP_CYTHON_BUILD") or DEBUGPY_BUNDLING_DISABLED): - cython_build() - -+ # Etch bundling status in the source. -+ if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED: -+ -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f: -+ lines = f.readlines() -+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'w') as f: -+ edited = [] -+ for line in lines: -+ if line.startswith('__bundling_disabled__'): -+ edited.append( -+ f'__bundling_disabled__ = {DEBUGPY_BUNDLING_DISABLED}\n') -+ else: -+ edited.append(line) -+ f.writelines(edited) -+ - extras = {} - platforms = get_buildplatform() - if platforms is not None: -@@ -145,6 +166,18 @@ if __name__ == "__main__": + cmds = versioneer.get_cmdclass() override_build(cmds) - override_build_py(cmds) - +- override_build_py(cmds) ++ if BUNDLE_DEBUGPY: ++ override_build_py(cmds) ++ + data = {"debugpy": ["ThirdPartyNotices.txt"]} + packages = [ -+ "debugpy", -+ "debugpy.adapter", -+ "debugpy.common", -+ "debugpy.launcher", -+ "debugpy.server", -+ ] -+ if not DEBUGPY_BUNDLING_DISABLED: -+ data.update({"debugpy._vendored": list(iter_vendored_files())}) ++ "debugpy", ++ "debugpy.adapter", ++ "debugpy.common", ++ "debugpy.launcher", ++ "debugpy.server", ++ ] ++ if BUNDLE_DEBUGPY: ++ data.update( ++ { ++ "debugpy._vendored": [ ++ # pydevd extensions must be built before this list can ++ # be computed properly, so it is populated in the ++ # overridden build_py.finalize_options(). ++ ] ++ } ++ ) + packages.append("debugpy._vendored") -+ + setuptools.setup( name="debugpy", - version=versioneer.get_version(), -@@ -173,20 +206,10 @@ if __name__ == "__main__": +@@ -177,23 +202,10 @@ if __name__ == "__main__": "License :: OSI Approved :: MIT License", ], package_dir={"": "src"}, @@ -101,37 +85,117 @@ index 5fc40070..3a530a29 100644 - ], - package_data={ - "debugpy": ["ThirdPartyNotices.txt"], -- "debugpy._vendored": list(iter_vendored_files()), +- "debugpy._vendored": [ +- # pydevd extensions must be built before this list can be computed properly, +- # so it is populated in the overridden build_py.finalize_options(). +- ], - }, + packages=packages, + package_data=data, ext_modules=ExtModules(), - has_ext_modules=lambda: True, -+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED, ++ has_ext_modules=lambda: BUNDLE_DEBUGPY, cmdclass=cmds, **extras ) diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py -index baa5a7c5..7b7a29aa 100644 +index 975bec79..512219d7 100644 --- a/src/debugpy/__init__.py +++ b/src/debugpy/__init__.py -@@ -206,6 +206,8 @@ def trace_this_thread(should_trace): +@@ -24,6 +24,13 @@ __all__ = [ # noqa - __version__ = _version.get_versions()["version"] + import sys -+__bundling_disabled__ = False ++try: ++ import debugpy._vendored # noqa + - # Force absolute path on Python 2. - __file__ = os.path.abspath(__file__) ++ is_pydevd_bundled = True ++except ImportError: ++ is_pydevd_bundled = False ++ + assert sys.version_info >= (3, 7), ( + "Python 3.6 and below is not supported by this version of debugpy; " + "use debugpy 1.5.1 or earlier." +diff --git a/src/debugpy/_vendored/force_pydevd.py b/src/debugpy/_vendored/force_pydevd.py +index cfd89275..99622f8c 100644 +--- a/src/debugpy/_vendored/force_pydevd.py ++++ b/src/debugpy/_vendored/force_pydevd.py +@@ -3,7 +3,6 @@ + # for license information. + from importlib import import_module +-import os + import warnings + + from . import check_modules, prefix_matcher, preimport, vendored +@@ -17,23 +16,12 @@ if _unvendored: + # raise ImportError(msg) + warnings.warn(msg + ':\n {}'.format('\n '.join(_unvendored))) + +-# If debugpy logging is enabled, enable it for pydevd as well +-if "DEBUGPY_LOG_DIR" in os.environ: +- os.environ[str("PYDEVD_DEBUG")] = str("True") +- os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") +- +-# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. +-if "PYDEVD_USE_FRAME_EVAL" not in os.environ: +- os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") +- + # Constants must be set before importing any other pydevd module +-# # due to heavy use of "from" in them. ++# due to heavy use of "from" in them. + with warnings.catch_warnings(): + warnings.simplefilter("ignore", category=DeprecationWarning) + with vendored('pydevd'): + pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') +-# We limit representation size in our representation provider when needed. +-pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 + + # Now make sure all the top-level modules and packages in pydevd are + # loaded. Any pydevd modules that aren't loaded at this point, will +@@ -50,32 +38,3 @@ with warnings.catch_warnings(): + 'pydevd_plugins', + 'pydevd', + ]) +- +-# When pydevd is imported it sets the breakpoint behavior, but it needs to be +-# overridden because by default pydevd will connect to the remote debugger using +-# its own custom protocol rather than DAP. +-import pydevd # noqa +-import debugpy # noqa +- +- +-def debugpy_breakpointhook(): +- debugpy.breakpoint() +- +- +-pydevd.install_breakpointhook(debugpy_breakpointhook) +- +-# Ensure that pydevd uses JSON protocol +-from _pydevd_bundle import pydevd_constants +-from _pydevd_bundle import pydevd_defaults +-pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL +- +-# Enable some defaults related to debugpy such as sending a single notification when +-# threads pause and stopping on any exception. +-pydevd_defaults.PydevdCustomization.DEBUG_MODE = 'debugpy-dap' +- +-# This is important when pydevd attaches automatically to a subprocess. In this case, we have to +-# make sure that debugpy is properly put back in the game for users to be able to use it. +-pydevd_defaults.PydevdCustomization.PREIMPORT = '%s;%s' % ( +- os.path.dirname(os.path.dirname(debugpy.__file__)), +- 'debugpy._vendored.force_pydevd' +-) diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py -index e6a1ad66..5f29a87a 100644 +index 42d5367f..a27c6bf4 100644 --- a/src/debugpy/server/__init__.py +++ b/src/debugpy/server/__init__.py -@@ -4,6 +4,50 @@ - - from __future__ import absolute_import, division, print_function, unicode_literals +@@ -2,6 +2,70 @@ + # Licensed under the MIT License. See LICENSE in the project root + # for license information. ++from __future__ import absolute_import, division, print_function, unicode_literals ++ +from importlib import import_module +import os + @@ -139,52 +203,70 @@ index e6a1ad66..5f29a87a 100644 # that the debugpy-vendored copy of pydevd gets used. -import debugpy._vendored.force_pydevd # noqa +import debugpy -+if debugpy.__bundling_disabled__: -+ # Do what force_pydevd.py does, but using the system-provided -+ # pydevd. + -+ # XXX: This is copied here so that the whole '_vendored' directory -+ # can be deleted when DEBUGPY_BUNDLING_DISABLED is set. ++# If debugpy logging is enabled, enable it for pydevd as well ++if "DEBUGPY_LOG_DIR" in os.environ: ++ os.environ[str("PYDEVD_DEBUG")] = str("True") ++ os.environ[str("PYDEVD_DEBUG_FILE")] = os.environ["DEBUGPY_LOG_DIR"] + str( ++ "/debugpy.pydevd.log" ++ ) + -+ # If debugpy logging is enabled, enable it for pydevd as well -+ if "DEBUGPY_LOG_DIR" in os.environ: -+ os.environ[str("PYDEVD_DEBUG")] = str("True") -+ os.environ[str("PYDEVD_DEBUG_FILE")] = \ -+ os.environ["DEBUGPY_LOG_DIR"] + str("/debugpy.pydevd.log") ++# Disable pydevd frame-eval optimizations only if unset, to allow opt-in. ++if "PYDEVD_USE_FRAME_EVAL" not in os.environ: ++ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") + -+ # Work around https://github.com/microsoft/debugpy/issues/346. -+ # Disable pydevd frame-eval optimizations only if unset, to allow opt-in. -+ if "PYDEVD_USE_FRAME_EVAL" not in os.environ: -+ os.environ[str("PYDEVD_USE_FRAME_EVAL")] = str("NO") ++BUNDLE_DEBUGPY = bool(os.getenv("BUNDLE_DEBUGPY")) + -+ # Constants must be set before importing any other pydevd module -+ # due to heavy use of "from" in them. -+ pydevd_constants = import_module('_pydevd_bundle.pydevd_constants') -+ # The default pydevd value is 1000. -+ pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32 -+ -+ # When pydevd is imported it sets the breakpoint behavior, but it needs to be -+ # overridden because by default pydevd will connect to the remote debugger using -+ # its own custom protocol rather than DAP. -+ import pydevd # noqa -+ import debugpy # noqa -+ -+ def debugpy_breakpointhook(): -+ debugpy.breakpoint() -+ -+ pydevd.install_breakpointhook(debugpy_breakpointhook) -+ -+ # Ensure that pydevd uses JSON protocol -+ from _pydevd_bundle import pydevd_constants -+ from _pydevd_bundle import pydevd_defaults -+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL ++# Constants must be set before importing any other pydevd module ++# due to heavy use of "from" in them. ++if BUNDLE_DEBUGPY: ++ try: ++ import debugpy._vendored.force_pydevd # noqa ++ except Exception as e: ++ raise e +else: -+ import debugpy._vendored.force_pydevd # noqa ++ pydevd_constants = import_module("_pydevd_bundle.pydevd_constants") ++ ++# We limit representation size in our representation provider when needed. ++pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2**32 ++ ++# When pydevd is imported it sets the breakpoint behavior, but it needs to be ++# overridden because by default pydevd will connect to the remote debugger using ++# its own custom protocol rather than DAP. ++import pydevd # noqa ++import debugpy # noqa ++ ++ ++def debugpy_breakpointhook(): ++ debugpy.breakpoint() ++ ++ ++pydevd.install_breakpointhook(debugpy_breakpointhook) ++ ++# Ensure that pydevd uses JSON protocol ++from _pydevd_bundle import pydevd_constants ++from _pydevd_bundle import pydevd_defaults ++ ++pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = ( ++ pydevd_constants.HTTP_JSON_PROTOCOL ++) ++ ++# Enable some defaults related to debugpy such as sending a single notification when ++# threads pause and stopping on any exception. ++pydevd_defaults.PydevdCustomization.DEBUG_MODE = "debugpy-dap" ++ ++# This is important when pydevd attaches automatically to a subprocess. In this case, we have to ++# make sure that debugpy is properly put back in the game for users to be able to use it. ++if not BUNDLE_DEBUGPY: ++ pydevd_defaults.PydevdCustomization.PREIMPORT = "%s;%s" % ( ++ os.path.dirname(os.path.dirname(debugpy.__file__)), ++ "debugpy._vendored.force_pydevd", ++ ) diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py -index e6345996..87cfdd53 100644 +index a8df6e1e..06e49600 100644 --- a/src/debugpy/server/attach_pid_injected.py +++ b/src/debugpy/server/attach_pid_injected.py -@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera +@@ -6,6 +6,7 @@ import os @@ -192,7 +274,7 @@ index e6345996..87cfdd53 100644 __file__ = os.path.abspath(__file__) _debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) -@@ -30,25 +31,29 @@ def attach(setup): +@@ -28,25 +29,29 @@ def attach(setup): def on_critical(msg): print(msg, file=sys.stderr) @@ -205,10 +287,7 @@ index e6345996..87cfdd53 100644 - ) - assert os.path.exists(pydevd_attach_to_process_path) - sys.path.insert(0, pydevd_attach_to_process_path) -- -- # NOTE: that it's not a part of the pydevd PYTHONPATH -- import attach_script -+ if debugpy.__bundling_disabled__: ++ if not debugpy.is_pydevd_bundled: + from pydevd_attach_to_process import attach_script + else: + pydevd_attach_to_process_path = os.path.join( @@ -220,7 +299,9 @@ index e6345996..87cfdd53 100644 + ) + assert os.path.exists(pydevd_attach_to_process_path) + sys.path.insert(0, pydevd_attach_to_process_path) -+ + +- # NOTE: that it's not a part of the pydevd PYTHONPATH +- import attach_script + # NOTE: that it's not a part of the pydevd PYTHONPATH + import attach_script @@ -230,25 +311,29 @@ index e6345996..87cfdd53 100644 - # NOTE: At this point it should be safe to remove this. - sys.path.remove(pydevd_attach_to_process_path) -+ if not debugpy.__bundling_disabled__: ++ if debugpy.is_pydevd_bundled: + # NOTE: At this point it should be safe to remove this. + sys.path.remove(pydevd_attach_to_process_path) except: import traceback diff --git a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py -index dd6c4269..28c03702 100644 +index 9cf44220..3188eb9e 100644 --- a/tests/tests/test_vendoring.py +++ b/tests/tests/test_vendoring.py -@@ -1,3 +1,8 @@ +@@ -3,6 +3,12 @@ + # for license information. + + +import pytest + +import debugpy + -+@pytest.mark.skipif(debugpy.__bundling_disabled__, reason='Bundling disabled') ++ ++@pytest.mark.skipif(not debugpy.is_pydevd_bundled, reason="pydevd is not bundled") def test_vendoring(pyfile): @pyfile def import_debugpy(): -- -2.34.0 +2.41.0 diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index cf953674b09..0be2f8dc08a 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -16807,7 +16807,7 @@ (define-public python-pydevd (define-public python-debugpy (package (name "python-debugpy") - (version "1.6.0") + (version "1.8.1") (source (origin (method git-fetch) @@ -16822,7 +16822,7 @@ (define-public python-debugpy (patches (search-patches "python-debugpy-unbundle-pydevd.patch")) (sha256 (base32 - "1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih")))) + "1nnm62c1x06vyq52h0dmyvc78gf7c20474x2mi07x3ab9kf1q3hh")))) (build-system pyproject-build-system) (arguments (list @@ -16854,7 +16854,7 @@ (define-public python-debugpy (lambda _ ;; This adjusts the behavior of debugpy to load pydevd from ;; Python site packages. - (setenv "DEBUGPY_BUNDLING_DISABLED" "1")))))) + (setenv "BUNDLE_DEBUGPY" "0")))))) (native-inputs ;; See: https://raw.githubusercontent.com/microsoft/debugpy/ ;; main/tests/requirements.txt. -- 2.41.0
Nicolas Graves <ngraves@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#70995
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.