|
6 | 6 |
|
7 | 7 | | Metadata | Value |
|
8 | 8 | |----------|-------|
|
9 |
| -| *Contributors* | The VS Code Team | |
| 9 | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | |
10 | 10 | | *Definition type* | Dockerfile |
|
11 | 11 | | *Languages, platforms* | Python |
|
12 | 12 |
|
13 |
| -## Usage |
| 13 | +## Using this definition with an existing folder |
14 | 14 |
|
15 |
| -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). |
| 15 | +First, for convenience, this definition will automatically install dependencies from your `environment.yml` file when the container is built. However, note that `environment.yml` in the root of this definition folder is **only present for testing** and is not used or required by the definition itself. |
16 | 16 |
|
17 |
| -If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project. |
| 17 | +Second, only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used. |
18 | 18 |
|
19 |
| -If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder. |
| 19 | +```json |
| 20 | +"console": "integratedTerminal" |
| 21 | +``` |
20 | 22 |
|
21 |
| -Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output. |
| 23 | +Beyond that, just follow these steps: |
| 24 | + |
| 25 | +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. |
| 26 | + |
| 27 | +2. To use VS Code's copy of this definition: |
| 28 | + 1. Start VS Code and open your project folder. |
| 29 | + 2. Press <kbd>F1</kbd> select and **Remote-Containers: Create Container Configuration File...** from the command palette. |
| 30 | + 3. Select the Python 3 - Miniconda definition. |
| 31 | + |
| 32 | +3. To use latest-and-greatest copy of this definition from the repository: |
| 33 | + 1. Clone this repository. |
| 34 | + 2. Copy the contents of `containers/python-3-miniconda/.devcontainer` to the root of your project folder. |
| 35 | + 3. Start VS Code and open your project folder. |
| 36 | + |
| 37 | +4. After following step 2 or 3, the *only* the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. Ignore other files and folders. |
| 38 | + |
| 39 | +5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** to start using the definition. |
| 40 | + |
| 41 | +## Testing the definition |
| 42 | + |
| 43 | +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: |
| 44 | + |
| 45 | +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. |
| 46 | +2. Clone this repository. |
| 47 | +3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...** |
| 48 | +4. Select the `containers/python-3-miniconda` folder. |
| 49 | +5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project. |
| 50 | +6. A `test-project/plot.png` file should be added to the folder after it runs with the plot result. |
| 51 | +7. Next, open `test-project/hello.py` and press <kbd>ctrl/cmd</kbd>+<kbd>a</kbd> then <kbd>shift</kbd>+<kbd>enter</kbd>. |
| 52 | +8. You should see the `matplotlib` output in the interactive window. |
| 53 | +9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. |
22 | 54 |
|
23 | 55 | ## License
|
24 | 56 |
|
25 | 57 | Copyright (c) Microsoft Corporation. All rights reserved.
|
26 | 58 |
|
27 |
| -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). |
| 59 | +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) |
0 commit comments