Python: Update dev setup readme (#6797)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The DEV setup readme does not clearly outline which workspace and
formatter to use in VSCode. And some instructions also show
inconsistencies in the project folder structures.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
Update the README to make things more obvious and consistent.

### Contribution Checklist

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

- [ ] The code builds clean without any errors or warnings
- [ ] 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
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
This commit is contained in:
Tao Chen
2024-06-18 11:52:02 +00:00
committed by GitHub
parent 0ed3ccae44
commit ecb9ae5c44
+8 -6
View File
@@ -36,7 +36,7 @@ This optional `env_file_path` parameter will allow pydantic settings to use the
If using the second method, we suggest adding a copy of the `.env` file under these folders:
- [python/tests](tests)
- [./tests](./tests)
- [./samples/getting_started](./samples/getting_started).
## System setup
@@ -139,19 +139,24 @@ poetry run pre-commit install
## VSCode Setup
Open the [workspace](https://code.visualstudio.com/docs/editor/workspaces) in VSCode.
> The Python workspace is the `./python` folder if you are at the root of the repository.
Open any of the `.py` files in the project and run the `Python: Select Interpreter`
command from the command palette. Make sure the virtual env (venv) created by
`poetry` is selected.
The python you're looking for should be under `~/.cache/pypoetry/virtualenvs/semantic-kernel-.../bin/python`.
If prompted, install `ruff` and `black` (these should have been installed as part of `poetry install`).
If prompted, install `ruff`. (It should have been installed as part of `poetry install`).
You also need to install the `ruff` extension in VSCode so that auto-formatting uses the `ruff` formatter on save.
Read more about the extension here: https://github.com/astral-sh/ruff-vscode
## Tests
You can run the unit tests under the [tests/unit](tests/unit/) folder.
```bash
cd python
poetry install
poetry run pytest tests/unit
```
@@ -162,7 +167,6 @@ Alternatively, you can run them using VSCode Tasks. Open the command palette
You can run the integration tests under the [tests/integration](tests/integration/) folder.
```bash
cd python
poetry install
poetry run pytest tests/integration
```
@@ -170,7 +174,6 @@ You can run the integration tests under the [tests/integration](tests/integratio
You can also run all the tests together under the [tests](tests/) folder.
```bash
cd python
poetry install
poetry run pytest tests
```
@@ -327,7 +330,6 @@ Ideally you should run these checks before committing any changes, use `poetry r
We try to maintain a high code coverage for the project. To run the code coverage on the unit tests, you can use the following command:
```bash
cd python
poetry run pytest --cov=semantic_kernel --cov-report=term-missing:skip-covered tests/unit/
```
or use the following task (using `Ctrl+Shift+P`):