dev-python/debugpy: add version 1.4.2

No keywords until I'm sure the unbundling hack doesn't produce any
unexpected side effects

Bug: https://bugs.gentoo.org/812041
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
This commit is contained in:
Andrew Ammerlaan
2021-09-09 18:23:05 +02:00
parent 9ccbf9e6f7
commit b8d3a7b1f7
3 changed files with 123 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST debugpy-1.4.1.tar.gz 6687670 BLAKE2B c7761f354700d366d49365b0294ba1f07f357283c7527fc961c702bf99d808835741a899909e37092026c81ff19f6d96ef09c06512c8315ccad158b6e8e47697 SHA512 aef7779cb3a1af76b5cd3d6e8c7e0b78ffe08d1ebe25cf617ca3eb00966d5b3920358809c018f5f1f9eb56b913211134acfdba7d4c0d0174e4d6cfdae058d5f5
DIST debugpy-1.4.2.tar.gz 6673987 BLAKE2B c61d09bc036f3a12e343be3d81b2e834bd69d33df80a6b9e4111d11a2eaea221feea3ac093ca06ad1a840dcab7d53d7b321276c4103420f34adac7a4a4ac8141 SHA512 7c0908ab9202cebb020ca72c558f3c1abc28b44fb968cce4387750f18e67198ad52dd6743061888610ed733e0f7334f986c2655ec7b0a2631acc4919cd9e6c20

View File

@@ -0,0 +1,44 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..9} )
inherit distutils-r1
DESCRIPTION="An implementation of the Debug Adapter Protocol for Python"
HOMEPAGE="https://github.com/microsoft/debugpy/ https://pypi.org/project/debugpy/"
SRC_URI="https://github.com/microsoft/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS=""
# There is not enough time in the universe for this test suite
RESTRICT="test"
BDEPEND="test? ( dev-python/pytest-timeout[${PYTHON_USEDEP}] )"
RDEPEND="dev-python/pydevd[${PYTHON_USEDEP}]"
PATCHES=(
"${FILESDIR}/${P}-unbundle-pydevd.patch"
)
distutils_enable_tests pytest
python_prepare_all() {
# Drop unnecessary and unrecognized option
# __main__.py: error: unrecognized arguments: -n8
# Do not timeout
sed -i \
-e 's/-n8//g' \
-e '/timeout/d' \
pytest.ini || die
# Unbundle dev-python/pydevd
rm -r src/debugpy/_vendored || die
distutils-r1_python_prepare_all
}

View File

@@ -0,0 +1,78 @@
diff --git a/setup.py b/setup.py
index ee5bbba..f69dc95 100644
--- a/setup.py
+++ b/setup.py
@@ -21,12 +21,10 @@ del sys.path[0]
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src"))
import debugpy
-import debugpy._vendored
del sys.path[0]
-PYDEVD_ROOT = debugpy._vendored.project_root("pydevd")
DEBUGBY_ROOT = os.path.dirname(os.path.abspath(debugpy.__file__))
@@ -36,27 +34,6 @@ def get_buildplatform():
return None
-def cython_build():
- print("Compiling extension modules (set SKIP_CYTHON_BUILD=1 to omit)")
- subprocess.call(
- [
- sys.executable,
- os.path.join(PYDEVD_ROOT, "setup_cython.py"),
- "build_ext",
- "-i",
- ]
- )
-
-
-def iter_vendored_files():
- # Add pydevd files as data files for this package. They are not
- # treated as a package of their own, because we don't actually
- # want to provide pydevd - just use our own copy internally.
- for project in debugpy._vendored.list_all():
- for filename in debugpy._vendored.iter_packaging_files(project):
- yield filename
-
-
# bdist_wheel determines whether the package is pure or not based on ext_modules.
# However, all pydevd native modules are prebuilt and packaged as data, so they
# should not be in the list.
@@ -121,8 +98,6 @@ with open("DESCRIPTION.md", "r") as fh:
if __name__ == "__main__":
- if not os.getenv("SKIP_CYTHON_BUILD"):
- cython_build()
extras = {}
platforms = get_buildplatform()
@@ -165,11 +140,9 @@ if __name__ == "__main__":
"debugpy.common",
"debugpy.launcher",
"debugpy.server",
- "debugpy._vendored",
],
package_data={
"debugpy": ["ThirdPartyNotices.txt"],
- "debugpy._vendored": list(iter_vendored_files()),
},
ext_modules=ExtModules(),
has_ext_modules=lambda: True,
diff --git a/src/debugpy/server/__init__.py b/src/debugpy/server/__init__.py
index e6a1ad6..a79a86b 100644
--- a/src/debugpy/server/__init__.py
+++ b/src/debugpy/server/__init__.py
@@ -3,7 +3,3 @@
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
-
-# "force_pydevd" must be imported first to ensure (via side effects)
-# that the debugpy-vendored copy of pydevd gets used.
-import debugpy._vendored.force_pydevd # noqa