Commit graph

675 commits

Author SHA1 Message Date
Fabio Zadrozny
a07f6e8d83 Re-enable gevent test with Python 3.10. Fixes #688 2021-12-11 07:58:15 -03:00
Pavel Minaev
f4c8e487fb Remove unused import. 2021-11-03 19:00:57 -07:00
Pavel Minaev
e25fc1dcca Fix #677: Enable CI for python 3.10
Fix #689: test_django fails on py3.10

Re-enable Django tests on Python 3.10, and add it to CI runs.
2021-11-03 19:00:57 -07:00
Fabio Zadrozny
ddb083cc25 Properly validate/change django/jinja2 template breakpoints lines. Fixes #213 2021-10-26 07:53:51 -03:00
Lumir Balhar
f14ba78c5c Do not install tox into tox
Having tox as a dependency in requirements files means that
it's also installed in all the tox environments.
2021-09-28 13:29:29 -07:00
Steve Kowalik
9d8bb3fa3c Correct pthread library name in find_library()
ctypes.util.find_library() does not require the "lib" prefix, and may
throw an exception depending on the environment, so drop the prefix
when finding it.
2021-09-16 09:48:19 -03:00
Pavel Minaev
3a9f7d64c4 Assorted fixes for Python 3.10 support:
Split test/requirements.txt into two different lists, one for py2, and the other for py3; update package versions in py3 list as needed to support py3.10.

Fix usage of deprecated threading functions getName(), setName(), isDaemon(), and currentThread().

Refactor test_invalid_breakpoints to be more declarative to handle Python version differences more easily and clearly, and fix it for py3.10.

