Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.57 KB

CONTRIBUTING - PYTHON_ANALYSIS.md

File metadata and controls

62 lines (45 loc) · 2.57 KB

Contributing to Microsoft Python Analysis Engine

[Contributing to Python Tools for Visual Studio]

Build Status (Travis) Build status (AppVeyor) codecov

Contributing a pull request

Prerequisites

  1. .NET Core 2.0+ SDK
  2. C# Extension to VS Code (all platforms)
  3. Python 2.7
  4. Python 3.6

Alternative: Visual Studio 2017 (Windows only) with .NET Core and C# Workloads. Community Edition is free and is fully functional.

Setup

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
  6. In VS Code set setting python.downloadCodeAnalysis to false

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]