From 5be479ac8393a51c57d93a7c1997ded95078e460 Mon Sep 17 00:00:00 2001 From: Julian Gilbey Date: Mon, 5 Sep 2022 21:56:24 +0100 Subject: [PATCH] Import pydevd_2.8.0+git20220826.8ee4065+ds-1.debian.tar.xz [dgit import tarball pydevd 2.8.0+git20220826.8ee4065+ds-1 pydevd_2.8.0+git20220826.8ee4065+ds-1.debian.tar.xz] --- README.source | 13 + README.vendoring | 58 ++++ changelog | 65 ++++ control | 74 ++++ copyright | 357 ++++++++++++++++++++ gbp.conf | 7 + get_test_exclusions | 81 +++++ manpage/README.txt | 2 + manpage/pydevd.txt | 45 +++ patches/allow-non-local-tests.patch | 122 +++++++ patches/build_both_extensions.patch | 26 ++ patches/correct-debian-version-number.patch | 17 + patches/do-not-install-data-files.patch | 57 ++++ patches/do-not-use-O3-compile-flag.patch | 33 ++ patches/improve-compilation-system.patch | 255 ++++++++++++++ patches/improve-multiple-test-runs.patch | 54 +++ patches/series | 9 + patches/test_convert_utilities.patch | 39 +++ patches/use-bytecode-package.patch | 53 +++ py3versions_min.py | 23 ++ pybuild.testfiles | 7 + pydevd.README.Debian | 1 + pydevd.install | 1 + pydevd.manpages | 1 + python3-pydevd.README.Debian | 25 ++ python3-pydevd.docs | 1 + python3-pydevd.pyremove | 20 ++ rules | 73 ++++ run_tests | 37 ++ runpy.patch | 72 ++++ source/format | 1 + source/options | 1 + tests/control | 60 ++++ tests/pytest | 62 ++++ upstream/metadata | 5 + watch | 6 + 36 files changed, 1763 insertions(+) create mode 100644 README.source create mode 100644 README.vendoring create mode 100644 changelog create mode 100644 control create mode 100644 copyright create mode 100644 gbp.conf create mode 100755 get_test_exclusions create mode 100644 manpage/README.txt create mode 100644 manpage/pydevd.txt create mode 100644 patches/allow-non-local-tests.patch create mode 100644 patches/build_both_extensions.patch create mode 100644 patches/correct-debian-version-number.patch create mode 100644 patches/do-not-install-data-files.patch create mode 100644 patches/do-not-use-O3-compile-flag.patch create mode 100644 patches/improve-compilation-system.patch create mode 100644 patches/improve-multiple-test-runs.patch create mode 100644 patches/series create mode 100644 patches/test_convert_utilities.patch create mode 100644 patches/use-bytecode-package.patch create mode 100755 py3versions_min.py create mode 100644 pybuild.testfiles create mode 120000 pydevd.README.Debian create mode 100644 pydevd.install create mode 100644 pydevd.manpages create mode 100644 python3-pydevd.README.Debian create mode 100644 python3-pydevd.docs create mode 100644 python3-pydevd.pyremove create mode 100755 rules create mode 100755 run_tests create mode 100644 runpy.patch create mode 100644 source/format create mode 100644 source/options create mode 100644 tests/control create mode 100755 tests/pytest create mode 100644 upstream/metadata create mode 100644 watch diff --git a/README.source b/README.source new file mode 100644 index 0000000..05af66d --- /dev/null +++ b/README.source @@ -0,0 +1,13 @@ +pydevd shared libraries +----------------------- + +pydevd upstream tarball includes compiled shared libraries for x86 and amd64 +which we dont have the source for and are not used in the module. +They also include jython/jar files without sources. + +The upstream tarball also includes vendored libraries, which have been +removed. This is discussed in more detail in debian/README.vendored. + +For these reasons the upstream tarball has been repacked. + + -- Julian Gilbey , Thu, 17 Mar 2022 06:54:45 +0000 diff --git a/README.vendoring b/README.vendoring new file mode 100644 index 0000000..bc0cc76 --- /dev/null +++ b/README.vendoring @@ -0,0 +1,58 @@ +Information about copied and vendored libraries in pydevd +========================================================= + +The upsteam package includes some vendored modules/packages. +These have been removed for the following reasons. + + +* _pydev_bundle/fsnotify/scandir_vendored.py + +This is a replacement for the standard library function os.scandir if +it is missing. This can simply be removed. + + +* _pydevd_bundle/pydevconsole_code_for_ironpython.py + +This is a replacement for the standard library module "code" if it is +missing. This can simply be removed. + + +* _pydevd_bundle/pydevd_runpy.py + +This is a patched version of the standard library runpy module. We +make a copy of the standard library version and patch it during the +build process, ensuring that we always use an up-to-date version of +the library. + + +* pydev_ipython/* + +Almost all of these files have been taken from IPython 1.0.0, +https://github.com/ipython/ipython/tree/rel-1.0.0/IPython. Only +inputhooktk.py, matplotlibtools.py, qt_for_kernel.py, qt_loaders.py, +qt.py and README are new to pydevd. + +However, this mechanism was deprecated in IPython 5.0 and was removed +entirely in IPython 8.0.0; the inputhook mechanism has been completely +rewritten and is now more integrated into the rest of IPython. We +will therefore leave this old version as is. + + +* _pydevd_frame_eval/vendored/bytecode + +This version of the bytecode library has been patched for the purposes +of pydevd. The Debian python3-bytecode package has been patched +similarly (and this does not affect other uses of the package). So we +remove the entire vendored directory as we now have no need for it. + + +* third_party + +Nothing in here appears to be used in the rest of the code. The only +reference to it is in interpreterInfo.py, where the local ctypes +module is imported if the system version cannot be found. But with +Python 3.9+, failing to find ctypes would be a very serious matter. +So we can remove this entire directory. + + + -- Julian Gilbey , Wed, 16 Mar 2022 09:56:34 +0000 diff --git a/changelog b/changelog new file mode 100644 index 0000000..83ee337 --- /dev/null +++ b/changelog @@ -0,0 +1,65 @@ +pydevd (2.8.0+git20220826.8ee4065+ds-1) unstable; urgency=medium + + * New upstream snapshot + * Skip another failing test on armel + * Mark autopkgtests as flaky on architectures other than amd64 and i386 + (closes: #1019151) + * Improve tests based on Spyder test process + + -- Julian Gilbey Mon, 05 Sep 2022 21:56:24 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-6) unstable; urgency=medium + + * Add Breaks+Replaces python3-omegaconf (Closes: #1016511) + + -- Julian Gilbey Mon, 08 Aug 2022 20:07:18 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-5) unstable; urgency=medium + + * Having some new autopkgtest failings; skip these and note them in + README.Debian + + -- Julian Gilbey Thu, 04 Aug 2022 20:33:58 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-4) unstable; urgency=medium + + * Add gdb back to autopkgtest dependencies to work around bug#978639 in + debci + + -- Julian Gilbey Thu, 04 Aug 2022 08:06:49 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-3) unstable; urgency=medium + + * Move gdb and python3-coverage to Depends of python3-pydevd; remove all + other Suggests except for pydevd + + -- Julian Gilbey Wed, 03 Aug 2022 19:21:25 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-2) unstable; urgency=medium + + * Skip some failing tests on mips64el and ppc64el + + -- Julian Gilbey Fri, 29 Jul 2022 14:14:06 +0100 + +pydevd (2.8.0+git20220714.32dee0b+dfsg-1) unstable; urgency=medium + + * New upstream snapshot + * Fix binary-only build: it must not install /usr/bin/pydevd in the + python3-pydevd package + * Improvements to autopkgtest script + + -- Julian Gilbey Wed, 27 Jul 2022 21:06:59 +0100 + +pydevd (2.8.0+git20220602.1b1fb8b+dfsg-2) unstable; urgency=medium + + * Source-only upload + + -- Julian Gilbey Sun, 24 Jul 2022 08:35:58 +0100 + +pydevd (2.8.0+git20220602.1b1fb8b+dfsg-1) unstable; urgency=medium + + * Initial release (Closes: #933070) + * Initial packaging by William Grzybowski and + Julian Gilbey + + -- Julian Gilbey Wed, 13 Jul 2022 06:51:12 +0100 diff --git a/control b/control new file mode 100644 index 0000000..1991c7d --- /dev/null +++ b/control @@ -0,0 +1,74 @@ +Source: pydevd +Section: python +Priority: optional +Maintainer: Debian Python Team +Uploaders: Julian Gilbey +Build-Depends: cython3, + debhelper-compat (= 13), + dh-python, + dh-sequence-python3, + gdb , + libqt5x11extras5 , + procps , + python3-all-dev, + python3-bytecode, + python3-cherrypy3 , + python3-coverage , + python3-django , + python3-flask , + python3-gevent , + python3-ipython , + python3-jinja2 , + python3-matplotlib , + python3-numpy , + python3-pandas , + python3-psutil , + python3-pyqt5 , + python3-pyqt5.qtsvg , + python3-pytest , + python3-pytest-xdist , + python3-setuptools, + python3-trio , + python3-untangle , + txt2man, + xauth , + xvfb +Standards-Version: 4.6.1 +Rules-Requires-Root: no +Homepage: https://github.com/fabioz/PyDev.Debugger/ +Vcs-Browser: https://salsa.debian.org/python-team/packages/pydevd +Vcs-Git: https://salsa.debian.org/python-team/packages/pydevd.git + +Package: pydevd +Architecture: all +Depends: python3-pydevd (>= ${binary:Version}), + ${misc:Depends}, + ${python3:Depends} +Section: utils +Description: Script to start pydevd debugger + This script is meant to run pydevd on top of another Python script, + making it ready to be attached for remote debugging, connecting from + an IDE, such as PyDev or PyCharm). + +Package: python3-pydevd +Architecture: any +Depends: gdb, + python3-bytecode, + python3-coverage, + ${misc:Depends}, + ${python3:Depends}, + ${shlibs:Depends} +Suggests: pydevd +Breaks: python3-omegaconf (<< 2.2.2-1) +Replaces: python3-omegaconf (<< 2.2.2-1) +Description: Debugger used by debugpy + This is the debugger underlying debugpy, which is used by IPython and + Spyder, among others. + . + Some IDEs already have pydevd bundled with them (such as PyDev or PyCharm); + you do not need this package if you are using one of them. + . + This package can also be used for doing remote debugging, connecting from + an IDE. + . + The command-line "pydevd" tool is available in the separate pydevd package. diff --git a/copyright b/copyright new file mode 100644 index 0000000..804b78a --- /dev/null +++ b/copyright @@ -0,0 +1,357 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: PyDev.Debugger +Source: https://pypi.org/project/pydevd/ +Files-Excluded: + *.dll + *.dylib + *.jar + *.so + *.exe + _pydevd_bundle/pydevd_runpy.py + _pydevd_frame_eval/vendored + third_party +Comment: Repacked to remove pre-compiled shared libraries and vendored + modules. See debian/README.vendoring in the source package for more details. + +Files: * +Copyright: Fabio Zadrozny + Brainwy Software Ltda. +License: EPL-1.0 +Comment: No explicit copyright statement on most of the repository; the + author is Fabio Zadrozny, and the organisation "owning" PyDev, of which + PyDev.Debugger is a part, is Brainwy Software Ltda. + +Files: pydevd_attach_to_process/common/python.h + pydevd_attach_to_process/windows/stdafx.h + pydevd_attach_to_process/windows/stdafx.cpp + pydevd_attach_to_process/windows/targetver.h + pydevd_attach_to_process/windows/attach.cpp +Copyright: Microsoft Corporation +License: Apache-2.0 + +Files: pydevd_attach_to_process/windows/attach.h +Copyright: Brainwy software Ltda +License: Apache-2.0 + +Files: pydevd_attach_to_process/add_code_to_python_process.py +Copyright: Brainwy software Ltda +License: EPL-1.0 + +Files: _pydev_bundle/_pydev_calltip_util.py +Copyright: Yuli Fitterman +License: Apache-2.0 + +Files: _pydev_bundle/pydev_umd.py +Copyright: 2009-2012 Pierre Raybaut +License: MIT + +Files: pydev_ipython/inputhook.py + pydev_ipython/inputhookglut.py + pydev_ipython/inputhookgtk.py + pydev_ipython/inputhookgtk3.py + pydev_ipython/inputhookpyglet.py + pydev_ipython/inputhookqt4.py + pydev_ipython/inputhookqt5.py + pydev_ipython/inputhookwx.py + pydev_ipython/version.py +Copyright: 2008-2013 IPython Development Team +License: BSD-3-Clause + +Files: _pydevd_bundle/pydevd_safe_repr.py +Copyright: Microsoft Corporation +License: MIT + +Files: pydevd_attach_to_process/winappdbg/* +Copyright: 2009-2014 Mario Vilas +License: BSD-3-Clause + +Files: pydevd_attach_to_process/winappdbg/compat.py +Copyright: 2010-2014 Benjamin Peterson +License: MIT + +Files: debian/* +Copyright: 2019 William Grzybowski + 2022 Julian Gilbey +License: EPL-1.0 + +Files: debian/patches/improve-multiple-test-runs.patch +Copyright: Spyder Project Contributors + Julian Gilbey +License: MIT + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HOLDERS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: EPL-1.0 + Eclipse Public License - v 1.0 + . + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE + PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + . + 1. DEFINITIONS + . + "Contribution" means: + . + a) in the case of the initial Contributor, the initial code and documentation + distributed under this Agreement, and + b) in the case of each subsequent Contributor: + . + i) changes to the Program, and + . + ii) additions to the Program; + . + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' + from a Contributor if it was added to the Program by such Contributor itself + or anyone acting on such Contributor's behalf. Contributions do not include + additions to the Program which: (i) are separate modules of software + distributed in conjunction with the Program under their own license + agreement, and (ii) are not derivative works of the Program. + . + "Contributor" means any person or entity that distributes the Program. + . + "Licensed Patents " mean patent claims licensable by a Contributor which are + necessarily infringed by the use or sale of its Contribution alone or when + combined with the Program. + . + "Program" means the Contributions distributed in accordance with this + Agreement. + . + "Recipient" means anyone who receives the Program under this Agreement, + including all Contributors. + . + 2. GRANT OF RIGHTS + . + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such Contributor, if any, + and such derivative works, in source code and object code form. + . + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of + the Contribution and the Program if, at the time the Contribution is added + by the Contributor, such addition of the Contribution causes such + combination to be covered by the Licensed Patents. The patent license shall + not apply to any other combinations which include the Contribution. No + hardware per se is licensed hereunder. + . + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor disclaims + any liability to Recipient for claims brought by any other entity based on + infringement of intellectual property rights or otherwise. As a condition to + exercising the rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual property rights + needed, if any. For example, if a third party patent license is required to + allow Recipient to distribute the Program, it is Recipient's responsibility + to acquire that license before distributing the Program. + . + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright license + set forth in this Agreement. + . + 3. REQUIREMENTS + . + A Contributor may choose to distribute the Program in object code form under + its own license agreement, provided that: + . + a) it complies with the terms and conditions of this Agreement; and + . + b) its license agreement: + . + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of title + and non-infringement, and implied warranties or conditions of merchantability + and fitness for a particular purpose; + . + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + . + iii) states that any provisions which differ from this Agreement are offered + by that Contributor alone and not by any other party; and + . + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner on + or through a medium customarily used for software exchange. + . + When the Program is made available in source code form: + . + a) it must be made available under this Agreement; and + . + b) a copy of this Agreement must be included with each copy of the Program. + . + Contributors may not remove or alter any copyright notices contained within + the Program. + . + Each Contributor must identify itself as the originator of its Contribution, + if any, in a manner that reasonably allows subsequent Recipients to identify + the originator of the Contribution. + . + 4. COMMERCIAL DISTRIBUTION + . + Commercial distributors of software may accept certain responsibilities with + respect to end users, business partners and the like. While this license is + intended to facilitate the commercial use of the Program, the Contributor who + includes the Program in a commercial product offering should do so in a manner + which does not create potential liability for other Contributors. Therefore, + if a Contributor includes the Program in a commercial product offering, such + Contributor ("Commercial Contributor") hereby agrees to defend and indemnify + every other Contributor ("Indemnified Contributor") against any losses, + damages and costs (collectively "Losses") arising from claims, lawsuits and + other legal actions brought by a third party against the Indemnified + Contributor to the extent caused by the acts or omissions of such Commercial + Contributor in connection with its distribution of the Program in a commercial + product offering. The obligations in this section do not apply to any claims + or Losses relating to any actual or alleged intellectual property + infringement. In order to qualify, an Indemnified Contributor must: + a) promptly notify the Commercial Contributor in writing of such claim, and + b) allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such claim + at its own expense. + . + For example, a Contributor might include the Program in a commercial product + offering, Product X. That Contributor is then a Commercial Contributor. If + that Commercial Contributor then makes performance claims, or offers + warranties related to Product X, those performance claims and warranties are + such Commercial Contributor's responsibility alone. Under this section, the + Commercial Contributor would have to defend claims against the other + Contributors related to those performance claims and warranties, and if a + court requires any other Contributor to pay any damages as a result, the + Commercial Contributor must pay those damages. + . + 5. NO WARRANTY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON + AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER + EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR + CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the + appropriateness of using and distributing the Program and assumes all + risks associated with its exercise of rights under this Agreement , + including but not limited to the risks and costs of program errors, + compliance with applicable laws, damage to or loss of data, programs or + equipment, and unavailability or interruption of operations. + . + 6. DISCLAIMER OF LIABILITY + . + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY + CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION + LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE + EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + . + 7. GENERAL + . + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of the + remainder of the terms of this Agreement, and without further action by + the parties hereto, such provision shall be reformed to the minimum extent + necessary to make such provision valid and enforceable. + . + If Recipient institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program itself + (excluding combinations of the Program with other software or hardware) + infringes such Recipient's patent(s), then such Recipient's rights granted + under Section 2(b) shall terminate as of the date such litigation is filed. + . + All Recipient's rights under this Agreement shall terminate if it fails to + comply with any of the material terms or conditions of this Agreement and + does not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all Recipient's rights under this Agreement + terminate, Recipient agrees to cease use and distribution of the Program as + soon as reasonably practicable. However, Recipient's obligations under this + Agreement and any licenses granted by Recipient relating to the Program + shall continue and survive. + . + Everyone is permitted to copy and distribute copies of this Agreement, but + in order to avoid inconsistency the Agreement is copyrighted and may only + be modified in the following manner. The Agreement Steward reserves the + right to publish new versions (including revisions) of this Agreement from + time to time. No one other than the Agreement Steward has the right to + modify this Agreement. The Eclipse Foundation is the initial Agreement + Steward. The Eclipse Foundation may assign the responsibility to serve as + the Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The Program + (including Contributions) may always be distributed subject to the version + of the Agreement under which it was received. In addition, after a new + version of the Agreement is published, Contributor may elect to distribute + the Program (including its Contributions) under the new version. Except as + expressly stated in Sections 2(a) and 2(b) above, Recipient receives no + rights or licenses to the intellectual property of any Contributor under + this Agreement, whether expressly, by implication, estoppel or otherwise. + All rights in the Program not expressly granted under this Agreement are + reserved. + . + This Agreement is governed by the laws of the State of New York and the + intellectual property laws of the United States of America. No party to + this Agreement will bring a legal action under this Agreement more than + one year after the cause of action arose. Each party waives its rights to + a jury trial in any resulting litigation. + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/gbp.conf b/gbp.conf new file mode 100644 index 0000000..5787dfd --- /dev/null +++ b/gbp.conf @@ -0,0 +1,7 @@ +[DEFAULT] +upstream-branch = upstream +debian-branch = debian/unstable +upstream-tag = upstream/%(version)s +debian-tag = debian/%(version)s +sign-tags = True +pristine-tar = True diff --git a/get_test_exclusions b/get_test_exclusions new file mode 100755 index 0000000..bd6c308 --- /dev/null +++ b/get_test_exclusions @@ -0,0 +1,81 @@ +#! /bin/bash + +# Some of the tests must be excluded across all architectures for +# a variety of reasons. + +# This script is called from both debian/rules and from the +# autopkgtest suite. + +# * Some of the tests depend on the uninstalled pycompletionserver.py +# or pydev_coverage.py, so we ignore those; if they are only deselected, +# pytest collection fails as the imports fail +IGNORES=( + --ignore=tests/test_jyserver.py + --ignore=tests/test_pyserver.py + --ignore=tests_python/test_pydevcoverage.py +) + +# The rest will be excluded +EXCLUDES=() + +# * Two bytecode tests fail on Python 3.10, so we exclude those too. +# Reported upstream to +# https://github.com/fabioz/PyDev.Debugger/issues/222 +EXCLUDES+=( + tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01 + tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01a +) + +# * test_case_flask_exceptions fails, and is not tested by upstream, +# so we just skip it. +# Reported upstream to +# https://github.com/fabioz/PyDev.Debugger/issues/223 +EXCLUDES+=(tests_python/test_debugger_json.py::test_case_flask_exceptions) + +# * test_py_37_breakpoint_remote_no_import does not work on the built +# or installed version; reported upstream to +# https://github.com/fabioz/PyDev.Debugger/issues/224 +EXCLUDES+=(tests_python/test_debugger.py::test_py_37_breakpoint_remote_no_import) + +# Some tests fail intermittently or consistently on some +# architectures; we therefore perform a per-architecture exclusion. +# Since upstream only officially supports amd64 and i386, we have not +# reported these upstream. Also see README.Debian. + +arch=$(dpkg --print-architecture) + +if [ $arch = mipsel -o $arch = mips64el -o $arch = armel ] +then + EXCLUDES+=( + tests_python/test_debugger.py::test_attach_to_pid_no_threads[True] + tests_python/test_debugger.py::test_case_django_a + tests_python/test_debugger.py::test_case_django_b + tests_python/test_debugger.py::test_case_django_invalid_template_exception_breakpoint + tests_python/test_debugger.py::test_case_django_no_attribute_exception_breakpoint + tests_python/test_debugger.py::test_case_django_no_attribute_exception_breakpoint_and_regular_exceptions + tests_python/test_debugger.py::test_case_django_no_var_error + tests_python/test_debugger.py::test_case_django_template_inherits_no_exception + tests_python/test_debugger.py::test_case_flask + tests_python/test_debugger.py::test_gevent_show_paused_greenlets[True] + tests_python/test_debugger_json.py::test_attach_to_pid[True] + tests_python/test_debugger_json.py::test_case_django_line_validation + tests_python/test_debugger_json.py::test_case_django_no_attribute_exception_breakpoint + tests_python/test_debugger_json.py::test_case_flask_line_validation + tests_python/test_debugger_json.py::test_code_reload + ) +fi + +if [ $arch = ppc64el ] +then + EXCLUDES+=( + tests_python/test_debugger_json.py::test_code_reload + ) +fi + +DESELECTS=() +for test in "${EXCLUDES[@]}" +do + DESELECTS+=("--deselect=$test") +done + +echo ${IGNORES[*]} ${DESELECTS[*]} diff --git a/manpage/README.txt b/manpage/README.txt new file mode 100644 index 0000000..8a4da00 --- /dev/null +++ b/manpage/README.txt @@ -0,0 +1,2 @@ +The information for the manpage came mainly from reading pydevd.py and +_pydevd_bundle/pydevd_command_line_handling.py diff --git a/manpage/pydevd.txt b/manpage/pydevd.txt new file mode 100644 index 0000000..83c141b --- /dev/null +++ b/manpage/pydevd.txt @@ -0,0 +1,45 @@ +NAME + pydevd - Script to start pydevd debugger + +SYNOPSIS + pydevd --port N [--client hostname | --server] [option ...] --file executable + +DESCRIPTION + This script runs the pydevd debugger on top of another Python + script, making it ready to be attached to for remote debugging. + It is typically used by connecting from an IDE, such PyDev or + PyCharm, or called from debugpy, which is the debugging adapter used + in Spyder (via IPython), VSCode Python and Visual Studio Python. + +OPTIONS + --port N Port to connect (client) or listen (server) + --client hostname Hostname to connect + --server Run in server mode + --file executable The script to run; this must be the last option + + --ppid PPID Specifies the PPID to attach to + --vm_type TYPE Either 'python' or 'jython'; the default is 'python' + --access-token TOKEN The access token to access the debug server + --client-access-token TOKEN The access token to access the client (usually the IDE) + --DEBUG_RECORD_SOCKET_READS Log debugger socket reads + --multiproc Reuses connection (used by PyCharm) + --multiprocess Creates new connection (used by PyDev) + --save-signatures Send signature call tracewait + --save-threading Use threading analyser + --save-asyncio Use asyncio analyser + --print-in-debugger-startup Print debugger startup with pid on stderr + --cmd-line Wait for commands + --module Set if the file is a module + --skip-notify-stdin Do not notify when readline() is called + --qt-support= is one of 'auto', 'none', 'pyqt5', 'pyqt4', 'pyside' or 'pyside2' + --json-dap Use debugpy protocol: a single JSON message in each read + --json-dap-http Use DAP protocol: JSON messages over HTTP protocol + --protocol-quoted-line Use custom protocol with quoted lines + --protocol-http Use custom protocol with HTTP + +AUTHOR + pydevd was written by Fabio Zadrozny . + + This manual page was originally written by William Grzybowski + for the Debian project (but may be used by + others). It was updated by Julian Gilbey . diff --git a/patches/allow-non-local-tests.patch b/patches/allow-non-local-tests.patch new file mode 100644 index 0000000..047e18c --- /dev/null +++ b/patches/allow-non-local-tests.patch @@ -0,0 +1,122 @@ +Description: Allow the tests to run outside of the build area +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-07-11 + +--- a/tests_python/debugger_unittest.py ++++ b/tests_python/debugger_unittest.py +@@ -750,14 +750,12 @@ + return None + + def get_pydevd_file(self): +- dirname = os.path.dirname(__file__) +- dirname = os.path.dirname(dirname) +- return os.path.abspath(os.path.join(dirname, 'pydevd.py')) ++ import pydevd ++ return pydevd.__file__ + + def get_pydevconsole_file(self): +- dirname = os.path.dirname(__file__) +- dirname = os.path.dirname(dirname) +- return os.path.abspath(os.path.join(dirname, 'pydevconsole.py')) ++ import pydevconsole ++ return pydevconsole.__file__ + + def get_line_index_with_content(self, line_content, filename=None): + ''' +--- a/tests_python/test_run.py ++++ b/tests_python/test_run.py +@@ -33,11 +33,14 @@ + foo_module = 'tests_python.resources.launch.foo' + + pydevd_dir = os.path.dirname(os.path.dirname(__file__)) +- assert os.path.exists(os.path.join(pydevd_dir, 'pydevd.py')) ++ if os.path.exists(os.path.join(pydevd_dir, 'pydevd.py')): ++ append_path = 'sys.path.append(%r)' % pydevd_dir ++ else: ++ append_path = '' + + _run_and_check(testdir_or_pytester, testdir_or_pytester.makepyfile(''' + import sys +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + import pydevd + py_db = pydevd.PyDB() + py_db.ready_to_run = True +@@ -46,7 +49,7 @@ + + _run_and_check(testdir_or_pytester, testdir_or_pytester.makepyfile(''' + import sys +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + import pydevd + py_db = pydevd.PyDB() + py_db.run(%(foo_dir)r, set_trace=False) +@@ -58,7 +61,7 @@ + + _run_and_check(testdir_or_pytester, testdir_or_pytester.makepyfile(''' + import sys +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + sys.argv.append('--as-module') + import pydevd + py_db = pydevd.PyDB() +@@ -69,7 +72,7 @@ + _run_and_check(testdir_or_pytester, testdir_or_pytester.makepyfile(''' + import sys + sys.argv.append('--as-module') +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + import pydevd + py_db = pydevd.PyDB() + py_db.run(%(foo_module)r, is_module=True, set_trace=False) +@@ -81,7 +84,10 @@ + import os + + pydevd_dir = os.path.dirname(os.path.dirname(__file__)) +- assert os.path.exists(os.path.join(pydevd_dir, 'pydevd.py')) ++ if os.path.exists(os.path.join(pydevd_dir, 'pydevd.py')): ++ append_path = 'sys.path.append(%r)' % pydevd_dir ++ else: ++ append_path = '' + + foo_module = 'local_foo' + with open(os.path.join(os.getcwd(), 'local_foo.py'), 'w') as stream: +@@ -90,7 +96,7 @@ + _run_and_check(testdir_or_pytester, testdir_or_pytester.makepyfile(''' + import sys + import os +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + sys.argv.append('--as-module') + cwd = os.path.abspath(os.getcwd()) + while cwd in sys.path: +@@ -105,7 +111,7 @@ + import sys + import os + sys.argv.append('--as-module') +-sys.path.append(%(pydevd_dir)r) ++%(append_path)s + cwd = os.path.abspath(os.getcwd()) + while cwd in sys.path: + sys.path.remove(cwd) +--- a/tests_python/test_utilities.py ++++ b/tests_python/test_utilities.py +@@ -313,7 +313,7 @@ + cwd = os.path.abspath(os.path.dirname(__file__)) + assert os.path.isdir(cwd) + +- resources_dir = os.path.join(os.path.dirname(pydevd.__file__), 'tests_python', 'resources') ++ resources_dir = os.path.join(cwd, 'resources') + assert os.path.isdir(resources_dir) + + attach_to_process_dir = os.path.join(os.path.dirname(pydevd.__file__), 'pydevd_attach_to_process') +@@ -396,7 +396,7 @@ + cwd=cwd + ) + +- resources_dir = os.path.join(os.path.dirname(pydevd.__file__), 'tests_python', 'resources') ++ resources_dir = os.path.join(os.path.dirname(__file__), 'resources') + + subprocess.check_call( + [sys.executable, os.path.join(resources_dir, '_pydevd_test_find_main_thread_id.py') ], diff --git a/patches/build_both_extensions.patch b/patches/build_both_extensions.patch new file mode 100644 index 0000000..bb94f85 --- /dev/null +++ b/patches/build_both_extensions.patch @@ -0,0 +1,26 @@ +Description: Build extensions directly from setup.py + The original system has two separate setup.py files, and we need + to run the other one manually, as only one of the two extensions is + built in setup.py. This patch moves the extension building into the + standard setup.py. +Author: Julian Gilbey +Forwarded: https://github.com/fabioz/PyDev.Debugger/issues/160 +Last-Update: 2022-06-17 + +--- a/setup.py ++++ b/setup.py +@@ -152,7 +152,13 @@ + ["_pydevd_bundle/pydevd_cython.c", ], + define_macros=[('Py_BUILD_CORE_MODULE', '1')], + **kwargs +- ) ++ ), ++ Extension( ++ '_pydevd_frame_eval.pydevd_frame_evaluator', ++ ["_pydevd_frame_eval/pydevd_frame_evaluator.c", ], ++ define_macros=[('Py_BUILD_CORE_MODULE', '1')], ++ **kwargs ++ ), + ] + )) + setup(**args_with_binaries) diff --git a/patches/correct-debian-version-number.patch b/patches/correct-debian-version-number.patch new file mode 100644 index 0000000..658d7a6 --- /dev/null +++ b/patches/correct-debian-version-number.patch @@ -0,0 +1,17 @@ +Description: Advertise GitHub snapshot version number +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-07-25 + +--- a/pydevd.py ++++ b/pydevd.py +@@ -119,6 +119,9 @@ + + __version__ = '.'.join(__version_info_str__) + ++__version_info_str__.append('+git20220826.8ee4065') ++__version__ += '+git20220826.8ee4065' ++ + # IMPORTANT: pydevd_constants must be the 1st thing defined because it'll keep a reference to the original sys._getframe + + diff --git a/patches/do-not-install-data-files.patch b/patches/do-not-install-data-files.patch new file mode 100644 index 0000000..9bdc262 --- /dev/null +++ b/patches/do-not-install-data-files.patch @@ -0,0 +1,57 @@ +Description: Do not install unneeded files +Author: William Grzybowski + Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-06-17 + +--- a/MANIFEST.in ++++ b/MANIFEST.in +@@ -1,8 +1,4 @@ +-include *.rst *.txt *.md LICENSE *.pyx *.cpp *.hpp +-recursive-include pydevd_attach_to_process *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp +-recursive-include pydevd_attach_to_process/common *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp +-recursive-include pydevd_attach_to_process/linux_and_mac *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp +-recursive-include pydevd_attach_to_process/winappdbg *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp +-recursive-include pydevd_attach_to_process/windows *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp +-recursive-include _pydevd_bundle *.pyx *.cpp *.hpp +-recursive-include build_tools *.py +\ No newline at end of file ++include LICENSE ++recursive-include pydevd_attach_to_process *.py *.so ++recursive-include _pydevd_bundle *.py *.c ++recursive-include _pydevd_frame_eval *.py *.c +--- a/setup.py ++++ b/setup.py +@@ -32,24 +32,6 @@ + def is_pure(self): + return False + +- +-data_files = [] +- +- +-def accept_file(f): +- f = f.lower() +- for ext in '.py .dll .so .dylib .txt .cpp .h .bat .c .sh .md .txt'.split(): +- if f.endswith(ext): +- return True +- +- return f in ['readme', 'makefile'] +- +- +-data_files.append(('pydevd_attach_to_process', [os.path.join('pydevd_attach_to_process', f) for f in os.listdir('pydevd_attach_to_process') if accept_file(f)])) +-for root, dirs, files in os.walk("pydevd_attach_to_process"): +- for d in dirs: +- data_files.append((os.path.join(root, d), [os.path.join(root, d, f) for f in os.listdir(os.path.join(root, d)) if accept_file(f)])) +- + import pydevd + version = pydevd.__version__ + +@@ -121,7 +103,6 @@ + 'pydevd = pydevd:main', + ], + }, +- data_files=data_files, + keywords=['pydev', 'pydevd', 'pydev.debugger'], + include_package_data=True, + zip_safe=False, diff --git a/patches/do-not-use-O3-compile-flag.patch b/patches/do-not-use-O3-compile-flag.patch new file mode 100644 index 0000000..e1be6ee --- /dev/null +++ b/patches/do-not-use-O3-compile-flag.patch @@ -0,0 +1,33 @@ +Description: Remove -O3 compile flag + We use the standard Debian compilation flags +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-06-14 + +--- + setup.py | 2 +- + setup_pydevd_cython.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/setup.py ++++ b/setup.py +@@ -117,7 +117,7 @@ + # Enabling -flto brings executable from 4MB to 0.56MB and -Os to 0.41MB + # Profiling shows an execution around 3-5% slower with -Os vs -O3, + # so, kept only -flto. +- extra_compile_args = ["-flto", "-O3"] ++ extra_compile_args = ["-flto"] + extra_link_args = extra_compile_args[:] + + # Note: also experimented with profile-guided optimization. The executable +--- a/setup_pydevd_cython.py ++++ b/setup_pydevd_cython.py +@@ -169,7 +169,7 @@ + # Enabling -flto brings executable from 4MB to 0.56MB and -Os to 0.41MB + # Profiling shows an execution around 3-5% slower with -Os vs -O3, + # so, kept only -flto. +- extra_compile_args = ["-flto", "-O3"] ++ extra_compile_args = ["-flto"] + extra_link_args = extra_compile_args[:] + + # Note: also experimented with profile-guided optimization. The executable diff --git a/patches/improve-compilation-system.patch b/patches/improve-compilation-system.patch new file mode 100644 index 0000000..4ebaf55 --- /dev/null +++ b/patches/improve-compilation-system.patch @@ -0,0 +1,255 @@ +Description: Use buildflags and only build one attach_linux binary + Original patch: William Grzybowski + The original code tries to build both 32-bit and 64-bit versions. + This patched version only builds one copy of the library for the + build architecture. +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-06-16 + +--- a/pydevd_attach_to_process/add_code_to_python_process.py ++++ b/pydevd_attach_to_process/add_code_to_python_process.py +@@ -76,7 +76,6 @@ + import sys + import time + from contextlib import contextmanager +-import platform + import traceback + + try: +@@ -142,115 +142,14 @@ + # and not from the debugger). + libdir = os.path.dirname(__file__) + +- if is_target_process_64 is None: +- if IS_WINDOWS: +- # i.e.: On windows the target process could have a different bitness (32bit is emulated on 64bit). +- raise AssertionError("On windows it's expected that the target bitness is specified.") +- +- # For other platforms, just use the the same bitness of the process we're running in. +- is_target_process_64 = is_python_64bit() +- +- arch = '' +- if IS_WINDOWS: +- # prefer not using platform.machine() when possible (it's a bit heavyweight as it may +- # spawn a subprocess). +- arch = os.environ.get("PROCESSOR_ARCHITEW6432", os.environ.get('PROCESSOR_ARCHITECTURE', '')) +- +- if not arch: +- arch = platform.machine() +- if not arch: +- print('platform.machine() did not return valid value.') # This shouldn't happen... +- return None +- +- if IS_WINDOWS: +- if not extension: +- extension = '.dll' +- suffix_64 = 'amd64' +- suffix_32 = 'x86' +- +- elif IS_LINUX: +- if not extension: +- extension = '.so' +- suffix_64 = 'amd64' +- suffix_32 = 'x86' +- +- elif IS_MAC: +- if not extension: +- extension = '.dylib' +- suffix_64 = 'x86_64' +- suffix_32 = 'x86' ++ # This is a very simplified version for Debian builds + +- else: ++ if not IS_LINUX: + print('Unable to attach to process in platform: %s', sys.platform) + return None + +- if arch.lower() not in ('amd64', 'x86', 'x86_64', 'i386', 'x86'): +- # We don't support this processor by default. Still, let's support the case where the +- # user manually compiled it himself with some heuristics. +- # +- # Ideally the user would provide a library in the format: "attach_." +- # based on the way it's currently compiled -- see: +- # - windows/compile_windows.bat +- # - linux_and_mac/compile_linux.sh +- # - linux_and_mac/compile_mac.sh +- +- try: +- found = [name for name in os.listdir(libdir) if name.startswith('attach_') and name.endswith(extension)] +- except: +- print('Error listing dir: %s' % (libdir,)) +- traceback.print_exc() +- return None +- +- if prefix: +- expected_name = prefix + arch + extension +- expected_name_linux = prefix + 'linux_' + arch + extension +- else: +- # Default is looking for the attach_ / attach_linux +- expected_name = 'attach_' + arch + extension +- expected_name_linux = 'attach_linux_' + arch + extension +- +- filename = None +- if expected_name in found: # Heuristic: user compiled with "attach_." +- filename = os.path.join(libdir, expected_name) +- +- elif IS_LINUX and expected_name_linux in found: # Heuristic: user compiled with "attach_linux_." +- filename = os.path.join(libdir, expected_name_linux) +- +- elif len(found) == 1: # Heuristic: user removed all libraries and just left his own lib. +- filename = os.path.join(libdir, found[0]) +- +- else: # Heuristic: there's one additional library which doesn't seem to be our own. Find the odd one. +- filtered = [name for name in found if not name.endswith((suffix_64 + extension, suffix_32 + extension))] +- if len(filtered) == 1: # If more than one is available we can't be sure... +- filename = os.path.join(libdir, found[0]) +- +- if filename is None: +- print( +- 'Unable to attach to process in arch: %s (did not find %s in %s).' % ( +- arch, expected_name, libdir +- ) +- ) +- return None +- +- print('Using %s in arch: %s.' % (filename, arch)) +- +- else: +- if is_target_process_64: +- suffix = suffix_64 +- else: +- suffix = suffix_32 +- +- if not prefix: +- # Default is looking for the attach_ / attach_linux +- if IS_WINDOWS or IS_MAC: # just the extension changes +- prefix = 'attach_' +- elif IS_LINUX: +- prefix = 'attach_linux_' # historically it has a different name +- else: +- print('Unable to attach to process in platform: %s' % (sys.platform,)) +- return None +- +- filename = os.path.join(libdir, '%s%s%s' % (prefix, suffix, extension)) ++ libname = 'attach.so' ++ filename = os.path.join(libdir, libname) + + if not os.path.exists(filename): + print('Expected: %s to exist.' % (filename,)) +--- a/pydevd_tracing.py ++++ b/pydevd_tracing.py +@@ -4,7 +4,6 @@ + from _pydev_bundle._pydev_saved_modules import thread, threading + from _pydev_bundle import pydev_log, pydev_monkey + import os.path +-import platform + import ctypes + from io import StringIO + import sys +@@ -138,99 +138,16 @@ + # and not from the debugger). + libdir = os.path.join(os.path.dirname(__file__), 'pydevd_attach_to_process') + +- arch = '' +- if IS_WINDOWS: +- # prefer not using platform.machine() when possible (it's a bit heavyweight as it may +- # spawn a subprocess). +- arch = os.environ.get("PROCESSOR_ARCHITEW6432", os.environ.get('PROCESSOR_ARCHITECTURE', '')) +- +- if not arch: +- arch = platform.machine() +- if not arch: +- pydev_log.info('platform.machine() did not return valid value.') # This shouldn't happen... +- return None +- +- if IS_WINDOWS: +- extension = '.dll' +- suffix_64 = 'amd64' +- suffix_32 = 'x86' +- +- elif IS_LINUX: +- extension = '.so' +- suffix_64 = 'amd64' +- suffix_32 = 'x86' +- +- elif IS_MAC: +- extension = '.dylib' +- suffix_64 = 'x86_64' +- suffix_32 = 'x86' ++ # This is a very simplified version for Debian builds + +- else: +- pydev_log.info('Unable to set trace to all threads in platform: %s', sys.platform) ++ if not IS_LINUX: ++ print('Unable to attach to process in platform: %s', sys.platform) + return None + +- if arch.lower() not in ('amd64', 'x86', 'x86_64', 'i386', 'x86'): +- # We don't support this processor by default. Still, let's support the case where the +- # user manually compiled it himself with some heuristics. +- # +- # Ideally the user would provide a library in the format: "attach_." +- # based on the way it's currently compiled -- see: +- # - windows/compile_windows.bat +- # - linux_and_mac/compile_linux.sh +- # - linux_and_mac/compile_mac.sh +- +- try: +- found = [name for name in os.listdir(libdir) if name.startswith('attach_') and name.endswith(extension)] +- except: +- if DebugInfoHolder.DEBUG_TRACE_LEVEL >= 1: +- # There is no need to show this unless debug tracing is enabled. +- pydev_log.exception('Error listing dir: %s', libdir) +- return None +- +- expected_name = 'attach_' + arch + extension +- expected_name_linux = 'attach_linux_' + arch + extension +- +- filename = None +- if expected_name in found: # Heuristic: user compiled with "attach_." +- filename = os.path.join(libdir, expected_name) +- +- elif IS_LINUX and expected_name_linux in found: # Heuristic: user compiled with "attach_linux_." +- filename = os.path.join(libdir, expected_name_linux) +- +- elif len(found) == 1: # Heuristic: user removed all libraries and just left his own lib. +- filename = os.path.join(libdir, found[0]) +- +- else: # Heuristic: there's one additional library which doesn't seem to be our own. Find the odd one. +- filtered = [name for name in found if not name.endswith((suffix_64 + extension, suffix_32 + extension))] +- if len(filtered) == 1: # If more than one is available we can't be sure... +- filename = os.path.join(libdir, found[0]) +- +- if filename is None: +- pydev_log.info( +- 'Unable to set trace to all threads in arch: %s (did not find a %s lib in %s).', +- arch, expected_name, libdir +- +- ) +- return None +- +- pydev_log.info('Using %s lib in arch: %s.', filename, arch) +- +- else: +- # Happy path for which we have pre-compiled binaries. +- if IS_64BIT_PROCESS: +- suffix = suffix_64 +- else: +- suffix = suffix_32 +- +- if IS_WINDOWS or IS_MAC: # just the extension changes +- prefix = 'attach_' +- elif IS_LINUX: # +- prefix = 'attach_linux_' # historically it has a different name +- else: +- pydev_log.info('Unable to set trace to all threads in platform: %s', sys.platform) +- return None ++ libname = 'attach.so' ++ filename = os.path.join(libdir, libname) + +- filename = os.path.join(libdir, '%s%s%s' % (prefix, suffix, extension)) ++ pydev_log.info('Using %s lib.', filename) + + if not os.path.exists(filename): + pydev_log.critical('Expected: %s to exist.', filename) diff --git a/patches/improve-multiple-test-runs.patch b/patches/improve-multiple-test-runs.patch new file mode 100644 index 0000000..0973494 --- /dev/null +++ b/patches/improve-multiple-test-runs.patch @@ -0,0 +1,54 @@ +Description: Skip already passed tests on subsequent pytest runs + This is based on the mechanism in Spyder. +Forwarded: not-needed +Origin: https://github.com/spyder-ide/spyder/blob/5.x/conftest.py +Author: Julian Gilbey +Last-Update: 2022-09-05 + +--- a/conftest.py ++++ b/conftest.py +@@ -5,9 +5,44 @@ + from tests_python.debug_constants import PYDEVD_TEST_VM + import site + import os ++import re + from _pydev_bundle import pydev_log + + ++def get_passed_tests(): ++ """ ++ Get the list of passed tests by inspecting the log generated by pytest. ++ ++ This is useful on CIs to restart the test suite from the point where a ++ segfault was thrown by it. ++ """ ++ # This assumes the pytest log is placed next to this file. That's where ++ # we put it on CIs. ++ tests = set() ++ if os.path.isfile('pytest_log.txt'): ++ # Detect all tests that passed before. ++ test_re = re.compile(r'(test.*) [^ ]*(SKIPPED|PASSED|XFAIL)') ++ with open('pytest_log.txt') as logfile: ++ for line in logfile: ++ if match := test_re.match(line): ++ tests.add(match.group(1)) ++ ++ return tests ++ ++ ++def pytest_collection_modifyitems(config, items): ++ """ ++ Decide what tests to run (slow or fast) according to the --run-slow ++ option. ++ """ ++ passed_tests = get_passed_tests() ++ skip_passed = pytest.mark.skip(reason="Test passed in previous runs") ++ ++ for item in items: ++ if item.nodeid in passed_tests: ++ item.add_marker(skip_passed) ++ ++ + def pytest_report_header(config): + print('PYDEVD_USE_CYTHON: %s' % (TEST_CYTHON,)) + print('PYDEVD_TEST_VM: %s' % (PYDEVD_TEST_VM,)) diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..8cea1ab --- /dev/null +++ b/patches/series @@ -0,0 +1,9 @@ +do-not-install-data-files.patch +build_both_extensions.patch +improve-compilation-system.patch +do-not-use-O3-compile-flag.patch +use-bytecode-package.patch +allow-non-local-tests.patch +correct-debian-version-number.patch +test_convert_utilities.patch +improve-multiple-test-runs.patch diff --git a/patches/test_convert_utilities.patch b/patches/test_convert_utilities.patch new file mode 100644 index 0000000..6b12874 --- /dev/null +++ b/patches/test_convert_utilities.patch @@ -0,0 +1,39 @@ +Description: Handle Debian's purelib setting + In Python 3.9 (and presumably earlier), sysconfig.get_path('purelib') + returns a path which does not exist on Debian, breaking a test. This + is already reported as a Debian bug (#998739). As Python 3.9 is being + retired from Debian, we just skip the problematic parts of this test. +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-06-21 + +--- a/tests_python/test_convert_utilities.py ++++ b/tests_python/test_convert_utilities.py +@@ -1,6 +1,6 @@ + # coding: utf-8 + import os.path +-from _pydevd_bundle.pydevd_constants import IS_WINDOWS ++from _pydevd_bundle.pydevd_constants import IS_WINDOWS, IS_PY310_OR_GREATER + import io + from _pydev_bundle.pydev_log import log_context + import pytest +@@ -307,7 +307,8 @@ + pydevd_file_utils.NORM_PATHS_AND_BASE_CONTAINER.clear() + pydevd_file_utils.NORM_PATHS_CONTAINER.clear() + abs_path = pydevd_file_utils.get_abs_path_real_path_and_base_from_file('my_dir/my_file.pyx')[0] +- assert 'site-packages' in abs_path ++ if IS_PY310_OR_GREATER: ++ assert 'site-packages' in abs_path or 'dist-packages' in abs_path + assert os.path.normcase(str(tmpdir)) not in abs_path + assert not pydevd_file_utils.exists('my_dir/my_file.pyx') + +@@ -321,7 +322,8 @@ + pydevd_file_utils.NORM_PATHS_AND_BASE_CONTAINER.clear() + pydevd_file_utils.NORM_PATHS_CONTAINER.clear() + abs_path = pydevd_file_utils.get_abs_path_real_path_and_base_from_file('my_dir/my_file.pyx')[0] +- assert 'site-packages' not in abs_path ++ if IS_PY310_OR_GREATER: ++ assert 'site-packages' not in abs_path and 'dist-packages' not in abs_path + assert str(tmpdir) in abs_path + assert pydevd_file_utils.exists('my_dir/my_file.pyx') + finally: diff --git a/patches/use-bytecode-package.patch b/patches/use-bytecode-package.patch new file mode 100644 index 0000000..fbdfce5 --- /dev/null +++ b/patches/use-bytecode-package.patch @@ -0,0 +1,53 @@ +Description: Use bytecode package rather than local version + The vendored version of the package is removed in debian/copyright, + and the Debian version of the package includes the patch from this + package. +Author: Julian Gilbey +Forwarded: not-needed +Last-Update: 2022-02-12 + +--- + _pydevd_bundle/pydevd_bytecode_utils.py | 6 +++--- + _pydevd_frame_eval/pydevd_modify_bytecode.py | 4 ++-- + setup.py | 2 -- + 3 files changed, 5 insertions(+), 7 deletions(-) + +--- a/_pydevd_bundle/pydevd_bytecode_utils.py ++++ b/_pydevd_bundle/pydevd_bytecode_utils.py +@@ -6,9 +6,9 @@ + + from _pydev_bundle import pydev_log + from types import CodeType +-from _pydevd_frame_eval.vendored.bytecode.instr import _Variable +-from _pydevd_frame_eval.vendored import bytecode +-from _pydevd_frame_eval.vendored.bytecode import cfg as bytecode_cfg ++from bytecode.instr import _Variable ++import bytecode ++from bytecode import cfg as bytecode_cfg + import dis + import opcode as _opcode + +--- a/_pydevd_frame_eval/pydevd_modify_bytecode.py ++++ b/_pydevd_frame_eval/pydevd_modify_bytecode.py +@@ -5,8 +5,8 @@ + import os.path + import sys + +-from _pydevd_frame_eval.vendored import bytecode +-from _pydevd_frame_eval.vendored.bytecode.instr import Instr, Label ++import bytecode ++from bytecode.instr import Instr, Label + from _pydev_bundle import pydev_log + from _pydevd_frame_eval.pydevd_frame_tracing import _pydev_stop_at_break, _pydev_needs_stop_at_break + +--- a/setup.py ++++ b/setup.py +@@ -50,8 +50,6 @@ + '_pydevd_bundle._debug_adapter', + '_pydevd_bundle.pydevd_concurrency_analyser', + '_pydevd_frame_eval', +- '_pydevd_frame_eval.vendored', +- '_pydevd_frame_eval.vendored.bytecode', + 'pydev_ipython', + + # 'pydev_sitecustomize', -- Not actually a package (not added) diff --git a/py3versions_min.py b/py3versions_min.py new file mode 100755 index 0000000..007f9bb --- /dev/null +++ b/py3versions_min.py @@ -0,0 +1,23 @@ +#! /usr/bin/python3 + +# This is based on the PR at +# https://salsa.debian.org/cpython-team/python3-defaults/-/merge_requests/11 + +import sys +sys.path.insert(0, "/usr/share/python3") +from py3versions import supported_versions, version_to_tuple + + +def minmax_supported_version(minmax, version_only=False): + supported_versions_list = supported_versions(True) + version = minmax(version_to_tuple(ver) for ver in supported_versions_list) + version_str = '%d.%d' % version + if version_only: + return version_str + else: + return 'python' + version_str + + +if __name__ == "__main__": + print(minmax_supported_version(min)) + diff --git a/pybuild.testfiles b/pybuild.testfiles new file mode 100644 index 0000000..d1f3dd3 --- /dev/null +++ b/pybuild.testfiles @@ -0,0 +1,7 @@ +conftest.py +pytest.ini +test_pydevd_reload +tests +tests_mainloop +tests_python +tests_runfiles diff --git a/pydevd.README.Debian b/pydevd.README.Debian new file mode 120000 index 0000000..4288858 --- /dev/null +++ b/pydevd.README.Debian @@ -0,0 +1 @@ +python3-pydevd.README.Debian \ No newline at end of file diff --git a/pydevd.install b/pydevd.install new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/pydevd.install @@ -0,0 +1 @@ +usr/bin diff --git a/pydevd.manpages b/pydevd.manpages new file mode 100644 index 0000000..26be10f --- /dev/null +++ b/pydevd.manpages @@ -0,0 +1 @@ +debian/manpage/pydevd.1 diff --git a/python3-pydevd.README.Debian b/python3-pydevd.README.Debian new file mode 100644 index 0000000..e743b54 --- /dev/null +++ b/python3-pydevd.README.Debian @@ -0,0 +1,25 @@ +pydevd for Debian +================= + +* Possible issues on some architectures + +The upstream pydevd developers only develop this software for the +amd64 and i386 architectures. The Debian package is built for all of +the other supported architectures. There are several test suite +failures (some only intermittently) on armel, mipsel and mips64el, and +one failure on ppc64el; these may indicate some problems with this +package on these platform; I have not been able to locate the cause of +the test failures or identify any actual problems. If you are able to +help with this, please feel free to contact me via the Debian BTS. + +* Non-vendored bytecode package + +Following standard Debian practice, the Debian package of pydevd +relies on the python3-bytecode package rather than including a +vendored copy of bytecode. (The python3-bytecode package has been +patched to be compatible with pydevd.) This may mean that it is not +possible to debug the bytecode package using pydevd. If this is +required, it may be necessary to use a virtual environment and install +the upstream pydevd (or debugpy) package in it. + + -- Julian Gilbey , Thu, 4 Aug 2022 13:28:56 +0100 diff --git a/python3-pydevd.docs b/python3-pydevd.docs new file mode 100644 index 0000000..a1320b1 --- /dev/null +++ b/python3-pydevd.docs @@ -0,0 +1 @@ +README.rst diff --git a/python3-pydevd.pyremove b/python3-pydevd.pyremove new file mode 100644 index 0000000..122f615 --- /dev/null +++ b/python3-pydevd.pyremove @@ -0,0 +1,20 @@ +# Python 2 files which do not compile under Python 3, +# thereby preventing package installation. +pydevd_attach_to_process/_check.py +# Windows only code; no point installing +pydevd_attach_to_process/winappdbg +# This is only installed to help people on systems where the +# Cython extensions have not already been built. Though the +# pydevd developers include it in the package (see +# https://github.com/fabioz/PyDev.Debugger/issues/102), we have +# no need for it in Debian. +setup_pydevd_cython.py +# macOS only +pydevd_attach_to_process/linux_and_mac/lldb_prepare.py +# Cython files +_pydevd_bundle/pydevd_cython.c +_pydevd_frame_eval/pydevd_frame_evaluator.c +# Unused testing scripts +pydevd_attach_to_process/_always_live_program.py +pydevd_attach_to_process/_test_attach_to_process.py +pydevd_attach_to_process/_test_attach_to_process_linux.py diff --git a/rules b/rules new file mode 100755 index 0000000..a464f13 --- /dev/null +++ b/rules @@ -0,0 +1,73 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +include /usr/share/dpkg/pkg-info.mk +export PYBUILD_NAME=pydevd + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) +CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) +LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) + +%: + dh $@ --buildsystem=pybuild + +_pydevd_bundle/pydevd_runpy.py: + libdir=/usr/lib/$$(debian/py3versions_min.py); \ + cp $$libdir/runpy.py _pydevd_bundle/pydevd_runpy.py + patch -p1 < debian/runpy.patch + +execute_before_dh_auto_clean: _pydevd_bundle/pydevd_runpy.py + # setup.py clean requires pydevd_runpy.py to be present + +execute_after_dh_clean: + rm -f _pydevd_bundle/pydevd_runpy.py + +execute_before_dh_auto_configure: _pydevd_bundle/pydevd_runpy.py + # setup.py config requires pydevd_runpy.py to be present + +override_dh_auto_build: + # This shared library is Python-version agnostic + cd pydevd_attach_to_process/linux_and_mac && \ + g++ $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared \ + -o ../attach.so -fPIC -nostartfiles attach.cpp + # Regenerate the Cython C files (though ignore the generated + # .so files; they will be compiled for each Python version in + # dh_auto_build) + python3 setup_pydevd_cython.py build_ext --inplace --force-cython + dh_auto_build --buildsystem=pybuild + txt2man -t pydevd -P pname -r "pydevd-$(DEB_VERSION_UPSTREAM)" -s 1 -v "" -d "July 2022" debian/manpage/pydevd.txt > debian/manpage/pydevd.1 + +execute_after_dh_auto_install: + # usr/bin needs to be moved from debian/python3-pydevd to debian/pydevd + # dh_install will move it from debian/tmp + -mkdir -p debian/tmp/usr + mv debian/python3-pydevd/usr/bin debian/tmp/usr + +override_dh_python3: + dh_python3 --no-ext-rename + +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) +override_dh_auto_test: + # * Various tests are ignored or excluded; see + # debian/get_test_exclusions for details. + # + # * test_matplotlib_activation and test_pandas cause failures due + # to a matplotlib warning (that does seem to be easily silenced) + # if the build machine has too many fonts on it, so we skip then here + # (but not in the autopkgtest suite) + # + # * The http_proxy settings are to disable the proxies that pybuild + # introduces; the tests set up and use a local http server. + export PYDEVD_USE_CYTHON=YES; \ + export http_proxy=""; \ + export PYBUILD_SYSTEM=custom; \ + export PYBUILD_TEST_ARGS="\ + cd {build_dir}; \ + $(CURDIR)/debian/run_tests {interpreter} -m pytest \ + --deselect=tests_python/test_debugger.py::test_matplotlib_activation \ + --deselect=tests_python/test_debugger_json.py::test_pandas \ + $$(debian/get_test_exclusions)"; \ + xvfb-run -a dh_auto_test +endif diff --git a/run_tests b/run_tests new file mode 100755 index 0000000..9699f1c --- /dev/null +++ b/run_tests @@ -0,0 +1,37 @@ +#!/bin/bash + +# Copyright 2022 Julian Gilbey +# License: MIT License + +# Determine whether every test passes in at least one pytest run. +# We run the command given on the command line at most MAX_PYTEST_RUNS, +# stopping if a pytest run is successful. + +MAX_PYTEST_RUNS=5 + +NO_TESTS_EXITCODE=$(python3 -c "from pytest import ExitCode; print(int(ExitCode.NO_TESTS_COLLECTED))") + +# Remove any old log files +rm -f pytest_log.txt + +run=1 +while [ $run -le $MAX_PYTEST_RUNS ] +do + echo "*** STARTING RUN $run: $*" + set -o pipefail + "$@" | tee -a pytest_log.txt + ret=$? + set +o pipefail + if [ $ret -eq 0 -o $ret -eq $NO_TESTS_EXITCODE ] + then + echo "*** END OF RUN $run: ALL TESTS RUN HAVE NOW PASSED/XFAILED ***" + rm -f pytest_log.txt + exit 0 + fi + echo "*** END OF RUN $run: NOT ALL TESTS HAVE YET PASSED/XFAILED ***" + run=$(($run + 1)) +done + +echo "*** SOME TESTS FAILED/ERRORED EVERY RUN, ABORTING ***" +rm -f pytest_log.txt +exit 1 diff --git a/runpy.patch b/runpy.patch new file mode 100644 index 0000000..a015d8d --- /dev/null +++ b/runpy.patch @@ -0,0 +1,72 @@ +Description: Patch local copy of runpy.py to match upstream's vendored version + This patch is based on the changes upstream has made to + /var/lib/python3.10/runpy.py to make it work with pydevd. + . + We use this patch on a copy of /var/lib/python3.10/runpy.py rather than + using upstream's vendored copy to ensure that we always have an up-to-date + version of runpy.py. +Forwarded: not-needed +Author: Julian Gilbey +Last-Update: 2022-07-27 + + +--- a/_pydevd_bundle/pydevd_runpy.py 2022-07-27 15:34:53.169532401 +0100 ++++ b/_pydevd_bundle/pydevd_runpy.py 2022-07-27 15:30:35.368475122 +0100 +@@ -1,4 +1,10 @@ +-"""runpy.py - locating and running Python code using the module namespace ++""" ++Vendored copy of runpy from the standard library. ++ ++It's vendored so that we can properly ignore it when used to start user code ++while still making it possible for the user to debug runpy itself. ++ ++runpy.py - locating and running Python code using the module namespace + + Provides support for locating and running Python scripts using the Python + module namespace instead of the native filesystem. +@@ -21,6 +27,35 @@ + "run_module", "run_path", + ] + ++ ++# Note: fabioz: Don't use pkgutil (when handling caught exceptions we could end up ++# showing exceptions in pkgutil.get_imported (specifically the KeyError), so, ++# create a copy of the function we need to properly ignore this exception when ++# running the program. ++def pkgutil_get_importer(path_item): ++ """Retrieve a finder for the given path item ++ ++ The returned finder is cached in sys.path_importer_cache ++ if it was newly created by a path hook. ++ ++ The cache (or part of it) can be cleared manually if a ++ rescan of sys.path_hooks is necessary. ++ """ ++ try: ++ importer = sys.path_importer_cache[path_item] ++ except KeyError: ++ for path_hook in sys.path_hooks: ++ try: ++ importer = path_hook(path_item) ++ sys.path_importer_cache.setdefault(path_item, importer) ++ break ++ except ImportError: ++ pass ++ else: ++ importer = None ++ return importer ++ ++ + class _TempModule(object): + """Temporarily replace a module in sys.modules with an empty namespace""" + def __init__(self, mod_name): +@@ -275,8 +310,7 @@ + if run_name is None: + run_name = "" + pkg_name = run_name.rpartition(".")[0] +- from pkgutil import get_importer +- importer = get_importer(path_name) ++ importer = pkgutil_get_importer(path_name) + # Trying to avoid importing imp so as to not consume the deprecation warning. + is_NullImporter = False + if type(importer).__module__ == 'imp': diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/options b/source/options new file mode 100644 index 0000000..cb61fa5 --- /dev/null +++ b/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/tests/control b/tests/control new file mode 100644 index 0000000..d4292e7 --- /dev/null +++ b/tests/control @@ -0,0 +1,60 @@ +# We mark the tests on all architectures other than amd64 and i386 as +# flaky, as some of the tests intermittently fail for some unknown +# reason. Failures on amd64 and i386 (which the package is designed +# to run on) should flag an issue. + +# We do not use an Architectures restriction, as that leads to +# non-zero autopkgtest exit status, which is confusing. + +Test-Command: debian/tests/pytest +Depends: gdb, + libqt5x11extras5, + procps, + python3-all, + python3-cherrypy3, + python3-coverage, + python3-django, + python3-flask, + python3-gevent, + python3-ipython, + python3-jinja2, + python3-matplotlib, + python3-numpy, + python3-pandas, + python3-psutil, + python3-pyqt5, + python3-pyqt5.qtsvg, + python3-pytest, + python3-pytest-xdist, + python3-trio, + python3-untangle, + xauth, + xvfb, + @ + +Test-Command: debian/tests/pytest --flaky +Depends: gdb, + libqt5x11extras5, + procps, + python3-all, + python3-cherrypy3, + python3-coverage, + python3-django, + python3-flask, + python3-gevent, + python3-ipython, + python3-jinja2, + python3-matplotlib, + python3-numpy, + python3-pandas, + python3-psutil, + python3-pyqt5, + python3-pyqt5.qtsvg, + python3-pytest, + python3-pytest-xdist, + python3-trio, + python3-untangle, + xauth, + xvfb, + @ +Restrictions: flaky diff --git a/tests/pytest b/tests/pytest new file mode 100755 index 0000000..63255f0 --- /dev/null +++ b/tests/pytest @@ -0,0 +1,62 @@ +#! /bin/bash + +set -e + +# We are in non-flaky mode for amd64 and i386; we are in flaky mode for +# other architectures. +arch=$(dpkg --print-architecture) +if [ $arch = amd64 -o $arch = i386 ] +then + flaky_mode=no +else + flaky_mode=yes +fi + +if [ "$1" = --flaky -a $flaky_mode = no ] || [ -z "$1" -a $flaky_mode = yes ] +then + exit 0 +fi + +# Our mode now matches our architecture + +PYS=$(py3versions -s) + +cp -a debian/run_tests $(cat debian/pybuild.testfiles) "$AUTOPKGTEST_TMP" +DESELECTS=$(debian/get_test_exclusions) + +cd "$AUTOPKGTEST_TMP" + +# Most tests work whether or not PYTHONPATH is set to the directory containing +# the tests. But some tests require it to be set and others fail if it is set. +# So we run pytest twice, once with and once without PYTHONPATH. + +NO_PATH_TESTS=( + tests_python/test_debugger.py::test_module_entry_point + tests_python/test_debugger.py::test_m_switch + tests_python/test_debugger.py::test_stop_on_start_m_switch + tests_python/test_debugger.py::test_stop_on_start_entry_point +) + +NO_PATH_DESELECTS=() +for test in "${NO_PATH_TESTS[@]}" +do + NO_PATH_DESELECTS+=("--deselect=$test") +done + + +for py in $PYS +do + echo "Testing with $py:" + export PYDEVD_USE_CYTHON=YES + + # Note: we don't use "-n auto" in the pytest call, as that causes + # weird breakages + + export PYTHONPATH=$(pwd) + cmd="$py -m pytest $DESELECTS ${NO_PATH_DESELECTS[*]}" + xvfb-run -a ./run_tests $cmd + unset PYTHONPATH + + cmd="$py -m pytest ${NO_PATH_TESTS[*]}" + xvfb-run -a ./run_tests $cmd +done diff --git a/upstream/metadata b/upstream/metadata new file mode 100644 index 0000000..2e88d6b --- /dev/null +++ b/upstream/metadata @@ -0,0 +1,5 @@ +Bug-Database: https://github.com/fabioz/PyDev.Debugger/issues +Bug-Submit: https://github.com/fabioz/PyDev.Debugger/issues/new +Name: PyDev.Debugger +Repository: https://github.com/fabioz/PyDev.Debugger.git +Repository-Browse: https://github.com/fabioz/PyDev.Debugger diff --git a/watch b/watch new file mode 100644 index 0000000..5cc7a4b --- /dev/null +++ b/watch @@ -0,0 +1,6 @@ +version=4 +opts=dversionmangle=s/\+ds//,\ + repack,repacksuffix=+ds,\ + uversionmangle=s/_/\./g \ + https://github.com/fabioz/PyDev.Debugger/tags \ + (?:.*/)?pydev_debugger_(.*)\.tar\.gz debian -- 2.30.2