diff --git a/containers/python-2/.vscode/launch.json b/containers/python-2/.vscode/launch.json index 1298fb1ca1..8adba7b49a 100644 --- a/containers/python-2/.vscode/launch.json +++ b/containers/python-2/.vscode/launch.json @@ -5,10 +5,10 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Current File (Integrated Terminal)", + "name": "Python (Integrated Terminal)", "type": "python", "request": "launch", - "program": "${file}", + "program": "${workspaceFolder}/test-project/hello.py", "console": "integratedTerminal" } ] diff --git a/containers/python-2/README.md b/containers/python-2/README.md index c5ee5b4431..f5ace89af3 100644 --- a/containers/python-2/README.md +++ b/containers/python-2/README.md @@ -6,20 +6,50 @@ | Metadata | Value | |----------|-------| -| *Contributors* | The VS Code Team | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | | *Languages, platforms* | Python | -## Usage +## Using this definition with an existing folder -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). +For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that 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. -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. +```json +"console": "integratedTerminal" +``` -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. You can then start the test program from Debug panel in VS Code. +Beyond that, just follow these steps: + +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. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Create Container Configuration File...** from the command palette. + 3. Select the Python 2 definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/python-2/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: + +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. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/python-2` folder. +5. After the folder has opened in the container, press F5 to start the project. +6. You should see "Hello, remote world!" in a terminal window after the program executes. +7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. ## License Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) diff --git a/containers/python-3-anaconda/.vscode/launch.json b/containers/python-3-anaconda/.vscode/launch.json index 1298fb1ca1..a89c2912f0 100644 --- a/containers/python-3-anaconda/.vscode/launch.json +++ b/containers/python-3-anaconda/.vscode/launch.json @@ -5,10 +5,11 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Current File (Integrated Terminal)", + "name": "Python (Integrated Terminal)", "type": "python", "request": "launch", - "program": "${file}", + "program": "${workspaceFolder}/test-project/hello.py", + "cwd":"${workspaceFolder}/test-project", "console": "integratedTerminal" } ] diff --git a/containers/python-3-anaconda/README.md b/containers/python-3-anaconda/README.md index 20617c28c0..3348fe2641 100644 --- a/containers/python-3-anaconda/README.md +++ b/containers/python-3-anaconda/README.md @@ -6,22 +6,52 @@ | Metadata | Value | |----------|-------| -| *Contributors* | The VS Code Team | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | | *Languages, platforms* | Python | -## Usage +## Using this definition with an existing folder -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). +For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that 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. -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. +```json +"console": "integratedTerminal" +``` -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. +Beyond that, just follow these steps: -Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output. +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. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Create Container Configuration File...** from the command palette. + 3. Select the Python 3 - Anaconda definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/python-3-anaconda/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: + +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. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/python-3-anaconda` folder. +5. After the folder has opened in the container, press F5 to start the project. +6. A `test-project/plot.png` file should be added to the folder after it runs with the plot result. +7. Next, open `test-project/hello.py` and press ctrl/cmd+a then shift+enter. +8. You should see the `matplotlib` output in the interactive window. +9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. ## License Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) diff --git a/containers/python-3-anaconda/test-project/.gitignore b/containers/python-3-anaconda/test-project/.gitignore new file mode 100644 index 0000000000..1c0fc9f7fe --- /dev/null +++ b/containers/python-3-anaconda/test-project/.gitignore @@ -0,0 +1 @@ +plot.png \ No newline at end of file diff --git a/containers/python-3-anaconda/test-project/hello.py b/containers/python-3-anaconda/test-project/hello.py index 97af5dc28e..051a134140 100644 --- a/containers/python-3-anaconda/test-project/hello.py +++ b/containers/python-3-anaconda/test-project/hello.py @@ -14,5 +14,7 @@ title='About as simple as it gets, folks') ax.grid() -fig.savefig("test.png") -plt.show() \ No newline at end of file +fig.savefig("plot.png") +plt.show() + +print('Open test-project/plot.png to see the result!') diff --git a/containers/python-3-miniconda/.vscode/launch.json b/containers/python-3-miniconda/.vscode/launch.json index 1298fb1ca1..a89c2912f0 100644 --- a/containers/python-3-miniconda/.vscode/launch.json +++ b/containers/python-3-miniconda/.vscode/launch.json @@ -5,10 +5,11 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Current File (Integrated Terminal)", + "name": "Python (Integrated Terminal)", "type": "python", "request": "launch", - "program": "${file}", + "program": "${workspaceFolder}/test-project/hello.py", + "cwd":"${workspaceFolder}/test-project", "console": "integratedTerminal" } ] diff --git a/containers/python-3-miniconda/README.md b/containers/python-3-miniconda/README.md index e2183c69e7..8ed3b4fd8b 100644 --- a/containers/python-3-miniconda/README.md +++ b/containers/python-3-miniconda/README.md @@ -6,22 +6,54 @@ | Metadata | Value | |----------|-------| -| *Contributors* | The VS Code Team | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | | *Languages, platforms* | Python | -## Usage +## Using this definition with an existing folder -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). +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. -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. +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. -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. +```json +"console": "integratedTerminal" +``` -Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output. +Beyond that, just follow these steps: + +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. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Create Container Configuration File...** from the command palette. + 3. Select the Python 3 - Miniconda definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/python-3-miniconda/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +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. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: + +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. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/python-3-miniconda` folder. +5. After the folder has opened in the container, press F5 to start the project. +6. A `test-project/plot.png` file should be added to the folder after it runs with the plot result. +7. Next, open `test-project/hello.py` and press ctrl/cmd+a then shift+enter. +8. You should see the `matplotlib` output in the interactive window. +9. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. ## License Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) diff --git a/containers/python-3-miniconda/test-project/.gitignore b/containers/python-3-miniconda/test-project/.gitignore new file mode 100644 index 0000000000..1c0fc9f7fe --- /dev/null +++ b/containers/python-3-miniconda/test-project/.gitignore @@ -0,0 +1 @@ +plot.png \ No newline at end of file diff --git a/containers/python-3-miniconda/test-project/hello.py b/containers/python-3-miniconda/test-project/hello.py index 97af5dc28e..051a134140 100644 --- a/containers/python-3-miniconda/test-project/hello.py +++ b/containers/python-3-miniconda/test-project/hello.py @@ -14,5 +14,7 @@ title='About as simple as it gets, folks') ax.grid() -fig.savefig("test.png") -plt.show() \ No newline at end of file +fig.savefig("plot.png") +plt.show() + +print('Open test-project/plot.png to see the result!') diff --git a/containers/python-3-postgres/README.md b/containers/python-3-postgres/README.md index 9f573aab33..d0c4a76545 100644 --- a/containers/python-3-postgres/README.md +++ b/containers/python-3-postgres/README.md @@ -6,34 +6,60 @@ | Metadata | Value | |----------|-------| -| *Contributors* | The VS Code Team | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | | *Languages, platforms* | Python | -## Usage +## Using this definition with an existing folder -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). +First, for convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. However, note that `requirements.txt` in the root of this definition folder is **only present for testing** and is not used or required by the definition itself. -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. +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. -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. - -Initialize the database and super user by opening the terminal and running: -``` -cd test-project -python manage.py migrate -python manage.py createsuperuser +```json +"console": "integratedTerminal" ``` -You can then start the test program from Debug panel in VS Code, or by running: -``` -python manage.py runserver 0.0.0.0:5000 -``` +Beyond that, just follow these steps: + +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. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Create Container Configuration File...** from the command palette. + 3. Select the Python 3 & PostgreSQL definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/python-3-postgres/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +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. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: -Then browse to [http://localhost:5000/admin](http://localhost:5000/admin) and login! +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. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/python-3-postgres` folder. +5. After the folder has opened in the container, use ctrl+shift+` to open a terminal and run the following commands to initialize the database and create a super user: + ```bash + cd test-project + python manage.py migrate + python manage.py createsuperuser + ``` +6. Next, press F5 to start the project. +7. Once the project is running, press F1 and select **Remote-Containers: Forward Port...** +8. Select port 5000 and click the "Open Browser" button in the notification that appears. +9. You should see a page with a message indicating the install was successful. You can also go to `http://localhost:/admin` and sign in. +10. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. ## License Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE) diff --git a/containers/python-3/.vscode/launch.json b/containers/python-3/.vscode/launch.json index 1298fb1ca1..8adba7b49a 100644 --- a/containers/python-3/.vscode/launch.json +++ b/containers/python-3/.vscode/launch.json @@ -5,10 +5,10 @@ "version": "0.2.0", "configurations": [ { - "name": "Python: Current File (Integrated Terminal)", + "name": "Python (Integrated Terminal)", "type": "python", "request": "launch", - "program": "${file}", + "program": "${workspaceFolder}/test-project/hello.py", "console": "integratedTerminal" } ] diff --git a/containers/python-3/README.md b/containers/python-3/README.md index 496cb15e01..0ee0a9f7ce 100644 --- a/containers/python-3/README.md +++ b/containers/python-3/README.md @@ -6,20 +6,50 @@ | Metadata | Value | |----------|-------| -| *Contributors* | The VS Code Team | +| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | | *Languages, platforms* | Python | -## Usage +## Using this definition with an existing folder -[See here for information on using this definition with an existing project](https://aka.ms/vscode-remote/containers/getting-started/open). +For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that 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. -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. +```json +"console": "integratedTerminal" +``` -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. You can then start the test program from Debug panel in VS Code. +Beyond that, just follow these steps: + +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. + +2. To use VS Code's copy of this definition: + 1. Start VS Code and open your project folder. + 2. Press F1 select and **Remote-Containers: Create Container Configuration File...** from the command palette. + 3. Select the Python 2 definition. + +3. To use latest-and-greatest copy of this definition from the repository: + 1. Clone this repository. + 2. Copy the contents of `containers/python-2/.devcontainer` to the root of your project folder. + 3. Start VS Code and open your project folder. + +4. After following step 2 or 3, the contents of the `.devcontainer` folder in your project can be adapted to meet your needs. + +5. Finally, press F1 and run **Remote-Containers: Reopen Folder in Container** to start using the definition. + +## Testing the definition + +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: + +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. +2. Clone this repository. +3. Start VS Code, press F1, and select **Remote-Containers: Open Folder in Container...** +4. Select the `containers/python-2` folder. +5. After the folder has opened in the container, press F5 to start the project. +6. You should see "Hello, remote world!" in a terminal window after the program executes. +7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. ## License Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE). +Licensed under the MIT License. See [LICENSE](https://github.com/Microsoft/vscode-dev-containers/blob/master/LICENSE)