Skip to content

Commit ecb9ae5

Browse files
authoredJun 18, 2024
Python: Update dev setup readme (microsoft#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 😄
1 parent 0ed3cca commit ecb9ae5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎python/DEV_SETUP.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This optional `env_file_path` parameter will allow pydantic settings to use the
3636

3737
If using the second method, we suggest adding a copy of the `.env` file under these folders:
3838

39-
- [python/tests](tests)
39+
- [./tests](./tests)
4040
- [./samples/getting_started](./samples/getting_started).
4141

4242
## System setup
@@ -139,19 +139,24 @@ poetry run pre-commit install
139139

140140
## VSCode Setup
141141

142+
Open the [workspace](https://code.visualstudio.com/docs/editor/workspaces) in VSCode.
143+
> The Python workspace is the `./python` folder if you are at the root of the repository.
144+
142145
Open any of the `.py` files in the project and run the `Python: Select Interpreter`
143146
command from the command palette. Make sure the virtual env (venv) created by
144147
`poetry` is selected.
145148
The python you're looking for should be under `~/.cache/pypoetry/virtualenvs/semantic-kernel-.../bin/python`.
146149
147-
If prompted, install `ruff` and `black` (these should have been installed as part of `poetry install`).
150+
If prompted, install `ruff`. (It should have been installed as part of `poetry install`).
151+
152+
You also need to install the `ruff` extension in VSCode so that auto-formatting uses the `ruff` formatter on save.
153+
Read more about the extension here: https://github.com/astral-sh/ruff-vscode
148154
149155
## Tests
150156
151157
You can run the unit tests under the [tests/unit](tests/unit/) folder.
152158
153159
```bash
154-
cd python
155160
poetry install
156161
poetry run pytest tests/unit
157162
```
@@ -162,15 +167,13 @@ Alternatively, you can run them using VSCode Tasks. Open the command palette
162167
You can run the integration tests under the [tests/integration](tests/integration/) folder.
163168
164169
```bash
165-
cd python
166170
poetry install
167171
poetry run pytest tests/integration
168172
```
169173
170174
You can also run all the tests together under the [tests](tests/) folder.
171175
172176
```bash
173-
cd python
174177
poetry install
175178
poetry run pytest tests
176179
```
@@ -327,7 +330,6 @@ Ideally you should run these checks before committing any changes, use `poetry r
327330
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:
328331

329332
```bash
330-
cd python
331333
poetry run pytest --cov=semantic_kernel --cov-report=term-missing:skip-covered tests/unit/
332334
```
333335
or use the following task (using `Ctrl+Shift+P`):

0 commit comments

Comments
 (0)
Please sign in to comment.