Reorganize source code to reflect the split between the adapter proper and the debug server.

This commit is contained in:
Pavel Minaev 2019-05-23 15:14:50 -07:00
parent 025c6c2f63
commit 8cca9fcd7a
38 changed files with 67 additions and 17 deletions

View file

@ -16,9 +16,9 @@ a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow th
provided by the bot. You will only need to do this once across all repos using our CLA.
### Prerequisites
Use [test_requirements.txt](test_requirements.txt) file to install the packages needed to run tests:
Use [tests/requirements.txt](tests/requirements.txt) file to install the packages needed to run tests:
```console
pip install -r test_requirements.txt
pip install -r tests/requirements.txt
```
### Linting

19
pyproject.toml Normal file
View file

@ -0,0 +1,19 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"
[tool.black]
# TODO: remove exclusions as code is reformatted to conform to the Black style.
# The only exclusions that should remain in the end are _vendored and versioneer.
exclude = '''
( __pycache__
| ^/setup.py
| ^/versioneer.py
| ^/src/ptvsd/_vendored
| ^/src/ptvsd/_version.py
| ^/src/ptvsd/common
| ^/src/ptvsd/server
| ^/tests
)
'''

View file

@ -3,16 +3,23 @@
# for license information.
__all__ = [
'__version__', '__author__',
'enable_attach', 'wait_for_attach', 'break_into_debugger', 'is_attached',
"__version__",
"attach",
"break_into_debugger",
"debug_this_thread",
"enable_attach",
"is_attached",
"wait_for_attach",
]
# "force_pydevd" must be imported first to ensure (via side effects)
# that the ptvsd-vendored copy of pydevd gets used.
from ._vendored import force_pydevd
from ptvsd.version import __version__, __author__
from ptvsd.attach_server import ( # noqa
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
from ptvsd.server import (
attach,
break_into_debugger,
debug_this_thread,
@ -20,4 +27,3 @@ from ptvsd.attach_server import ( # noqa
is_attached,
wait_for_attach,
)
del force_pydevd

View file

@ -2,8 +2,7 @@
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
__author__ = "Microsoft Corporation <ptvshelp@microsoft.com>"
from __future__ import absolute_import, print_function, unicode_literals
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__all__ = []

View file

@ -0,0 +1,13 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, print_function, unicode_literals
def main():
raise NotImplementedError
if __name__ == "__main__":
main()

View file

@ -0,0 +1,8 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, print_function, unicode_literals
__all__ = []

View file

@ -0,0 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
# "force_pydevd" must be imported first to ensure (via side effects)
# that the ptvsd-vendored copy of pydevd gets used.
import ptvsd._vendored.force_pydevd

View file

@ -1,12 +1,10 @@
colorama
coverage
django
requests
flask
psutil
pygments
pytest<5
pytest-cov
pytest-timeout
pytest-xdist
tox

View file

@ -2,6 +2,6 @@
envlist = py{27,34,35,36,37}
[testenv]
deps = -rtest_requirements.txt
deps = -rtests/requirements.txt
commands = pytest {posargs:-vv}
passenv = PTVSD_LOG_DIR