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

Fix devcontainer #516

Merged
merged 7 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
15 changes: 11 additions & 4 deletions .devcontainer/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ARG VARIANT="3.10"
ARG VARIANT="3.11"

FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} as builder

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

WORKDIR /workspaces

COPY Pipfile ./
COPY Pipfile* ./
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line could be remove as pyatmo no longer use pipenv

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I also suppress all pipenv related lines


# Create Python requirements files from pipenv (lockfile)
RUN pip3 install -U pip \
Expand All @@ -21,10 +21,17 @@ COPY --from=builder /tmp/requirements.txt /tmp/
COPY --from=builder /tmp/requirements_dev.txt /tmp/

# Install Python dependencies from requirements
RUN pip3 install -r /tmp/requirements.txt \
RUN pip3 install --upgrade pip \
&& pip3 install -r /tmp/requirements.txt \
&& pip3 install pdbpp \
&& pip3 install -r /tmp/requirements_dev.txt \
&& pip3 install pre-commit \
&& pip3 install time-machine \
&& rm -rf /tmp/requirements.txt /tmp/requirements_dev.txt pyatmo/

# Remove any old pytest versions that might conflict
RUN python3 -m pip install --upgrade --force-reinstall pytest \
&& rm -rf /usr/local/py-utils/venvs/pytest/bin/pytest

# Set the default shell to bash instead of sh
ENV SHELL /bin/bash
ENV SHELL="/bin/bash"
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pyatmo Dev",
"context": "..",
"context": ".",
"dockerFile": "./Dockerfile.dev",
"containerEnv": {
"DEVCONTAINER": "1"
Expand All @@ -12,7 +12,7 @@
],
"extensions": [
"ms-python.vscode-pylance",
"visualstudioexptteam.vscodeintellicode",
"visualstudioexptteam.vscodeintellicode"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Note: don't use this config for your own repositories. Instead, see
# "Version control integration" in README.md.
default_stages: [commit, push]
default_stages: [pre-commit, pre-push]
exclude: ^(fixtures/)

repos:
- repo: https://github.com/pycqa/flake8
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pyatmo has switched to ruff for style guide enforcement, so there is no need to reintroduce flake8.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. I supressed it also in postCreateCommand of devcontainer

rev: 6.1.0
hooks:
- id: flake8

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
hooks:
Expand All @@ -27,7 +32,7 @@ repos:
- types-requests

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # Use the ref you want to point at
rev: v5.0.0 # Use the ref you want to point at
hooks:
- id: check-ast
- id: no-commit-to-branch
Expand Down