Disable Django tests on py3.10 (#689).

Disable gevent tests on py3.10 (#688).
2021-08-06 07:12:13 -03:00
Pavel Minaev
0e5b8f7a7c Fix #545: Popen CREATE_BREAKAWAY_FROM_JOB in Python while debugging causes permission error (Access Denied)
Use JOB_OBJECT_LIMIT_BREAKAWAY_OK for the launcher job.

Fix error reporting in messaging when connection closes while sending a message.
2021-08-03 14:01:22 -07:00
Michał Górny
eef3b4ef2b Fix deprecated import for MutableMapping and MutableSet
Starting with Python 3.3, MutableMapping and MutableSet are part
of collections.abc module rather than collections.  Importing them
from the old module is deprecated and no longer works in Python 3.10.
Support both modules conditionally for best compatibility.
2021-07-02 12:31:59 +02:00
Fabio Zadrozny
6403f1e369 Make sure _get_path_with_real_case is called with an absolute path. Fixes #620 2021-05-28 13:26:21 -03:00
Pavel Minaev
cbed5de015 Use django.core.signals.request_finished to exit asynchronously after serving the response. 2021-05-26 11:50:48 -07:00
Pavel Minaev
0a7f2cd67d Fix #628: Flask tests fail because werkzeug.server.shutdown is deprecated
Use @app.teardown_request to exit asynchronously after serving the response.
2021-05-26 11:50:48 -07:00
Fabio Zadrozny
9ab891b328 Code reloading. Fixes #212 2021-03-11 10:26:51 -03:00
Fabio Zadrozny
f9b54cdcd9 Support running non-ascii files on Python 2. Fixes #206 2020-12-10 08:52:28 -03:00
Fabio Zadrozny
ac05dab62b Support module with __file__=None. Fixes #475 2020-12-03 09:38:59 -03:00
Pavel Minaev
7d2a7a2b11 Fix #463: Enable overriding "pythonPath" in the launcher
Add "debugLauncherPython" debug config property to customize Python interpreter used to spawn the launcher.
2020-11-11 11:13:09 -08:00
Pavel Minaev
5384d23743 Fix #93: null values not supported in "env" 2020-10-26 11:22:12 -07:00
Pavel Minaev
1727a3e109 Fix #330: Unable to debug pythonw apps on macOS
In the launcher, use "python" instead of sys.executable to spawn the debuggee.

Update test for "python" / "pythonPath" / "pythonArgs" to use a helper script to assert the use of a custom Python binary; and test -B instead of -v to minimize test log size and run time.
2020-10-23 16:44:56 -07:00
Pavel Minaev
d68a17170c Re-enable attach by socket on macOS + Python 3.6 (per #1967). 2020-09-25 13:41:24 -07:00
Pavel Minaev
6e1c7567d2 Fix #81: Subprocess always waits for client to attach
Unblock subprocesses for which no notification could be sent to the client.
2020-09-25 13:41:24 -07:00
Pavel Minaev
562afbcde0 Fix #414: test_invalid_breakpoints fails on Python 3.9
Adjust expected line numbers in test to reflect Python changes.
2020-09-21 12:24:47 -07:00
Pavel Minaev
14ca4f07d1 Fix #351: Python warnings in debugger code
Don't use inspect.getargspec on Python 2.

Close log file objects on exit.

Close os.devnull file objects on exit.

Close the listener socket used to get endpoints info from adapter.

Fix invalid escape sequences.

Run tests with Python warnings treated as errors.

Fix Django deprecation warning in test web app.

Work around pytest issues caused spaces in test names.
2020-09-03 01:32:58 -07:00
Pavel Minaev
677fef79d1 Disable frame-eval by default to work around #346. 2020-08-26 10:09:19 -07:00
Pavel Minaev
17ff9c8df9 Restrict pytest-xdist version number to support Python 2.7. 2020-08-19 14:50:44 -07:00
Pavel Minaev
5087603ea3 Fix #370: Terminal Keyboard Inputs not being accepted
Make the debuggee process group the foreground group in its session.

Add a test for input(), and improve existing stdin test to cover more cases.
2020-08-19 14:50:44 -07:00
Pavel Minaev
57ec4c4f65 Fix #125: Stop Debugging in a "noDebug" session doesn't kill subprocesses
On Windows, run the debuggee in a separate Win32 job, and terminate the job when launcher exits.

On POSIX, run the debuggee in a separate process group (PGID), and kill the entire group when launcher exits.

Improve process tree autokill tests to actually check whether the child process has exited.
2020-08-11 09:41:51 -07:00
Pavel Minaev
2c524faacd Fix #305: Add "pythonArgs" config property for interpreter arguments
Expose "pythonArgs" to clients.

Make "python" usable in tests in lieu of "pythonPath", and make the runners use it.

Add tests for all combinations of "python"/"pythonPath" and "pythonArgs".
2020-08-03 11:45:55 -07:00
Fabio Zadrozny
499bbb2a1e Don't patch stdin on debugpy. Fixes #296 2020-07-23 08:28:14 -03:00
Fabio Zadrozny
1bef8e5ffb Improve dealing with blocking evaluate requests. Fixes #157 2020-07-18 14:57:02 -03:00
Pavel Minaev
93982f9ad4 Reformat everything with a newer version of Black. 2020-06-26 13:37:31 -07:00
Pavel Minaev
9ba20c40af
Disable test_attach_pid_client on Windows and macOS per #311 2020-06-24 08:56:18 -07:00
Karthik Nadig
984bf59ce0 Update to use latest flask in tests 2020-06-12 13:14:51 -07:00
Fabio Zadrozny
cc1d3f69d1 Fix flake8 issue. 2020-05-13 15:18:36 -03:00
Pavel Minaev
73665b9af9 Parse and apply "python" / "pythonPath" in the adapter rather than in the launcher.
Fix errors with missing "args".

Add test for "pythonPath".
2020-05-08 17:10:34 -07:00
Pavel Minaev
1a44e70206 Fix #156: Add a flag for the old way of handling args from a launch config
Add new property "argsExpansion", which defaults to "shell", but can be explicitly set to "none" to request no expansion.

Propagate "args" to launcher via CLI or JSON, depending on the value of "argsExpansion".

Move the logic to compute process name back to the adapter, alongside other processing of "launch" targets.
2020-05-07 12:31:40 -07:00
Pavel Minaev
50bf46cf9d Add test for "args" shell expansion. 2020-04-22 13:55:01 -07:00
Fabio Zadrozny
011810aa42 Change __len__ to len(). 2020-04-21 08:20:54 -03:00
Fabio Zadrozny
d2014babd6 Show globals, group variables and show all dir() variables.
Fixes https://github.com/microsoft/ptvsd/issues/118
Fixes https://github.com/microsoft/ptvsd/issues/763
Fixes https://github.com/microsoft/ptvsd/issues/1621
2020-04-21 08:20:54 -03:00
Pavel Minaev
47dd3da5e7 Fix #99: multiprocessing triggers preLaunchTask and postDebugTask more than once
Remove "preLaunchTask" and "postDebugTask" from derived debug configurations generated for subprocesses.
2020-04-03 15:46:09 -07:00
Pavel Minaev
32c00bc85c Fix #92: Debugging as sudo fails to terminate the debugger when you stop
Apply sudo to debugpy.launcher, rather than the debuggee itself.
2020-04-01 21:16:20 -07:00
Pavel Minaev
2d35573eda Fix #90: "subProcess" is not respected
Propagate "subProcess" to the debug server via command line in launch scenarios.

Fix debugpy.configure() being a no-op rather than a shim for api.configure().
2020-04-01 20:10:34 -07:00
Fabio Zadrozny
6be9c6df33 Keep order of items in dictionary (Py3.6 onwards) or odict. Fixes https://github.com/microsoft/ptvsd/issues/998 2020-04-01 15:51:44 -03:00
Pavel Minaev
69db68a5f9 Fix https://github.com/microsoft/ptvsd/issues/2108:
Debug multiprocess leads to AttributeError Can't get attribute on <module '__main__

Don't import multiprocessing before running user code.

Use bytes rather than unicode for __main__.__name__ on Python 2.7.
2020-03-18 14:22:10 -07:00
Pavel Minaev
161af6f5f6 Remove unused imports. 2020-03-13 17:26:08 -07:00
Pavel Minaev
dd02acbe52 Remove broken test_wait_on_exit (#73). 2020-03-13 17:26:08 -07:00
Pavel Minaev
dccb5e6198 Use "connect":{...} and "listen":{...} to indicate direction of connection in debug configuration. 2020-03-05 13:56:22 -08:00
Pavel Minaev
2d013e58ec Swap attach_listen / attach_connect to reflect the client perspective. 2020-03-05 13:56:22 -08:00
Pavel Minaev
73a4c8b712 Actually run full test matrix for DEBUGBY_TESTS_FULL=1.
Fix full run test failures.
2020-03-05 13:56:22 -08:00
Pavel Minaev
6ad1382a8c Fix https://github.com/microsoft/ptvsd/issues/1824:
Allow ptvsd to run as server and let code connect to it

Expose --connect and debugpy.connect() as a public API, and add tests for it.
2020-03-05 13:56:22 -08:00
Pavel Minaev
4f43e00a07 Remove suppport for arrays in "program" and "module" debug configuration properties as alternative to "args".
Change the meaning of array for "code" debug configuration property to represent multiple lines of code.

Switch tests to use "args".
2020-02-21 15:55:17 -08:00