diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..7dba12f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,50 @@ +{ + "name": "Plain Python 3.11", + "image": "mcr.microsoft.com/devcontainers/python:3.11", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "configureZshAsDefaultShell": "true" + }, + "ghcr.io/nils-geistmann/devcontainers-features/zsh:0": { + "theme": "robbyrussell", + "plugins": "git", + "setLocale": false, + "desiredLocale": "en_US.UTF-8" + }, + "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": { + "jqVersion": "latest", + "yqVersion": "latest", + "gojqVersion": "latest", + "xqVersion": "latest" + } + }, + "customizations": { + "codespaces": { + "openFiles": [ + "CODESPACES.md" + ] + }, + "vscode": { + "extensions": [ + "ms-python.python@2024.1.10401008", + "ms-vscode-remote.remote-containers@0.342.0", + "tamasfe.even-better-toml@0.19.2", + "eamodio.gitlens@14.8.2", + "MS-vsliveshare.vsliveshare@1.0.5905", + "ms-python.mypy-type-checker@2023.9.12421015", + "ms-python.debugpy@2024.6.0", + "github.copilot@1.172.0", + "github.copilot-chat@0.13.0" + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "zsh", + "terminal.integrated.profiles.linux": { + "zsh": { + "path": "/usr/bin/zsh" + } + } + } + } + }, + "updateContentCommand": ".devcontainer/env_setup.sh" +} diff --git a/.devcontainer/env_setup.sh b/.devcontainer/env_setup.sh new file mode 100755 index 0000000..d712c4f --- /dev/null +++ b/.devcontainer/env_setup.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +sudo apt update +sudo apt install -y python3-ament-xmllint + +pipx install pre-commit + +pre-commit install || true + +python -m pip install --upgrade pip +python -m pip install '.[dev]' +python -m pip install -e . + +pre-commit run -a || true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cadab31..9d9620f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,6 +40,7 @@ repos: rev: v1.0.0 hooks: - id: format-xmllint + exclude: .run/ - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 diff --git a/.run/pytest.run.xml b/.run/pytest.run.xml new file mode 100644 index 0000000..22fcf6c --- /dev/null +++ b/.run/pytest.run.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2cf8189 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Module", + "type": "debugpy", + "request": "launch", + "module": "pytest", + "justMyCode": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0dde9ed --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "mypy-type-checker.ignorePatterns": ["*/tests/*"] +} diff --git a/CODESPACES.md b/CODESPACES.md new file mode 100644 index 0000000..dcd0751 --- /dev/null +++ b/CODESPACES.md @@ -0,0 +1,29 @@ +# Developing in Codespaces / DevContainer + +Looks like you have opened this project in GitHub Codespaces or a Dev Container. +Here are some important things you should be aware of: + +1. **Ready Environment & Auto-Configuration**: The environment is pre-configured + there is no need for any manual setup. Newly created codespaces will + automatically run initialization tasks. If you see a message like the one below + wait for the setup completion before running tests or making commits. + + ``` + Finishing up + Running postStartCommand + .devcontainer/post_start.sh + ``` + +2. **Pre-configured VS Code Extensions**: This setup pre-installs some VSCode + extensions for you, but some may need a window refresh to activate. If your + sidebar extensions icon looking like the one below, click on it to check the + messages: + + ![Extensions loading](images/vscode_extension_attention_needed.png) + ![Extensions wait](images/vscode_extension_wait.png) + +3. **GitHub Copilot**: We've included this, but remember it requires a + subscription. If you're not a subscriber, you can safely ignore any error + messages related to Copilot. + +If you encounter any issues or need help, please reach out to the project maintainers. diff --git a/images/vscode_extension_attention_needed.png b/images/vscode_extension_attention_needed.png new file mode 100644 index 0000000..5475b99 Binary files /dev/null and b/images/vscode_extension_attention_needed.png differ diff --git a/images/vscode_extension_wait.png b/images/vscode_extension_wait.png new file mode 100644 index 0000000..7557968 Binary files /dev/null and b/images/vscode_extension_wait.png differ diff --git a/src/greenbutton_objects/py.typed b/src/greenbutton_objects/py.typed new file mode 100644 index 0000000..e69de29