mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-debugpy: Update to 1.8.9.
* gnu/packages/python-xyz.scm (python-debugpy): Update to 1.8.9. Change-Id: I323570fc007af04fa8c9c59571cc3cc79833da04
This commit is contained in:
parent
331600e55d
commit
84fa76db42
2 changed files with 95 additions and 96 deletions
|
@ -1,10 +1,9 @@
|
||||||
Allow using pydevd as a regular dependency.
|
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/902
|
||||||
|
|
||||||
diff --git a/setup.py b/setup.py
|
diff -rup a/setup.py b/setup.py
|
||||||
index 5fc40070..3a530a29 100644
|
--- a/setup.py 2024-11-29 23:38:58.549980612 +0100
|
||||||
--- a/setup.py
|
+++ b/setup.py 2024-11-30 00:04:14.281540335 +0100
|
||||||
+++ b/setup.py
|
|
||||||
@@ -11,6 +11,9 @@ import subprocess
|
@@ -11,6 +11,9 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -33,7 +32,7 @@ index 5fc40070..3a530a29 100644
|
||||||
DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__))
|
DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__))
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +73,7 @@ def iter_vendored_files():
|
@@ -46,7 +52,7 @@ def get_buildplatform():
|
||||||
# relevant setuptools versions.
|
# relevant setuptools versions.
|
||||||
class ExtModules(list):
|
class ExtModules(list):
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
|
@ -42,15 +41,19 @@ index 5fc40070..3a530a29 100644
|
||||||
|
|
||||||
|
|
||||||
def override_build(cmds):
|
def override_build(cmds):
|
||||||
@@ -133,9 +139,24 @@ with open("DESCRIPTION.md", "r") as fh:
|
@@ -72,6 +78,8 @@ def override_build_py(cmds):
|
||||||
|
# in data files for binary builds.
|
||||||
|
def finalize_options(self):
|
||||||
|
original(self)
|
||||||
|
+ if DEBUGPY_BUNDLING_DISABLED:
|
||||||
|
+ return True
|
||||||
|
|
||||||
|
# Ensure that pydevd extensions are present for inclusion into data_files.
|
||||||
|
self.announce(
|
||||||
|
@@ -140,6 +148,20 @@ with open("DESCRIPTION.md", "r") as fh:
|
||||||
|
|
||||||
|
|
||||||
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:
|
+ if debugpy.__bundling_disabled__ != DEBUGPY_BUNDLING_DISABLED:
|
||||||
+
|
+
|
||||||
+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f:
|
+ with open(os.path.join(DEBUGBY_ROOT, '__init__.py'), 'r') as f:
|
||||||
|
@ -68,7 +71,7 @@ index 5fc40070..3a530a29 100644
|
||||||
extras = {}
|
extras = {}
|
||||||
platforms = get_buildplatform()
|
platforms = get_buildplatform()
|
||||||
if platforms is not None:
|
if platforms is not None:
|
||||||
@@ -145,6 +166,18 @@ if __name__ == "__main__":
|
@@ -149,6 +171,18 @@ if __name__ == "__main__":
|
||||||
override_build(cmds)
|
override_build(cmds)
|
||||||
override_build_py(cmds)
|
override_build_py(cmds)
|
||||||
|
|
||||||
|
@ -87,7 +90,7 @@ index 5fc40070..3a530a29 100644
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="debugpy",
|
name="debugpy",
|
||||||
version=versioneer.get_version(),
|
version=versioneer.get_version(),
|
||||||
@@ -173,20 +206,10 @@ if __name__ == "__main__":
|
@@ -177,23 +211,10 @@ if __name__ == "__main__":
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
],
|
],
|
||||||
package_dir={"": "src"},
|
package_dir={"": "src"},
|
||||||
|
@ -101,7 +104,10 @@ index 5fc40070..3a530a29 100644
|
||||||
- ],
|
- ],
|
||||||
- package_data={
|
- package_data={
|
||||||
- "debugpy": ["ThirdPartyNotices.txt"],
|
- "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,
|
+ packages=packages,
|
||||||
+ package_data=data,
|
+ package_data=data,
|
||||||
|
@ -109,28 +115,78 @@ index 5fc40070..3a530a29 100644
|
||||||
- has_ext_modules=lambda: True,
|
- has_ext_modules=lambda: True,
|
||||||
+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED,
|
+ has_ext_modules=lambda: not DEBUGPY_BUNDLING_DISABLED,
|
||||||
cmdclass=cmds,
|
cmdclass=cmds,
|
||||||
**extras
|
# allow the user to call "debugpy" instead of "python -m debugpy"
|
||||||
)
|
entry_points={"console_scripts": ["debugpy = debugpy.server.cli:main"]},
|
||||||
diff --git a/src/debugpy/__init__.py b/src/debugpy/__init__.py
|
diff -rup a/src/debugpy/__init__.py b/src/debugpy/__init__.py
|
||||||
index baa5a7c5..7b7a29aa 100644
|
--- a/src/debugpy/__init__.py 2024-11-29 23:38:58.553980600 +0100
|
||||||
--- a/src/debugpy/__init__.py
|
+++ b/src/debugpy/__init__.py 2024-11-29 23:49:38.776095806 +0100
|
||||||
+++ b/src/debugpy/__init__.py
|
@@ -34,5 +34,6 @@ assert sys.version_info >= (3, 7), (
|
||||||
@@ -206,6 +206,8 @@ def trace_this_thread(should_trace):
|
# SyntaxError on Python 2 and preventing the above version check from executing.
|
||||||
|
from debugpy.public_api import * # noqa
|
||||||
__version__ = _version.get_versions()["version"]
|
from debugpy.public_api import __version__
|
||||||
|
|
||||||
+__bundling_disabled__ = False
|
+__bundling_disabled__ = False
|
||||||
+
|
|
||||||
# Force absolute path on Python 2.
|
del sys
|
||||||
|
diff -rup a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py
|
||||||
|
--- a/src/debugpy/server/attach_pid_injected.py 2024-11-29 23:38:58.553980600 +0100
|
||||||
|
+++ b/src/debugpy/server/attach_pid_injected.py 2024-11-29 23:39:48.933831730 +0100
|
||||||
|
@@ -6,6 +6,7 @@
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
+import debugpy
|
||||||
|
|
||||||
__file__ = os.path.abspath(__file__)
|
__file__ = os.path.abspath(__file__)
|
||||||
|
_debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
@@ -28,25 +29,29 @@ def attach(setup):
|
||||||
|
def on_critical(msg):
|
||||||
|
print(msg, file=sys.stderr)
|
||||||
|
|
||||||
diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py
|
- pydevd_attach_to_process_path = os.path.join(
|
||||||
index e6a1ad66..5f29a87a 100644
|
- _debugpy_dir,
|
||||||
--- a/src/debugpy/server/__init__.py
|
- "debugpy",
|
||||||
+++ b/src/debugpy/server/__init__.py
|
- "_vendored",
|
||||||
@@ -4,6 +4,50 @@
|
- "pydevd",
|
||||||
|
- "pydevd_attach_to_process",
|
||||||
|
- )
|
||||||
|
- assert os.path.exists(pydevd_attach_to_process_path)
|
||||||
|
- sys.path.insert(0, pydevd_attach_to_process_path)
|
||||||
|
+ if debugpy.__bundling_disabled__:
|
||||||
|
+ from pydevd_attach_to_process import attach_script
|
||||||
|
+ else:
|
||||||
|
+ pydevd_attach_to_process_path = os.path.join(
|
||||||
|
+ _debugpy_dir,
|
||||||
|
+ "debugpy",
|
||||||
|
+ "_vendored",
|
||||||
|
+ "pydevd",
|
||||||
|
+ "pydevd_attach_to_process",
|
||||||
|
+ )
|
||||||
|
+ assert os.path.exists(pydevd_attach_to_process_path)
|
||||||
|
+ sys.path.insert(0, pydevd_attach_to_process_path)
|
||||||
|
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
- # 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
|
||||||
|
|
||||||
|
attach_script.fix_main_thread_id(
|
||||||
|
on_warn=on_warn, on_exception=on_exception, on_critical=on_critical
|
||||||
|
)
|
||||||
|
|
||||||
|
- # NOTE: At this point it should be safe to remove this.
|
||||||
|
- sys.path.remove(pydevd_attach_to_process_path)
|
||||||
|
+ if not debugpy.__bundling_disabled__:
|
||||||
|
+ # NOTE: At this point it should be safe to remove this.
|
||||||
|
+ sys.path.remove(pydevd_attach_to_process_path)
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
diff -rup a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py
|
||||||
|
--- a/src/debugpy/server/__init__.py 2024-11-29 23:38:58.553980600 +0100
|
||||||
|
+++ b/src/debugpy/server/__init__.py 2024-11-29 23:39:48.933831730 +0100
|
||||||
|
@@ -2,6 +2,50 @@
|
||||||
|
# Licensed under the MIT License. See LICENSE in the project root
|
||||||
|
# for license information.
|
||||||
|
|
||||||
+from importlib import import_module
|
+from importlib import import_module
|
||||||
+import os
|
+import os
|
||||||
|
@ -180,67 +236,13 @@ index e6a1ad66..5f29a87a 100644
|
||||||
+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL
|
+ pydevd_defaults.PydevdCustomization.DEFAULT_PROTOCOL = pydevd_constants.HTTP_JSON_PROTOCOL
|
||||||
+else:
|
+else:
|
||||||
+ import debugpy._vendored.force_pydevd # noqa
|
+ import debugpy._vendored.force_pydevd # noqa
|
||||||
diff --git a/src/debugpy/server/attach_pid_injected.py b/src/debugpy/server/attach_pid_injected.py
|
diff -rup a/tests/tests/test_vendoring.py b/tests/tests/test_vendoring.py
|
||||||
index e6345996..87cfdd53 100644
|
--- a/tests/tests/test_vendoring.py 2024-11-29 23:38:58.549980612 +0100
|
||||||
--- a/src/debugpy/server/attach_pid_injected.py
|
+++ b/tests/tests/test_vendoring.py 2024-11-29 23:50:22.879966500 +0100
|
||||||
+++ b/src/debugpy/server/attach_pid_injected.py
|
@@ -3,6 +3,11 @@
|
||||||
@@ -8,6 +8,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
# for license information.
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
+import debugpy
|
|
||||||
|
|
||||||
__file__ = os.path.abspath(__file__)
|
|
||||||
_debugpy_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
|
||||||
@@ -30,25 +31,29 @@ def attach(setup):
|
|
||||||
def on_critical(msg):
|
|
||||||
print(msg, file=sys.stderr)
|
|
||||||
|
|
||||||
- pydevd_attach_to_process_path = os.path.join(
|
|
||||||
- _debugpy_dir,
|
|
||||||
- "debugpy",
|
|
||||||
- "_vendored",
|
|
||||||
- "pydevd",
|
|
||||||
- "pydevd_attach_to_process",
|
|
||||||
- )
|
|
||||||
- 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__:
|
|
||||||
+ from pydevd_attach_to_process import attach_script
|
|
||||||
+ else:
|
|
||||||
+ pydevd_attach_to_process_path = os.path.join(
|
|
||||||
+ _debugpy_dir,
|
|
||||||
+ "debugpy",
|
|
||||||
+ "_vendored",
|
|
||||||
+ "pydevd",
|
|
||||||
+ "pydevd_attach_to_process",
|
|
||||||
+ )
|
|
||||||
+ 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
|
|
||||||
|
|
||||||
attach_script.fix_main_thread_id(
|
|
||||||
on_warn=on_warn, on_exception=on_exception, on_critical=on_critical
|
|
||||||
)
|
|
||||||
|
|
||||||
- # NOTE: At this point it should be safe to remove this.
|
|
||||||
- sys.path.remove(pydevd_attach_to_process_path)
|
|
||||||
+ if not debugpy.__bundling_disabled__:
|
|
||||||
+ # 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
|
|
||||||
--- a/tests/tests/test_vendoring.py
|
|
||||||
+++ b/tests/tests/test_vendoring.py
|
|
||||||
@@ -1,3 +1,8 @@
|
|
||||||
+import pytest
|
+import pytest
|
||||||
+
|
+
|
||||||
+import debugpy
|
+import debugpy
|
||||||
|
@ -249,6 +251,3 @@ index dd6c4269..28c03702 100644
|
||||||
def test_vendoring(pyfile):
|
def test_vendoring(pyfile):
|
||||||
@pyfile
|
@pyfile
|
||||||
def import_debugpy():
|
def import_debugpy():
|
||||||
--
|
|
||||||
2.34.0
|
|
||||||
|
|
||||||
|
|
|
@ -17292,7 +17292,7 @@ and other @acronym{IDEs, Integrated Development Environments}.")
|
||||||
(define-public python-debugpy
|
(define-public python-debugpy
|
||||||
(package
|
(package
|
||||||
(name "python-debugpy")
|
(name "python-debugpy")
|
||||||
(version "1.6.0")
|
(version "1.8.9")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method git-fetch)
|
(method git-fetch)
|
||||||
|
@ -17307,7 +17307,7 @@ and other @acronym{IDEs, Integrated Development Environments}.")
|
||||||
(patches (search-patches "python-debugpy-unbundle-pydevd.patch"))
|
(patches (search-patches "python-debugpy-unbundle-pydevd.patch"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1dpfzs3p51648i7f3fz8dw5d0vrj39iwn1jhn0226idc02ybyqih"))))
|
"0rq9ndsg4za0np5lnlkdwaqlizay8ndm8ki2m7r7awji262dzzlx"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue