Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/debugpy/, dev-python/debugpy/files/
Date: Thu, 09 Sep 2021 16:26:01
Message-Id: 1631204716.b8d3a7b1f7e33488fd4fe6bdcfa77af5b4de2c70.andrewammerlaan@gentoo
1 commit: b8d3a7b1f7e33488fd4fe6bdcfa77af5b4de2c70
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 9 16:23:05 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 9 16:25:16 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b8d3a7b1
7
8 dev-python/debugpy: add version 1.4.2
9
10 No keywords until I'm sure the unbundling hack doesn't produce any
11 unexpected side effects
12
13 Bug: https://bugs.gentoo.org/812041
14 Package-Manager: Portage-3.0.22, Repoman-3.0.3
15 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
16
17 dev-python/debugpy/Manifest | 1 +
18 dev-python/debugpy/debugpy-1.4.2.ebuild | 44 ++++++++++++
19 .../files/debugpy-1.4.2-unbundle-pydevd.patch | 78 ++++++++++++++++++++++
20 3 files changed, 123 insertions(+)
21
22 diff --git a/dev-python/debugpy/Manifest b/dev-python/debugpy/Manifest
23 index f429037ba87..0a861ef1295 100644
24 --- a/dev-python/debugpy/Manifest
25 +++ b/dev-python/debugpy/Manifest
26 @@ -1 +1,2 @@
27 DIST debugpy-1.4.1.tar.gz 6687670 BLAKE2B c7761f354700d366d49365b0294ba1f07f357283c7527fc961c702bf99d808835741a899909e37092026c81ff19f6d96ef09c06512c8315ccad158b6e8e47697 SHA512 aef7779cb3a1af76b5cd3d6e8c7e0b78ffe08d1ebe25cf617ca3eb00966d5b3920358809c018f5f1f9eb56b913211134acfdba7d4c0d0174e4d6cfdae058d5f5
28 +DIST debugpy-1.4.2.tar.gz 6673987 BLAKE2B c61d09bc036f3a12e343be3d81b2e834bd69d33df80a6b9e4111d11a2eaea221feea3ac093ca06ad1a840dcab7d53d7b321276c4103420f34adac7a4a4ac8141 SHA512 7c0908ab9202cebb020ca72c558f3c1abc28b44fb968cce4387750f18e67198ad52dd6743061888610ed733e0f7334f986c2655ec7b0a2631acc4919cd9e6c20
29
30 diff --git a/dev-python/debugpy/debugpy-1.4.2.ebuild b/dev-python/debugpy/debugpy-1.4.2.ebuild
31 new file mode 100644
32 index 00000000000..1d2e0eec0d0
33 --- /dev/null
34 +++ b/dev-python/debugpy/debugpy-1.4.2.ebuild
35 @@ -0,0 +1,44 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +
41 +PYTHON_COMPAT=( python3_{8..9} )
42 +
43 +inherit distutils-r1
44 +
45 +DESCRIPTION="An implementation of the Debug Adapter Protocol for Python"
46 +HOMEPAGE="https://github.com/microsoft/debugpy/ https://pypi.org/project/debugpy/"
47 +SRC_URI="https://github.com/microsoft/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
48 +
49 +LICENSE="MIT"
50 +SLOT="0"
51 +KEYWORDS=""
52 +
53 +# There is not enough time in the universe for this test suite
54 +RESTRICT="test"
55 +
56 +BDEPEND="test? ( dev-python/pytest-timeout[${PYTHON_USEDEP}] )"
57 +
58 +RDEPEND="dev-python/pydevd[${PYTHON_USEDEP}]"
59 +
60 +PATCHES=(
61 + "${FILESDIR}/${P}-unbundle-pydevd.patch"
62 +)
63 +
64 +distutils_enable_tests pytest
65 +
66 +python_prepare_all() {
67 + # Drop unnecessary and unrecognized option
68 + # __main__.py: error: unrecognized arguments: -n8
69 + # Do not timeout
70 + sed -i \
71 + -e 's/-n8//g' \
72 + -e '/timeout/d' \
73 + pytest.ini || die
74 +
75 + # Unbundle dev-python/pydevd
76 + rm -r src/debugpy/_vendored || die
77 +
78 + distutils-r1_python_prepare_all
79 +}
80
81 diff --git a/dev-python/debugpy/files/debugpy-1.4.2-unbundle-pydevd.patch b/dev-python/debugpy/files/debugpy-1.4.2-unbundle-pydevd.patch
82 new file mode 100644
83 index 00000000000..7047877ef27
84 --- /dev/null
85 +++ b/dev-python/debugpy/files/debugpy-1.4.2-unbundle-pydevd.patch
86 @@ -0,0 +1,78 @@
87 +diff --git a/setup.py b/setup.py
88 +index ee5bbba..f69dc95 100644
89 +--- a/setup.py
90 ++++ b/setup.py
91 +@@ -21,12 +21,10 @@ del sys.path[0]
92 +
93 + sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src"))
94 + import debugpy
95 +-import debugpy._vendored
96 +
97 + del sys.path[0]
98 +
99 +
100 +-PYDEVD_ROOT = debugpy._vendored.project_root("pydevd")
101 + DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__))
102 +
103 +
104 +@@ -36,27 +34,6 @@ def get_buildplatform():
105 + return None
106 +
107 +
108 +-def cython_build():
109 +- print("Compiling extension modules (set SKIP_CYTHON_BUILD=1 to omit)")
110 +- subprocess.call(
111 +- [
112 +- sys.executable,
113 +- os.path.join(PYDEVD_ROOT, "setup_cython.py"),
114 +- "build_ext",
115 +- "-i",
116 +- ]
117 +- )
118 +-
119 +-
120 +-def iter_vendored_files():
121 +- # Add pydevd files as data files for this package. They are not
122 +- # treated as a package of their own, because we don't actually
123 +- # want to provide pydevd - just use our own copy internally.
124 +- for project in debugpy._vendored.list_all():
125 +- for filename in debugpy._vendored.iter_packaging_files(project):
126 +- yield filename
127 +-
128 +-
129 + # bdist_wheel determines whether the package is pure or not based on ext_modules.
130 + # However, all pydevd native modules are prebuilt and packaged as data, so they
131 + # should not be in the list.
132 +@@ -121,8 +98,6 @@ with open("DESCRIPTION.md", "r") as fh:
133 +
134 +
135 + if __name__ == "__main__":
136 +- if not os.getenv("SKIP_CYTHON_BUILD"):
137 +- cython_build()
138 +
139 + extras = {}
140 + platforms = get_buildplatform()
141 +@@ -165,11 +140,9 @@ if __name__ == "__main__":
142 + "debugpy.common",
143 + "debugpy.launcher",
144 + "debugpy.server",
145 +- "debugpy._vendored",
146 + ],
147 + package_data={
148 + "debugpy": ["ThirdPartyNotices.txt"],
149 +- "debugpy._vendored": list(iter_vendored_files()),
150 + },
151 + ext_modules=ExtModules(),
152 + has_ext_modules=lambda: True,
153 +diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py
154 +index e6a1ad6..a79a86b 100644
155 +--- a/src/debugpy/server/__init__.py
156 ++++ b/src/debugpy/server/__init__.py
157 +@@ -3,7 +3,3 @@
158 + # for license information.
159 +
160 + from __future__ import absolute_import, division, print_function, unicode_literals
161 +-
162 +-# "force_pydevd" must be imported first to ensure (via side effects)
163 +-# that the debugpy-vendored copy of pydevd gets used.
164 +-import debugpy._vendored.force_pydevd # noqa