Skip to content
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

Add devcontainer configuration #632

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/devcontainers/python:3

RUN python -m pip install --upgrade pip \
&& python -m pip install pytest pytest-cov \
&& python -m pip install 'flit>=3.8.0'

ENV FLIT_ROOT_INSTALL=1

COPY pyproject.toml README.rst ./
RUN mkdir -p flit \
&& python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml README.rst flit

// ENV FLIT_ALLOW_INVALID=1

// COPY pyproject.toml .
// RUN python -m flit install --only-deps --deps develop \
// && rm -r pyproject.toml
Comment on lines +5 to +18
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
&& python -m pip install 'flit>=3.8.0'
ENV FLIT_ROOT_INSTALL=1
COPY pyproject.toml README.rst ./
RUN mkdir -p flit \
&& python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml README.rst flit
// ENV FLIT_ALLOW_INVALID=1
// COPY pyproject.toml .
// RUN python -m flit install --only-deps --deps develop \
// && rm -r pyproject.toml
&& python -m pip install 'flit>=3.8.1'
ENV FLIT_ROOT_INSTALL=1
ENV FLIT_ALLOW_INVALID=1
COPY pyproject.toml .
RUN python -m flit install --only-deps --deps develop \
&& rm -r pyproject.toml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after this PR is completed, we can update the docker file.
#631

31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
{
"name": "Python Environment",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig",
"github.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.flake8",
"ms-vsliveshare.vsliveshare",
"ryanluker.vscode-coverage-gutters",
"bungcip.better-toml",
"GitHub.copilot"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
]
}
}
}
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"files.autoSave": "onFocusChange",
"git.autofetch": true,
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.formatting.provider": "autopep8",
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"flake8.args": [
"--config=.flake8"
],
"flake8.path": [
"/usr/local/py-utils/bin/flake8"
]
}