diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev index 94e028bc..7c3a5f28 100644 --- a/.devcontainer/Dockerfile.dev +++ b/.devcontainer/Dockerfile.dev @@ -1,30 +1,21 @@ -ARG VARIANT="3.10" +ARG VARIANT="3.11" -FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} as builder +FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} SHELL ["/bin/bash", "-o", "pipefail", "-c"] WORKDIR /workspaces -COPY Pipfile ./ - -# Create Python requirements files from pipenv (lockfile) -RUN pip3 install -U pip \ - && pip3 install pipenv \ - && pipenv lock \ - && pipenv requirements > /tmp/requirements.txt \ - && pipenv requirements --dev > /tmp/requirements_dev.txt - -FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} - -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 pdbpp \ - && pip3 install -r /tmp/requirements_dev.txt \ - && rm -rf /tmp/requirements.txt /tmp/requirements_dev.txt pyatmo/ + && pip3 install pre-commit \ + && pip3 install time-machine \ + && pip3 install pytest-cov + +# 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" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7600a374..8edc1d4d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,18 @@ { "name": "pyatmo Dev", - "context": "..", + "context": ".", "dockerFile": "./Dockerfile.dev", "containerEnv": { "DEVCONTAINER": "1" }, - "postCreateCommand": "pip3 install -e . && pre-commit run flake8", + "postCreateCommand": "pip3 install -e . && pre-commit run ruff", "runArgs": [ "-e", "GIT_EDITOR=code --wait" ], "extensions": [ "ms-python.vscode-pylance", - "visualstudioexptteam.vscodeintellicode", + "visualstudioexptteam.vscodeintellicode" ], "settings": { "python.pythonPath": "/usr/local/bin/python", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d201ad09..b4e87edf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ # 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: @@ -27,7 +27,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 diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0ee98b98..566b5a6b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -19,21 +19,6 @@ }, "problemMatcher": [] }, - { - "label": "Flake8", - "detail": "Run flake8 style checker", - "type": "shell", - "command": "pre-commit run flake8 --all-files", - "group": { - "kind": "test", - "isDefault": true - }, - "presentation": { - "reveal": "always", - "panel": "new" - }, - "problemMatcher": [] - }, { "label": "Pylint", "detail": "Run pylint code analysis",