File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 with :
7171 node_version : ${{ env.NODE_VERSION }}
7272
73+ check-types :
74+ name : Check Python types
75+ if : github.repository == 'microsoft/vscode-python'
76+ runs-on : ubuntu-latest
77+ steps :
78+ - name : Use Python ${{ env.PYTHON_VERSION }}
79+ uses : actions/setup-python@v2
80+ with :
81+ python-version : ${{ env.PYTHON_VERSION }}
82+
83+ - name : Checkout
84+ uses : actions/checkout@v2.3.4
85+
86+ - name : Install Python requirements
87+ run : |
88+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
89+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt --no-user
90+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py --no-deps --upgrade -r ./pythonFiles/jedilsp_requirements/requirements.txt
91+ python -m pip install --upgrade -r build/test-requirements.txt
92+
93+ - name : Run Pyright
94+ uses : jakebailey/pyright-action@v1
95+ with :
96+ working-directory : ' pythonFiles'
97+
7398 # ## Non-smoke tests
7499 tests :
75100 name : Tests
Original file line number Diff line number Diff line change 4646 with :
4747 node_version : ${{ env.NODE_VERSION }}
4848
49+ check-types :
50+ name : Check Python types
51+ runs-on : ubuntu-latest
52+ steps :
53+ - name : Use Python ${{ env.PYTHON_VERSION }}
54+ uses : actions/setup-python@v2
55+ with :
56+ python-version : ${{ env.PYTHON_VERSION }}
57+
58+ - name : Checkout
59+ uses : actions/checkout@v2.3.4
60+
61+ - name : Install Python requirements
62+ run : |
63+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy
64+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r requirements.txt --no-user
65+ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/jedilsp --no-cache-dir --implementation py --no-deps --upgrade -r ./pythonFiles/jedilsp_requirements/requirements.txt
66+ python -m pip install --upgrade -r build/test-requirements.txt
67+
68+ - name : Run Pyright
69+ uses : jakebailey/pyright-action@v1
70+ with :
71+ working-directory : ' pythonFiles'
72+
4973 # ## Non-smoke tests
5074 tests :
5175 name : Tests
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ def _get_statements(selection):
5555 # In Python 2.7, lineno takes into account decorators, so this offset check is unnecessary.
5656 # Also, not all AST objects can have decorators.
5757 if hasattr (node , "decorator_list" ) and sys .version_info .major >= 3 :
58- line_end -= len (node .decorator_list )
58+ # Using getattr instead of node.decorator_list or pyright will complain about an unknown member.
59+ line_end -= len (getattr (node , "decorator_list" ))
5960 ends .append (line_end )
6061 ends .append (len (lines ))
6162
@@ -71,7 +72,8 @@ def _get_statements(selection):
7172
7273 # Special handling of decorators similar to what's above.
7374 if hasattr (node , "decorator_list" ) and sys .version_info .major >= 3 :
74- start -= len (node .decorator_list )
75+ # Using getattr instead of node.decorator_list or pyright will complain about an unknown member.
76+ start -= len (getattr (node , "decorator_list" ))
7577 block = "\n " .join (lines [start :end ])
7678
7779 # If the block is multiline, add an extra newline character at its end.
Original file line number Diff line number Diff line change @@ -9,3 +9,27 @@ exclude = '''
99 )/
1010)
1111'''
12+
13+ [tool .pyright ]
14+ exclude = [' lib' ]
15+ extraPaths = [' lib/python' , ' lib/jedilsp' ]
16+ ignore = [
17+ # Ignore all pre-existing code with issues
18+ ' get-pip.py' ,
19+ ' install_debugpy.py' ,
20+ ' tensorboard_launcher.py' ,
21+ ' testlauncher.py' ,
22+ ' visualstudio_py_testlauncher.py' ,
23+ ' testing_tools/unittest_discovery.py' ,
24+ ' testing_tools/adapter/util.py' ,
25+ ' testing_tools/adapter/pytest/_discovery.py' ,
26+ ' testing_tools/adapter/pytest/_pytest_item.py' ,
27+ ' tests/debug_adapter/test_install_debugpy.py' ,
28+ ' tests/testing_tools/adapter/.data' ,
29+ ' tests/testing_tools/adapter/test___main__.py' ,
30+ ' tests/testing_tools/adapter/test_discovery.py' ,
31+ ' tests/testing_tools/adapter/test_functional.py' ,
32+ ' tests/testing_tools/adapter/test_util.py' ,
33+ ' tests/testing_tools/adapter/pytest/test_cli.py' ,
34+ ' tests/testing_tools/adapter/pytest/test_discovery.py' ,
35+ ]
You can’t perform that action at this time.
0 commit comments