Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Python analysis engine integration #1231

Merged
merged 70 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a764bc9
Undo changes
Feb 13, 2018
9d1b2cc
Test fixes
Feb 13, 2018
a91291a
Increase timeout
Mar 2, 2018
bf266af
Remove double event listening
Mar 7, 2018
7bc6bd6
Remove test
Mar 7, 2018
8ce8b48
Revert "Remove test"
Mar 7, 2018
e3a549e
Revert "Remove double event listening"
Mar 7, 2018
c879aa6
Undo changes
Feb 13, 2018
716968f
Test fixes
Feb 13, 2018
63a1385
.NET Core check
Mar 5, 2018
7ea7717
Better find dotnet
Mar 7, 2018
75be0da
Fix pip test
Mar 13, 2018
2701768
Linting tests
Mar 13, 2018
a22e705
Undo accidental changes
Mar 15, 2018
5441644
Add clone and build PTVS
Mar 16, 2018
97175e1
Appveyor PTVS build
Mar 16, 2018
1e97e6a
Fix slashes
Mar 16, 2018
86ac269
Enable build
Mar 16, 2018
7b4e73c
Try absolute path
Mar 18, 2018
bd1fd77
Fix xcopy switch
Mar 18, 2018
72b91f1
Activate Analysis Engine test on Appveyor
Mar 18, 2018
e32320b
Temporary only run new tests
Mar 20, 2018
55bb349
Disable PEP hint tests
Mar 20, 2018
3826ffa
Test fix
Mar 20, 2018
b62ba25
Disable appveyor build and tests for PTVS for now
Mar 21, 2018
a13770b
Remove analysis engine test from the set
Mar 21, 2018
ac646c8
Remove VS image for now
Mar 21, 2018
f754812
Build/sign VSXI project
Mar 26, 2018
826dcee
Run vsce from cmd
Mar 27, 2018
8cb0c44
Rename
Mar 27, 2018
05d4d23
Abs path vsce
Mar 27, 2018
7fd6a8b
Path
Mar 27, 2018
bbcc65d
Move project
Mar 27, 2018
8d170c0
Ignore publishing project
Mar 27, 2018
869b38c
Try csproj
Mar 27, 2018
d8c80f6
Add framework
Mar 27, 2018
56e6b56
Ignore build output folder
Mar 27, 2018
ce6b360
Package before build
Mar 27, 2018
a7847d8
Try batch instead of PS
Mar 27, 2018
05c0bf0
Fix path quotes
Mar 27, 2018
92e8c1e
#1096 The if statement is automatically formatted incorrectly
Mar 27, 2018
b540a1d
Merge fix
Mar 27, 2018
7b0573e
Add more tests
Mar 27, 2018
facb106
More tests
Mar 27, 2018
f113881
Typo
Mar 27, 2018
3e76718
Test
Mar 28, 2018
6e85dc6
Also better handle multiline arguments
Mar 28, 2018
3e071e0
Changes lost on squash
Mar 28, 2018
818a46f
More lost changes
Mar 28, 2018
ac97532
Restore Jedi/PTVS setting
Mar 28, 2018
395b96a
Merge branch 'master' into vsc
Mar 28, 2018
54a090b
Update tests to new PTVS
Mar 28, 2018
3f74686
Signature tests
Mar 28, 2018
febb828
Merge master
Mar 28, 2018
355edfb
Add PTVS tests task
Mar 28, 2018
ccc1017
Analysis Engine contribution
Mar 28, 2018
5c87964
Add Mac/Linux info
Mar 28, 2018
68e3384
Disable csproj build
Mar 28, 2018
abb3daa
Add unzip to dependencies
Mar 28, 2018
78fd495
Minor fixes to doc
Mar 29, 2018
9b9b51c
Merge branch 'master' of https://github.com/Microsoft/vscode-python i…
Mar 29, 2018
84c8b0f
Change setting type to bool
Mar 29, 2018
7761a15
Report progress on status bar
Mar 30, 2018
240d26f
Simplify
Mar 30, 2018
736846a
CR feedback
Mar 30, 2018
1c73143
Merge branch 'vsc' of https://github.com/MikhailArkhipov/vscode-pytho…
Mar 30, 2018
f03c18a
Fix launching fx-independent code on Mac/Linux
Mar 30, 2018
70ce69b
Add title
Mar 30, 2018
c33ae8d
Proper download when .NET is missing
Mar 30, 2018
be268fb
Merge branch 'vsc' of https://github.com/MikhailArkhipov/vscode-pytho…
Mar 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ coverage/
pythonFiles/experimental/ptvsd/**
debug_coverage*/**
analysis/**
bin/**
obj/**
22 changes: 21 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
],
"preLaunchTask": "Compile"
},
{
"name": "Launch Analysis Engine Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/src/test",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "Compile",
"env": {
"VSC_PYTHON_ANALYSIS": "1"
}
},
{
"name": "Launch Tests (with code coverage)",
"type": "extensionHost",
Expand Down Expand Up @@ -114,4 +134,4 @@
]
}
]
}
}
8 changes: 8 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ CODING_STANDARDS.md
CONTRIBUTING.md
news/**
debug_coverage*/**
analysis/publish*.*
vscode-python-signing.*
packageExtension.cmd
bin/**
obj/**
BuildOutput/**


61 changes: 61 additions & 0 deletions CONTRIBUTING - PYTHON_ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributing to Microsoft Python Analysis Engine
[![Contributing to Python Tools for Visual Studio](https://github.com/Microsoft/PTVS/blob/master/CONTRIBUTING.md)]

[![Build Status (Travis)](https://travis-ci.org/Microsoft/vscode-python.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-python) [![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/s0pt8d79gqw222j7?svg=true)](https://ci.appveyor.com/project/DonJayamanne/vscode-python-v3vd6) [![codecov](https://codecov.io/gh/Microsoft/vscode-python/branch/master/graph/badge.svg)](https://codecov.io/gh/Microsoft/vscode-python)


## Contributing a pull request

### Prerequisites

1. .NET Core 2.0+ SDK
- [Windows](https://www.microsoft.com/net/learn/get-started/windows)
- [Mac OS](https://www.microsoft.com/net/learn/get-started/macos)
- [Linux](https://www.microsoft.com/net/learn/get-started/linux/rhel)
2. C# Extension to VS Code (all platforms)
3. Python 2.7
4. Python 3.6

*Alternative:* [Visual Studio 2017](https://www.visualstudio.com/downloads/) (Windows only) with .NET Core and C# Workloads. Community Edition is free and is fully functional.

### Setup

```shell
git clone https://github.com/microsoft/ptvs
cd Python/Product/VsCode/AnalysisVsc
dotnet build
```

Visual Studio 2017:
1. Open solution in Python/Product/VsCode
2. Build AnalysisVsc project
3. Binaries arrive in *Python/BuildOutput/VsCode/raw*
4. Delete contents of the *analysis* folder in the Python Extension folder
5. Copy *.dll, *.pdb, *.json fron *Python/BuildOutput/VsCode/raw* to *analysis*

### Debugging code in Python Extension to VS Code
Folow regular TypeScript debugging steps

### Debugging C# code in Python Analysis Engine
1. Launch another instance of VS Code
2. Open Python/Product/VsCode/AnalysisVsc folder
3. Python Analysis Engine code is in *Python/Product/VsCode/Analysis*
4. Run extension from VS Code
5. In the instance with C# code select Dotnet Attach launch task.
6. Attach to *dotnet* process running *Microsoft.PythonTools.VsCode.dll*

On Windows you can also attach from Visual Studio 2017.

### Validate your changes

1. Build C# code
2. Copy binaries to *analysis* folder
3. Use the `Launch Extension` launch option.

### Unit Tests
1. Run the Unit Tests via the `Launch Analysis Engine Tests`.
2. On Windows you can also open complete PTVS solution in Visual Studio and run its tests (or at least the Analysis section).


### Coding Standards
See [![Contributing to Python Tools for Visual Studio](https://github.com/Microsoft/PTVS/blob/master/CONTRIBUTING.md)]
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Build Status (Travis)](https://travis-ci.org/Microsoft/vscode-python.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-python) [![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/s0pt8d79gqw222j7?svg=true)](https://ci.appveyor.com/project/DonJayamanne/vscode-python-v3vd6) [![codecov](https://codecov.io/gh/Microsoft/vscode-python/branch/master/graph/badge.svg)](https://codecov.io/gh/Microsoft/vscode-python)


# Contributing to Microsoft Python Analysis Engine
[![Contributing to Python Analysis Engine](https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING - PYTHON_ANALYSIS.md)]

## Contributing a pull request

Expand Down
17 changes: 16 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#image: Visual Studio 2017
#shallow_clone: true

environment:
matrix:
- PYTHON: "C:\\Python36"
Expand All @@ -20,11 +23,23 @@ install:
- python -m easy_install -U setuptools
- "%PYTHON%/Scripts/pip.exe install --upgrade -r requirements.txt"

build: off
# build_script:
# - git clone https://github.com/MikhailArkhipov/PTVS.git c:/projects/PTVS
# - "cd c:\\projects\\PTVS"
# - git checkout origin/vsc
# - "cd Python\\Product\\VSCode\\AnalysisVsc"
# - "dotnet --info"
# - "dotnet build"
# - "cd c:\\projects\\vscode-python"
# - "xcopy /S /I c:\\projects\\PTVS\\BuildOutput\\VsCode\\raw analysis"

test_script:
- yarn run clean
- yarn run vscode:prepublish
- yarn run testDebugger --silent
- yarn run testSingleWorkspace --silent
- yarn run testMultiWorkspace --silent
# - yarn run testAnalysisEngine --silent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't remember, but please could you confirm that the tests only run on Appveyor and not on Travis. If this is true, then we might want to create an issue for this, to ensure we try to get this resolved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They currently only on Appveyor b/c of setup issues. We need to discuss if we want a) install .NET Runtime on Travis or b) rely on some other means. (b) may work for us as we download from Azure but third party contributors cant.



build: off
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,12 @@
"default": "${workspaceFolder}/.env",
"scope": "resource"
},
"python.jediEnabled": {
"type": "boolean",
"default": true,
"description": "Enables Jedi as IntelliSense engine instead of Microsoft Python Analysis Engine.",
"scope": "resource"
},
"python.jediPath": {
"type": "string",
"default": "",
Expand Down Expand Up @@ -1727,6 +1733,7 @@
"testDebugger": "node ./out/test/debuggerTest.js",
"testSingleWorkspace": "node ./out/test/standardTest.js",
"testMultiWorkspace": "node ./out/test/multiRootTest.js",
"testAnalysisEngine": "node ./out/test/analysisEngineTest.js",
"precommit": "node gulpfile.js",
"lint-staged": "node gulpfile.js",
"lint": "tslint src/**/*.ts -t verbose",
Expand All @@ -1750,6 +1757,7 @@
"opn": "^5.1.0",
"pidusage": "^1.2.0",
"reflect-metadata": "^0.1.12",
"request-progress": "^3.0.0",
"rxjs": "^5.5.2",
"semver": "^5.4.1",
"sudo-prompt": "^8.0.0",
Expand All @@ -1759,6 +1767,7 @@
"uint64be": "^1.0.1",
"unicode": "^10.0.0",
"untildify": "^3.0.2",
"unzip": "^0.1.11",
"vscode-debugadapter": "^1.0.1",
"vscode-debugprotocol": "^1.0.1",
"vscode-extension-telemetry": "^0.0.14",
Expand Down
1 change: 1 addition & 0 deletions packageExtension.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%1\vsce package --out %2
Loading