-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update and enhance Kedro VSCode extension documentation #4538
base: main
Are you sure you want to change the base?
Changes from all commits
cbf680d
4e48915
f780e18
2ee49d3
a062654
ce37d7d
3ed20c8
160dda7
01722e6
160a8e2
952f044
9ccd723
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
```{toctree} | ||
:maxdepth: 1 | ||
|
||
set_up_vscode | ||
set_up_pycharm | ||
commands_reference | ||
debugging | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -99,6 +99,79 @@ | |||||||||
 | ||||||||||
|
||||||||||
|
||||||||||
## Setting a custom Kedro project path | ||||||||||
|
||||||||||
Starting with Kedro VS Code extension version 0.3.0, you can now specify a custom path to your Kedro project. This is useful when: | ||||||||||
|
||||||||||
- Your Kedro project is not at the root of your workspace | ||||||||||
- You want to work with a Kedro project that is outside your current workspace | ||||||||||
- You have multiple Kedro projects and want to switch between them | ||||||||||
Check warning on line 108 in docs/source/visual_studio_code_extension/set_up_vscode.md
|
||||||||||
|
||||||||||
|
||||||||||
### Ways to set a custom path for Kedro project: | ||||||||||
|
||||||||||
#### Using the command palette | ||||||||||
Comment on lines
+111
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Suggested change
(and same with the other H4 below) |
||||||||||
|
||||||||||
1. Open the Command Palette by pressing `Cmd + Shift + P` (macOS) or `Ctrl + Shift + P` (Windows/Linux) | ||||||||||
2. Type `Kedro: Set Project Path` and select it | ||||||||||
3. Enter the absolute path to your Kedro project (for example, `/Users/username/projects/my-kedro-project`) | ||||||||||
|
||||||||||
 | ||||||||||
|
||||||||||
#### Using the VSCode settings UI | ||||||||||
Check warning on line 121 in docs/source/visual_studio_code_extension/set_up_vscode.md
|
||||||||||
|
||||||||||
1. Open VS Code settings by pressing `Cmd + ,` (macOS) or `Ctrl + ,` (Windows/Linux) | ||||||||||
2. Search for `kedro` in the settings search bar | ||||||||||
3. Find the `Kedro: Project Path` setting | ||||||||||
4. Enter the absolute path to your Kedro project in the field | ||||||||||
|
||||||||||
 | ||||||||||
|
||||||||||
### Multi-root workspace integration | ||||||||||
|
||||||||||
If the Kedro project path you specify is not part of your current workspace, the extension will automatically add it to your workspace as part of a multi-root workspace. This allows you to: | ||||||||||
|
||||||||||
- See the project files in the Explorer | ||||||||||
- Navigate the project structure | ||||||||||
- Use all Kedro extension features with the specified project | ||||||||||
|
||||||||||
### Example directory structure | ||||||||||
|
||||||||||
If your Kedro project is nested within other folders, setting a custom project path can help the extension locate it. For example: | ||||||||||
|
||||||||||
``` | ||||||||||
root | ||||||||||
│ file001.txt | ||||||||||
│ | ||||||||||
└───folder1 | ||||||||||
│ │ file011.txt | ||||||||||
│ │ file012.txt | ||||||||||
│ │ | ||||||||||
│ └───kedroProject <-- Set this path | ||||||||||
│ │ pyproject.toml | ||||||||||
│ │ README.md | ||||||||||
│ │ ... | ||||||||||
│ | ||||||||||
└───folder2 | ||||||||||
│ file020.txt | ||||||||||
│ file021.txt | ||||||||||
``` | ||||||||||
|
||||||||||
In this case, you would set the Kedro project path to the absolute path of the `kedroProject` directory, such as `/Users/username/root/folder1/kedroProject`. | ||||||||||
|
||||||||||
### Switching between multiple projects | ||||||||||
Check warning on line 162 in docs/source/visual_studio_code_extension/set_up_vscode.md
|
||||||||||
|
||||||||||
If you work with multiple Kedro projects, you can switch between them by updating the project path setting. The extension will automatically detect the change and reconfigure itself to work with the newly specified project. | ||||||||||
Check warning on line 164 in docs/source/visual_studio_code_extension/set_up_vscode.md
|
||||||||||
|
||||||||||
### Troubleshooting | ||||||||||
|
||||||||||
If the extension doesn't recognise your Kedro project after setting a custom path: | ||||||||||
|
||||||||||
1. Ensure the path points to a valid Kedro project (containing `pyproject.toml` with Kedro dependencies) | ||||||||||
2. Check that the path is an absolute path, not a relative one | ||||||||||
3. Reload VS Code if the changes don’t take effect. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will there be any quick way to check the extension has picked up the new project path ? Like some kind of logger or console output which can help users confirm of the change ? |
||||||||||
|
||||||||||
|
||||||||||
## Debugging | ||||||||||
|
||||||||||
To debug, you _may_ need to create an `.env` file in your project root. Add the full path to the `./src/` folder to the *PYTHONPATH* environment variable in the `.env` file: | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