-
-
Notifications
You must be signed in to change notification settings - Fork 714
devcontainer: Base python 3.10.2 devcontainer #2880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| ARG PYTHON_VERSION="3.10" | ||
| FROM python:${PYTHON_VERSION}-slim | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get upgrade -y \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| ca-certificates \ | ||
| coreutils \ | ||
| curl \ | ||
| dialog \ | ||
| dirmngr \ | ||
| gcc \ | ||
| git \ | ||
| gnupg2 \ | ||
| iproute2 \ | ||
| libssl1.1 \ | ||
| libxml2-dev \ | ||
| libxslt-dev \ | ||
| openssh-client \ | ||
| procps \ | ||
| psmisc \ | ||
| rsync \ | ||
| sudo \ | ||
| unzip \ | ||
| wget \ | ||
| zip \ | ||
| zlib1g \ | ||
| libz-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install common python tools for development | ||
| RUN pip install \ | ||
| autopep8 \ | ||
| black \ | ||
| flake8 \ | ||
| mypy \ | ||
| poetry \ | ||
| pre-commit \ | ||
| pylint | ||
|
|
||
| ARG USERNAME=vscode | ||
| ARG USER_ID=1000 | ||
| ARG USER_GID=$USER_ID | ||
|
|
||
| # Run with non privileged user | ||
| RUN groupadd --gid $USER_GID $USERNAME \ | ||
| && useradd \ | ||
| --uid $USER_ID \ | ||
| --gid $USER_GID \ | ||
| --shell /bin/bash \ | ||
| --create-home $USERNAME | ||
|
|
||
| # sudo support | ||
| RUN echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \ | ||
| && chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
|
||
| ENV CONFIGURE_SUPPORTED_PYTHON=${PYTHON_VERSION} | ||
|
|
||
| USER $USERNAME | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: | ||
| // https://github.com/microsoft/vscode-dev-containers/tree/v0.112.0/containers/python-3 | ||
| { | ||
| "name": "ScanCode-Toolkit", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| }, | ||
| "settings": { | ||
| "puppet.installType": "pdk", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is puppet part of the environment? |
||
| "python.pythonPath": "/usr/local/bin/python", | ||
| "python.languageServer": "Pylance", | ||
| "python.linting.enabled": true, | ||
| "python.formatting.provider": "black", | ||
| "python.unitTest.pyTestEnabled": true, | ||
| "editor.formatOnSave": true, | ||
| }, | ||
| // Add the IDs of extensions you want installed when the container is created. | ||
| "extensions": [ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these specific to a developer's local setup? |
||
| "ms-python.python", | ||
| "ms-python.vscode-pylance", | ||
| "shardulm94.trailing-spaces", | ||
| "formulahendry.code-runner", | ||
| "aaron-bond.better-comments", | ||
| "eamodio.gitlens", | ||
| "wholroyd.jinja", | ||
| // "xdebug.php-pack", | ||
| // "puppet.puppet-vscode", | ||
| ], | ||
| // "postCreateCommand": "./configure --dev", | ||
| "postStartCommand": "pip install -r requirements.txt -r requirements-dev.txt" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may not be the best command. We use these only as constraints and no longer as plain requirements. See https://github.com/nexB/scancode-toolkit/blob/1dc4b61c89ea6b66d9ff6d596c159633ce757d92/configure#L28 So IMHO running |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need all of these? The minimal set of development tools in use are otherwise included in the [tests]extra and installed with
./configure --devThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do if we are still relying on PIP as considering some packages will need to handle python wheel buildings.
As i heard you are working on an pip-less env, maybe this is not needed anymore