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

Commit ae361c0

Browse files
authored
Merge pull request #113 from brettcannon/python-updates
Python updates
2 parents 67f1f40 + 3058f46 commit ae361c0

File tree

15 files changed

+51
-41
lines changed

15 files changed

+51
-41
lines changed

containers/python-2/.devcontainer/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ ARG USERNAME=vscode
1616
ARG USER_UID=1000
1717
ARG USER_GID=$USER_UID
1818

19-
# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
20-
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
21-
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/
19+
# Uncomment the following COPY line and the corresponding lines in the `RUN` command if you wish to
20+
# include your requirements in the image itself. It is suggested that you only do this if your
21+
# requirements rarely (if ever) change.
22+
# COPY requirements.txt /tmp/pip-tmp/
2223

2324
# Configure apt and install packages
2425
RUN apt-get update \
@@ -28,11 +29,11 @@ RUN apt-get update \
2829
&& apt-get -y install git procps lsb-release \
2930
#
3031
# Install pylint
31-
&& pip install pylint \
32+
&& pip --disable-pip-version-check --no-cache-dir install pylint \
3233
#
33-
# Update Python environment based on requirements.txt (if presenet)
34-
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
35-
&& rm -rf /tmp/pip-tmp \
34+
# Update Python environment based on requirements.txt
35+
# && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
36+
# && rm -rf /tmp/pip-tmp \
3637
#
3738
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
3839
&& groupadd --gid $USER_GID $USERNAME \
@@ -48,4 +49,4 @@ RUN apt-get update \
4849
&& rm -rf /var/lib/apt/lists/*
4950

5051
# Switch back to dialog for any ad-hoc use of apt-get
51-
ENV DEBIAN_FRONTEND=
52+
ENV DEBIAN_FRONTEND=

containers/python-2/.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// "appPort": [],
88

99
// Uncomment the next line to run commands after the container is created.
10-
// "postCreateCommand": "java -version",
10+
// "postCreateCommand": "pip install -r requirements.txt",
1111

1212
// Uncomment the next line to use a non-root user. On Linux, this will prevent
1313
// new files getting created as root, but you may need to update the USER_UID
@@ -19,7 +19,8 @@
1919
],
2020
"settings": {
2121
"python.pythonPath": "/usr/local/bin/python",
22+
"python.linting.enabled": true,
2223
"python.linting.pylintEnabled": true,
23-
"python.linting.enabled": true
24+
"python.linting.pylintPath": "/usr/local/bin/pylint"
2425
}
2526
}

containers/python-2/.devcontainer/noop.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

containers/python-2/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
*Develop Python 2 applications. Installs dependencies from your requirements.txt file and the Python extension.*
66

7-
| Metadata | Value |
7+
| Metadata | Value |
88
|----------|-------|
99
| *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team |
1010
| *Definition type* | Dockerfile |
1111
| *Languages, platforms* | Python |
1212

1313
## Using this definition with an existing folder
1414

15-
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.
15+
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.
1616

1717
```json
1818
"console": "integratedTerminal"

containers/python-3-anaconda/.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Python 3 - Anaconda",
33
"context": "..",
44
"dockerFile": "Dockerfile",
5-
5+
66
// Uncomment the next line if you want to publish any ports.
77
// "appPort": [],
88

@@ -19,7 +19,8 @@
1919
],
2020
"settings": {
2121
"python.pythonPath": "/opt/conda/bin/python",
22+
"python.linting.enabled": true,
2223
"python.linting.pylintEnabled": true,
23-
"python.linting.enabled": true
24+
"python.linting.pylintPath": "/opt/conda/bin/pylint"
2425
}
25-
}
26+
}

containers/python-3-miniconda/.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
],
2020
"settings": {
2121
"python.pythonPath": "/opt/conda/bin/python",
22+
"python.linting.enabled": true,
2223
"python.linting.pylintEnabled": true,
23-
"python.linting.enabled": true
24+
"python.linting.pylintPath": "/opt/conda/bin/pylint"
2425
}
25-
}
26+
}

containers/python-3-postgres/.devcontainer/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ ARG USERNAME=vscode
1818
ARG USER_UID=1000
1919
ARG USER_GID=$USER_UID
2020

21-
# Copy requirements.txt (if found) to a temp locaition so we can install it. Also
22-
# copy "noop.txt" so the COPY instruction does not fail if no requirements.txt exists.
23-
COPY requirements.txt* .devcontainer/noop.txt /tmp/pip-tmp/
21+
# Uncomment the following COPY line and the corresponding lines in the `RUN` command if you wish to
22+
# include your requirements in the image itself. It is suggested that you only do this if your
23+
# requirements rarely (if ever) change.
24+
# COPY requirements.txt /tmp/pip-tmp/
2425

2526
# Configure apt and install packages
2627
RUN apt-get update \
@@ -32,9 +33,9 @@ RUN apt-get update \
3233
# Install pylint
3334
&& pip install pylint \
3435
#
35-
# Update Python environment based on requirements.txt (if presenet)
36-
&& if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip install -r /tmp/pip-tmp/requirements.txt; fi \
37-
&& rm -rf /tmp/pip-tmp \
36+
# Update Python environment based on requirements.txt
37+
# && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
38+
# && rm -rf /tmp/pip-tmp \
3839
#
3940
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
4041
&& groupadd --gid $USER_GID $USERNAME \

containers/python-3-postgres/.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
// "shutdownAction": "none",
1010

1111
// Uncomment the next line to run commands after the container is created.
12-
// "postCreateCommand": "python --version",
12+
// "postCreateCommand": "pip install -r requirements.txt",
1313

1414
"extensions": [
1515
"ms-python.python"
1616
],
1717
"settings": {
1818
"python.pythonPath": "/usr/local/bin/python",
19+
"python.linting.enabled": true,
1920
"python.linting.pylintEnabled": true,
20-
"python.linting.enabled": true
21+
"python.linting.pylintPath": "/usr/local/bin/pylint"
2122
}
22-
}
23+
}

containers/python-3-postgres/.devcontainer/noop.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

containers/python-3-postgres/.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"--noreload",
1717
"--nothreading"
1818
],
19-
"django": true
19+
"django": true,
20+
"preLaunchTask": "pip install"
2021
}
2122
]
22-
}
23+
}

0 commit comments

Comments
 (0)