pydevd (2.8.0+git20220714.32dee0b+dfsg-6) unstable; urgency=medium
authorJulian Gilbey <jdg@debian.org>
Mon, 8 Aug 2022 19:07:18 +0000 (20:07 +0100)
committerJulian Gilbey <jdg@debian.org>
Mon, 8 Aug 2022 19:07:18 +0000 (20:07 +0100)
  * Add Breaks+Replaces python3-omegaconf (Closes: #1016511)

[dgit import unpatched pydevd 2.8.0+git20220714.32dee0b+dfsg-6]

34 files changed:
1  2 
debian/README.source
debian/README.vendoring
debian/changelog
debian/control
debian/copyright
debian/gbp.conf
debian/get_test_exclusions
debian/manpage/README.txt
debian/manpage/pydevd.txt
debian/patches/allow-non-local-tests.patch
debian/patches/build_both_extensions.patch
debian/patches/correct-debian-version-number.patch
debian/patches/do-not-install-data-files.patch
debian/patches/do-not-use-O3-compile-flag.patch
debian/patches/improve-compilation-system.patch
debian/patches/series
debian/patches/test_convert_utilities.patch
debian/patches/use-bytecode-package.patch
debian/py3versions_min.py
debian/pybuild.testfiles
debian/pydevd.README.Debian
debian/pydevd.install
debian/pydevd.manpages
debian/python3-pydevd.README.Debian
debian/python3-pydevd.docs
debian/python3-pydevd.pyremove
debian/rules
debian/runpy.patch
debian/source/format
debian/source/options
debian/tests/control
debian/tests/pytest
debian/upstream/metadata
debian/watch

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..05af66d6b1844fd07afd800dd98722fcc2924699
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>, Thu, 17 Mar 2022 06:54:45 +0000
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..bc0cc76f2acf1d6fe1c76134f0f9528353e30f01
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>, Wed, 16 Mar 2022 09:56:34 +0000
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6d87a025397adcc666047cdd268c3c9d17b60a59
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,55 @@@
++pydevd (2.8.0+git20220714.32dee0b+dfsg-6) unstable; urgency=medium
++
++  * Add Breaks+Replaces python3-omegaconf (Closes: #1016511)
++
++ -- Julian Gilbey <jdg@debian.org>  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 <jdg@debian.org>  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 <jdg@debian.org>  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 <jdg@debian.org>  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 <jdg@debian.org>  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 <jdg@debian.org>  Wed, 27 Jul 2022 21:06:59 +0100
++
++pydevd (2.8.0+git20220602.1b1fb8b+dfsg-2) unstable; urgency=medium
++
++  * Source-only upload
++
++ -- Julian Gilbey <jdg@debian.org>  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 <william@grzy.org> and
++    Julian Gilbey <jdg@debian.org>
++
++ -- Julian Gilbey <jdg@debian.org>  Wed, 13 Jul 2022 06:51:12 +0100
diff --cc debian/control
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1991c7dee900f17b99877b52d403cdde9e4481b8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,74 @@@
++Source: pydevd
++Section: python
++Priority: optional
++Maintainer: Debian Python Team <team+python@tracker.debian.org>
++Uploaders: Julian Gilbey <jdg@debian.org>
++Build-Depends: cython3,
++               debhelper-compat (= 13),
++               dh-python,
++               dh-sequence-python3,
++               gdb <!nocheck>,
++               libqt5x11extras5 <!nocheck>,
++               procps <!nocheck>,
++               python3-all-dev,
++               python3-bytecode,
++               python3-cherrypy3 <!nocheck>,
++               python3-coverage <!nocheck>,
++               python3-django <!nocheck>,
++               python3-flask <!nocheck>,
++               python3-gevent <!nocheck>,
++               python3-ipython <!nocheck>,
++               python3-jinja2 <!nocheck>,
++               python3-matplotlib <!nocheck>,
++               python3-numpy <!nocheck>,
++               python3-pandas <!nocheck>,
++               python3-psutil <!nocheck>,
++               python3-pyqt5 <!nocheck>,
++               python3-pyqt5.qtsvg <!nocheck>,
++               python3-pytest <!nocheck>,
++               python3-pytest-xdist <!nocheck>,
++               python3-setuptools,
++               python3-trio <!nocheck>,
++               python3-untangle <!nocheck>,
++               txt2man,
++               xauth <!nocheck>,
++               xvfb <!nocheck>
++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.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..45ca8086591c49e3b0774b78b262851ebe9d06d2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,353 @@@
++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/pydevconsole_code_for_ironpython.py
++  _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 <fabiofz@gmail.com>
++           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 <william@grzy.org>
++  2022 Julian Gilbey <jdg@debian.org>
++License: EPL-1.0
++
++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 --cc debian/gbp.conf
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5787dfdead2666a920d38c43e2f3e91e685d5576
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7d4b27bd6d024684d25135d4aaee3501a3bea93b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,43 @@@
++#! /bin/bash
++
++# Some tests fail intermittently or consistently on some
++# architectures; we therefore perform a per-architecture exclusion.
++# This script is called from both debian/rules and from the
++# autopkgtest suite.
++
++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
++    )
++elif [ $arch = ppc64el ]
++then
++    EXCLUDES=(
++      tests_python/test_debugger_json.py::test_code_reload
++    )
++else
++    EXCLUDES=()
++fi
++
++DESELECTS=()
++for test in "${EXCLUDES[@]}"
++do
++    DESELECTS+=("--deselect=$test")
++done
++
++echo ${DESELECTS[*]}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8a4da00b66777faf7b2d171f11da7f72604568de
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++The information for the manpage came mainly from reading pydevd.py and
++_pydevd_bundle/pydevd_command_line_handling.py
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..83c141b93edfa27825a217d4d2bb3d0e11345139
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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=<mode>  <mode> 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 <fabiofz@gmail.com>.
++
++  This manual page was originally written by William Grzybowski
++  <william@grzy.org> for the Debian project (but may be used by
++  others). It was updated by Julian Gilbey <jdg@debian.org>.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..eb217ba9b44558dd4922699542940ae1f3a8f4f8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,122 @@@
++Description: Allow the tests to run outside of the build area
++Author: Julian Gilbey <jdg@debian.org>
++Forwarded: not-needed
++Last-Update: 2022-07-11
++
++--- a/tests_python/debugger_unittest.py
+++++ b/tests_python/debugger_unittest.py
++@@ -751,14 +751,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        2022-06-02 19:10:56.000000000 +0100
+++++ b/tests_python/test_run.py        2022-07-08 11:10:44.297519723 +0100
++@@ -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  2022-06-26 20:47:50.000000000 +0100
+++++ b/tests_python/test_utilities.py  2022-07-08 10:36:25.090376681 +0100
++@@ -316,7 +316,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')
++@@ -399,7 +399,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') ],
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..bb94f855b6364c05a438643dc9d6bb6cbbb0112e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>
++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", ],\r
++                 define_macros=[('Py_BUILD_CORE_MODULE', '1')],\r
++                 **kwargs\r
++-            )\r
+++            ),\r
+++            Extension(\r
+++                '_pydevd_frame_eval.pydevd_frame_evaluator',\r
+++                ["_pydevd_frame_eval/pydevd_frame_evaluator.c", ],\r
+++                define_macros=[('Py_BUILD_CORE_MODULE', '1')],\r
+++                **kwargs\r
+++            ),\r
++         ]\r
++     ))\r
++     setup(**args_with_binaries)\r
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4cd25b92c8837d055a50b6a7ceb32e32068994c4
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,17 @@@
++Description: Advertise GitHub snapshot version number
++Author: Julian Gilbey <jdg@debian.org>
++Forwarded: not-needed
++Last-Update: 2022-07-25
++
++--- a/pydevd.py
+++++ b/pydevd.py
++@@ -118,6 +118,9 @@
++ 
++ __version__ = '.'.join(__version_info_str__)
++ 
+++__version_info_str__.append('+git20220714.32dee0b')
+++__version__ += '+git20220714.32dee0b'
+++
++ # IMPORTANT: pydevd_constants must be the 1st thing defined because it'll keep a reference to the original sys._getframe
++ 
++ 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9bdc262fc199e15d8128031ca16b065d34deaa9e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,57 @@@
++Description: Do not install unneeded files
++Author: William Grzybowski <william@grzy.org>
++  Julian Gilbey <jdg@debian.org>
++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\r
++-recursive-include pydevd_attach_to_process *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp\r
++-recursive-include pydevd_attach_to_process/common *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp\r
++-recursive-include pydevd_attach_to_process/linux_and_mac *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp\r
++-recursive-include pydevd_attach_to_process/winappdbg *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp\r
++-recursive-include pydevd_attach_to_process/windows *.py *.dll *.so *.dylib *.txt *.c *.h *.bat Makefile *.sh *.pyx *.cpp *.hpp\r
++-recursive-include _pydevd_bundle *.pyx *.cpp *.hpp\r
++-recursive-include build_tools *.py
++\ No newline at end of file
+++include LICENSE\r
+++recursive-include pydevd_attach_to_process *.py *.so\r
+++recursive-include _pydevd_bundle *.py *.c\r
+++recursive-include _pydevd_frame_eval *.py *.c\r
++--- a/setup.py
+++++ b/setup.py
++@@ -32,24 +32,6 @@
++     def is_pure(self):\r
++         return False\r
++ \r
++-\r
++-data_files = []\r
++-\r
++-\r
++-def accept_file(f):\r
++-    f = f.lower()\r
++-    for ext in '.py .dll .so .dylib .txt .cpp .h .bat .c .sh .md .txt'.split():\r
++-        if f.endswith(ext):\r
++-            return True\r
++-\r
++-    return f in ['readme', 'makefile']\r
++-\r
++-\r
++-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)]))\r
++-for root, dirs, files in os.walk("pydevd_attach_to_process"):\r
++-    for d in dirs:\r
++-        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)]))\r
++-\r
++ import pydevd\r
++ version = pydevd.__version__\r
++ \r
++@@ -121,7 +103,6 @@
++             'pydevd = pydevd:main',\r
++         ],\r
++     },\r
++-    data_files=data_files,\r
++     keywords=['pydev', 'pydevd', 'pydev.debugger'],\r
++     include_package_data=True,\r
++     zip_safe=False,\r
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e1be6ee3d83712db557dcd682afa0d6509a05c10
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++Description: Remove -O3 compile flag
++  We use the standard Debian compilation flags
++Author: Julian Gilbey <jdg@debian.org>
++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\r
++         # Profiling shows an execution around 3-5% slower with -Os vs -O3,\r
++         # so, kept only -flto.\r
++-        extra_compile_args = ["-flto", "-O3"]\r
+++        extra_compile_args = ["-flto"]\r
++         extra_link_args = extra_compile_args[:]\r
++ \r
++         # Note: also experimented with profile-guided optimization. The executable\r
++--- 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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4ebaf555a615002a7be8caf1d99128863cf2b1c8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,255 @@@
++Description: Use buildflags and only build one attach_linux binary
++  Original patch: William Grzybowski <william@grzy.org>
++  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 <jdg@debian.org>
++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_<arch>.<extension>"
++-        # 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_<arch>.<extension>"
++-            filename = os.path.join(libdir, expected_name)
++-
++-        elif IS_LINUX and expected_name_linux in found:  # Heuristic: user compiled with "attach_linux_<arch>.<extension>"
++-            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_<arch>.<extension>"
++-        # 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_<arch>.<extension>"
++-            filename = os.path.join(libdir, expected_name)
++-
++-        elif IS_LINUX and expected_name_linux in found:  # Heuristic: user compiled with "attach_linux_<arch>.<extension>"
++-            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)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7ff5ea6907d151f146beeda22448c80ceff46cbe
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,8 @@@
++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
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6b12874d1a9ad789f3795e07e9a3e5376fe73c28
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>
++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:
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..fbdfce5030861a1ae90a6e7c0b369b1d119b71d8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>
++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',\r
++         '_pydevd_bundle.pydevd_concurrency_analyser',\r
++         '_pydevd_frame_eval',\r
++-        '_pydevd_frame_eval.vendored',\r
++-        '_pydevd_frame_eval.vendored.bytecode',\r
++         'pydev_ipython',\r
++ \r
++         # 'pydev_sitecustomize', -- Not actually a package (not added)\r
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..007f9bbeef31ee846922e1ee629bbc4ee35b1672
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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))
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d1f3dd3295f6aae5f0f576acb27c29748b6da729
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,7 @@@
++conftest.py
++pytest.ini
++test_pydevd_reload
++tests
++tests_mainloop
++tests_python
++tests_runfiles
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4288858889ff36d809896131df731f163882851b
new file mode 120000 (symlink)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++python3-pydevd.README.Debian
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e77248175524d9f63749c2d6ca67159eeb4aa635
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++usr/bin
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..26be10f43810355f8dd3074613876d98b3e8859f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++debian/manpage/pydevd.1
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e743b54593536524463c5561b8411a5ffa79388a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>, Thu,  4 Aug 2022 13:28:56 +0100
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a1320b1b4ab22e9be9bbc9d5777c0e31aa4011d5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++README.rst
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..122f615596fee0f2fb0d7aad9b2de01c2c84c17c
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 --cc debian/rules
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..73933266f2bc96bdf433bdc4dc523f289ad7076b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,92 @@@
++#!/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:
++      # * Some of the tests depend on the uninstalled pycompletionserver.py
++      # or pydev_coverage.py, so we exclude those
++      # * Two bytecode tests fail on Python 3.10, so we exclude those too.
++      # Reported upstream to
++      # https://github.com/fabioz/PyDev.Debugger/issues/222
++      # * 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
++      # * 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
++      # * 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)
++      # * Some tests fail on various architectures, but I'm not sure why,
++      # so we skip them; see README.Debian for some more comments on this.
++      #
++      # * The http_proxy settings are to disable the proxies that pybuild
++      # introduces; the tests set up and use a local http server.
++      #
++      # We also run the tests a second time if the first fails, as
++      # there are occasionally intermittent errors in the tests.
++      export PYDEVD_USE_CYTHON=YES; \
++      export http_proxy=""; \
++      export PYBUILD_TEST_ARGS="\
++              --ignore=tests/test_jyserver.py \
++              --ignore=tests/test_pyserver.py \
++              --ignore=tests_python/test_pydevcoverage.py \
++              --deselect=tests_python/test_debugger_json.py::test_case_flask_exceptions \
++              --deselect=tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01 \
++              --deselect=tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01a \
++              --deselect=tests_python/test_debugger.py::test_py_37_breakpoint_remote_no_import \
++              --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 -s "-screen 0 1024x1024x24" dh_auto_test || \
++              xvfb-run -a -s "-screen 0 1024x1024x24" dh_auto_test
++endif
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a015d8d7ade0537fa2c9fcdd05aceced3099aa55
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 <jdg@debian.org>
++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 = "<run_path>"
++     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':
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++3.0 (quilt)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..cb61fa5267b6ad8b3bbc2a612754b79dae466292
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++extend-diff-ignore = "^[^/]*[.]egg-info/"
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5e2c406d4180116835b2f411690aabc28fc63508
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++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,
++         @
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..1049cf258499c00f305aadea2101152220691f94
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,56 @@@
++#! /bin/bash
++
++set -e
++
++PYS=$(py3versions -s)
++
++cp -a $(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
++
++
++# See the comments in debian/rules regarding skipped tests.
++
++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 here, as that causes
++    # weird breakages
++    cmd="$py -m pytest \
++        --ignore=tests/test_jyserver.py \
++        --ignore=tests/test_pyserver.py \
++        --ignore=tests_python/test_pydevcoverage.py \
++        --deselect=tests_python/test_debugger_json.py::test_case_flask_exceptions \
++        --deselect=tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01 \
++        --deselect=tests_python/test_bytecode_manipulation.py::test_set_pydevd_break_01a \
++        --deselect=tests_python/test_debugger.py::test_py_37_breakpoint_remote_no_import \
++      $DESELECTS \
++      ${NO_PATH_DESELECTS[*]}"
++    export PYTHONPATH=$(pwd)
++    xvfb-run -a -s "-screen 0 1024x1024x24" $cmd || \
++        xvfb-run -a -s "-screen 0 1024x1024x24" $cmd
++    unset PYTHONPATH
++
++    cmd="$py -m pytest ${NO_PATH_TESTS[*]}"
++    xvfb-run -a -s "-screen 0 1024x1024x24" $cmd || \
++        xvfb-run -a -s "-screen 0 1024x1024x24" $cmd
++done
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2e88d6bf91b62412a60e33a8c311e7c6127a816d
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,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 --cc debian/watch
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a1184b508c2574387f6fea42fe1db77b4bf2ecee
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,6 @@@
++version=4
++opts=dversionmangle=s/\+dfsg//,\
++  repack,repacksuffix=+dfsg,\
++  uversionmangle=s/_/\./g \
++  https://github.com/fabioz/PyDev.Debugger/tags \
++  (?:.*/)?pydev_debugger_(.*)\.tar\.gz debian