Skip to content

Commit a2a1c13

Browse files
author
Bastien Gautier
committed
🐛 Fix issue related to permissions
1 parent feb8090 commit a2a1c13

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.devcontainer/Dockerfile

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# See here for image contents:
2-
ARG VARIANT="3.11-bullseye"
2+
ARG VARIANT="3.10-bullseye"
33
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
44

55
WORKDIR /workspaces/app
@@ -18,20 +18,3 @@ RUN rm -rvf /tmp/config_container
1818
# Create virtual environment:
1919

2020
VOLUME $WORKSPACE_FOLDER/.venv
21-
22-
ENV VIRTUAL_ENV=$WORKSPACE_FOLDER/.venv
23-
RUN python3 -m venv $VIRTUAL_ENV
24-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
25-
26-
# Install python dependencies:
27-
28-
RUN mkdir /tmp/config_container
29-
30-
COPY /requirements-dev.txt /tmp/config_container/requirements-dev.txt
31-
COPY /requirements.txt /tmp/config_container/requirements-all.txt
32-
33-
RUN pip install --upgrade pip
34-
RUN pip install -r /tmp/config_container/requirements-dev.txt
35-
RUN pip install -r /tmp/config_container/requirements-all.txt
36-
37-
RUN rm -rvf /tmp/config_container

.devcontainer/devcontainer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
1212
// Append -bullseye or -buster to pin to an OS version.
1313
// Use -bullseye variants on local on arm64/Apple Silicon.
14-
"VARIANT": "3.11-bullseye",
14+
"VARIANT": "3.10-bullseye",
1515
// Options
1616
"NODE_VERSION": "lts/*"
1717
}
@@ -30,7 +30,7 @@
3030
// Use 'forwardPorts' to make a list of ports inside the container available locally.
3131
// "forwardPorts": [],
3232
// Use 'postCreateCommand' to run commands after the container is created.
33-
// "postCreateCommand": "pip3 install --user -r requirements.txt",
33+
"postCreateCommand": "sudo chmod +x /workspaces/app/.devcontainer/install.sh && /workspaces/app/.devcontainer/install.sh",
3434
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
3535
"remoteUser": "vscode"
3636
}

.devcontainer/install.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
sudo chgrp vscode /workspaces/app/.venv
4+
sudo chown vscode /workspaces/app/.venv
5+
6+
git config --global --add safe.directory /workspaces/app/
7+
git config --global core.autocrlf true
8+
9+
python3 -m venv /workspaces/app/.venv
10+
PATH="/workspaces/app/.venv/bin:$PATH"
11+
12+
source /workspaces/app/.venv/bin/activate
13+
pip install --upgrade pip
14+
15+
# pip install keyring artifacts-keyring
16+
17+
# cat <<EOF >> /workspaces/app/.venv/pip.conf
18+
# [global]
19+
# extra-index-url=https://pkgs.dev.azure.com/...
20+
# EOF
21+
22+
pip install -r /workspaces/app/requirements-dev.txt
23+
pip install -r /workspaces/app/requirements.txt

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"debug.internalConsoleOptions": "neverOpen",
33
"python.terminal.activateEnvironment": true,
44
"python.defaultInterpreterPath": "/workspaces/app/.venv/bin/python",
5-
"python.linting.pylamaEnabled": false,
5+
"python.linting.pylamaEnabled": true,
66
"python.linting.pylamaPath": "/workspaces/app/.venv/bin/pylama",
7-
"python.linting.mypyEnabled": false,
7+
"python.linting.mypyEnabled": true,
88
"python.linting.mypyArgs": [],
99
"python.linting.mypyPath": "/workspaces/app/.venv/bin/mypy",
1010
"python.linting.pylintEnabled": true,

pylama.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pylama:pycodestyle]
2+
max_line_length = 120

0 commit comments

Comments
 (0)