-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: DevContainer added and explained
Trying to make life easier for new contributors to this project by adding a dev container and additional docs Fixed Provide DevContainer with tests configured #453
- Loading branch information
Showing
5 changed files
with
234 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Python 3", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
// "image": "mcr.microsoft.com/devcontainers/python:3.9-bookworm", | ||
// "image": "mcr.microsoft.com/devcontainers/python:3.10-bookworm", | ||
// "image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm", | ||
"image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm", | ||
// "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", | ||
|
||
"features": { | ||
"ghcr.io/hspaans/devcontainer-features/pytest:1": {}, | ||
"ghcr.io/devcontainers-extra/features/pylint:2": {}, | ||
"ghcr.io/devcontainers-extra/features/poetry:2": {}, | ||
"ghcr.io/devcontainers/features/powershell:1": {} | ||
}, | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "git config --global core.autocrlf true && pip3 install --user -r requirements_dev.txt && pwsh -File kiota-python.ps1 install-deps", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-python.python", | ||
"wmiller4.python-venv-switcher" | ||
] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"python.testing.cwd": ".", | ||
// "python.poetryPath": ".venv/bin/poetry", | ||
// "python.testing.pytestPath": ".venv/bin/pytest", | ||
// "python.analysis.typeCheckingMode": "basic", | ||
"python.testing.pytestArgs": [ | ||
"packages/tests", | ||
"packages/abstractions/tests", | ||
"packages/authentication/tests", | ||
"packages/bundle/tests", | ||
"packages/http/tests", | ||
"packages/serialization/form/tests", | ||
"packages/serialization/json/tests", | ||
"packages/serialization/multipart/tests", | ||
"packages/serialization/text/tests", | ||
"--rootdir=${workspaceFolder}" | ||
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": false, // Disable pytest (does not work with poetry yet) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "poetry:deps", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"install-deps" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:format", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"format" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:check-format", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"check-format" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:lint", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"lint" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:check-types", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"test" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:test", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"test" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "poetry:check-all", | ||
"type": "shell", | ||
"command": "pwsh", | ||
"args": [ | ||
"--File", | ||
"kiota-python.ps1", | ||
"test" | ||
], | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": [ | ||
"$python" | ||
] | ||
}, | ||
{ | ||
"label": "pre-commit", | ||
"type": "shell", | ||
"command": "echo", | ||
"args": [ | ||
"All tests executed" | ||
], | ||
"dependsOn":[ | ||
"poetry:format", | ||
"poetry:check-all" | ||
] | ||
} | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pylint==3.2.7 | ||
poetry-plugin-mono-repo-deps==0.3.0 |