Skip to content

Commit

Permalink
Python: Add setup for contributing-python and tests for Semantic-Kern…
Browse files Browse the repository at this point in the history
…el-Python (microsoft#2536)

Add setup tasks for contributing-python and tests for
Semantic-Kernel-Python. The setup tasks install poetry and python
packages. The tests include unit tests, integration tests, and all tests
for Semantic-Kernel-Python.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
  • Loading branch information
lemillermicrosoft and dmytrostruk authored Aug 31, 2023
1 parent 5daf946 commit ac12e95
Showing 1 changed file with 101 additions and 1 deletion.
102 changes: 101 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}
},
{
"label": "validate - (contributing-Format-Build-Test-Run)",
"label": "validate (contributing-Format-Build-Test-Run)",
"detail": "Runs tasks to validate changes before checking in.",
"group": "build",
"dependsOn": [
Expand All @@ -88,6 +88,54 @@
],
"dependsOrder": "sequence"
},
// *****************************
// Contributing (python) - Setup
// *****************************
{
"label": "setup (contributing-python)",
"detail": "",
"group": "build",
"dependsOn": ["install poetry", "install python packages"],
"dependsOrder": "sequence"
},
{
"label": "install poetry",
"detail": "Install poetry",
"command": "pip3",
"type": "shell",
"args": ["install", "poetry"],
"options": {
"cwd": "${workspaceFolder}/python"
}
},
{
"label": "install python packages",
"detail": "Install python packages",
"command": "poetry",
"type": "shell",
"args": ["install"],
"options": {
"cwd": "${workspaceFolder}/python"
}
},
// Formatting
{
"label": "validate (contributing-python)",
"command": "poetry",
"type": "shell",
"group": "build",
"args": [
"run",
"pre-commit",
"run",
"-c",
".conf/.pre-commit-config.yaml",
"-a"
],
"options": {
"cwd": "${workspaceFolder}/python"
}
},
// ***************
// Kernel (dotnet)
// ***************
Expand Down Expand Up @@ -223,6 +271,58 @@
}
},
// ****************
// Kernel (python)
// ****************
// Test
{
"label": "test (Semantic-Kernel-Python)",
"command": "poetry",
"type": "shell",
"args": ["run", "pytest", "tests/unit"],
"problemMatcher": "$msCompile",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared",
"group": "PR-Validate"
},
"options": {
"cwd": "${workspaceFolder}/python"
}
},
{
"label": "test (Semantic-Kernel-Python Integration)",
"command": "poetry",
"type": "shell",
"args": ["run", "pytest", "tests/integration", "-k", "${input:filter}"],
"problemMatcher": "$msCompile",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared",
"group": "PR-Validate"
},
"options": {
"cwd": "${workspaceFolder}/python"
}
},
{
"label": "test (Semantic-Kernel-Python ALL)",
"command": "poetry",
"type": "shell",
"args": ["run", "pytest", "tests", "-k", "${input:filter}"],
"problemMatcher": "$msCompile",
"group": "test",
"presentation": {
"reveal": "always",
"panel": "shared",
"group": "PR-Validate"
},
"options": {
"cwd": "${workspaceFolder}/python"
}
},
// ****************
// Samples (dotnet)
// ****************
// Kernel Syntax Examples
Expand Down

0 comments on commit ac12e95

Please sign in to comment.