Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from qubitron/master
Browse files Browse the repository at this point in the history
Updating Python dev container definitions
  • Loading branch information
Chuxel authored Apr 17, 2019
2 parents df25b4f + d1ffc8a commit 6f0f87e
Show file tree
Hide file tree
Showing 62 changed files with 239 additions and 272 deletions.
9 changes: 5 additions & 4 deletions containers/python-2/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
# Licensed under the MIT License. See LICENSE in the project root for license information.
#-----------------------------------------------------------------------------------------

FROM python:2-slim
FROM python:2

# Copy endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json

RUN pip install pylint

# Install git, process tools
RUN apt-get update && apt-get -y install git procps

# Install any missing dependencies for enhanced language service
RUN apt-get install -y libicu57
# Install Python dependencies from requirements.txt if it exists
COPY .devcontainer/requirements.txt.temp requirements.txt* /workspace/
RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt && rm requirements.txt*; fi

# Clean up
RUN apt-get autoremove -y \
Expand Down
4 changes: 3 additions & 1 deletion containers/python-2/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "Python 2",
"context": "..",
"dockerFile": "Dockerfile",
"workspaceFolder": "/workspace",
"extensions": [
"ms-python.python",
"LittleFoxTeam.vscode-python-test-adapter"
"VisualStudioExptTeam.vscodeintellicode"
]
}
2 changes: 1 addition & 1 deletion containers/python-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Summary

*A basic dev container definition for developing Python 2 applications in a container. Includes everything you need to get up and running like PyLint and the Python extension.*
*A basic dev container definition for developing Python 2 applications in a container. Installs dependencies from your requirements.txt file and the Python extension.*

| Metadata | Value |
|----------|-------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@
# Licensed under the MIT License. See LICENSE in the project root for license information.
#-----------------------------------------------------------------------------------------

FROM python:3
FROM continuumio/anaconda3

# Copy default endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json

# Install git, process tools
RUN apt-get update && apt-get -y install git procps

RUN mkdir /workspace
WORKDIR /workspace

# Install pylint, flask, redis
COPY requirements.txt /workspace/
RUN pip install -r requirements.txt && rm -f requirements.txt

# Install git
RUN apt-get update && apt-get -y install git

# Install any missing dependencies for enhanced language service
RUN apt-get install -y libicu[0-9][0-9]
# Install Python dependencies from requirements.txt if it exists
COPY .devcontainer/environment.yml.temp environment.yml* /workspace/
RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

11 changes: 11 additions & 0 deletions containers/python-3-anaconda/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Python 3 - Anaconda",
"context": "..",
"dockerFile": "Dockerfile",
"appPort": "5000:5000",
"workspaceFolder": "/workspace",
"extensions": [
"ms-python.python",
"VisualStudioExptTeam.vscodeintellicode"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/opt/conda/bin/python"
}
15 changes: 15 additions & 0 deletions containers/python-3-anaconda/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
3 changes: 3 additions & 0 deletions containers/python-3-anaconda/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/opt/conda/bin/python"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Python 3 & Django
# Python 3 - Anaconda

## Summary

*A basic dev container definition for building Django-based applications container. Includes everything you need to get up and running like Django, PyLint and the Python extension.*
*A basic dev container definition for developing Python 3 applications in an Anaconda container. Installs dependencies from your environment.yml file and the Python extension.*

| Metadata | Value |
|----------|-------|
Expand All @@ -16,7 +16,9 @@

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.

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.
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.

Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output.

## License

Expand Down
18 changes: 18 additions & 0 deletions containers/python-3-anaconda/test-project/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#%%
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)',
title='About as simple as it gets, folks')
ax.grid()

fig.savefig("test.png")
plt.show()
10 changes: 0 additions & 10 deletions containers/python-3-django/.devcontainer/devcontainer.json

This file was deleted.

2 changes: 0 additions & 2 deletions containers/python-3-django/.devcontainer/requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions containers/python-3-django/.devcontainer/settings.vscode.json

This file was deleted.

3 changes: 0 additions & 3 deletions containers/python-3-django/.vscode/settings.json

This file was deleted.

11 changes: 0 additions & 11 deletions containers/python-3-flask-redis/.devcontainer/devcontainer.json

This file was deleted.

18 changes: 0 additions & 18 deletions containers/python-3-flask-redis/.devcontainer/docker-compose.yml

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions containers/python-3-flask-redis/.vscode/launch.json

This file was deleted.

5 changes: 0 additions & 5 deletions containers/python-3-flask-redis/test-project/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions containers/python-3-flask-redis/test-project/app.py

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions containers/python-3-flask-redis/test-project/requirements.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions containers/python-3-jupyter-pyspark/.vscode/settings.json

This file was deleted.

32 changes: 0 additions & 32 deletions containers/python-3-jupyter-pyspark/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions containers/python-3-jupyter-pyspark/test-project/notebook.py

This file was deleted.

Loading

0 comments on commit 6f0f87e

Please sign in to comment.