From 7f2fe243f5c202e5697c5c488e17d2e6dc639877 Mon Sep 17 00:00:00 2001 From: Vlad Korolev Date: Mon, 2 Sep 2024 13:21:07 -0400 Subject: [PATCH] Devcontainer and CodeSpace --- .devcontainer/devcontainer.json | 50 +++++++++++++++++++ .devcontainer/env_setup.sh | 14 ++++++ .pre-commit-config.yaml | 1 + .run/pytest.run.xml | 21 ++++++++ .vscode/launch.json | 12 +++++ .vscode/settings.json | 8 +++ CODESPACES.md | 29 +++++++++++ images/vscode_extension_attention_needed.png | Bin 0 -> 4313 bytes images/vscode_extension_wait.png | Bin 0 -> 4341 bytes src/greenbutton_objects/py.typed | 0 10 files changed, 135 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/env_setup.sh create mode 100644 .run/pytest.run.xml create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 CODESPACES.md create mode 100644 images/vscode_extension_attention_needed.png create mode 100644 images/vscode_extension_wait.png create mode 100644 src/greenbutton_objects/py.typed 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 0000000000000000000000000000000000000000..5475b99ae1da39e3569682ca9bf7009985f432df GIT binary patch literal 4313 zcmZ`*2{@GP*B>K77-W|)lzj}cj4fLjSteU{27`$)j1eN)*Fkn7CK8eCBx?v|=gn3` zA+jcW;y>#B-rno`f8X<5_jAs3&iS3+ea^YB=Xzog2HJEqoHPIcfDW#sX+)BIr;Cb` z^t?IWjs*Z{n$Q{=2)Kp@F9L^kM!TZ`0G*h$jI$=jldO@0&C7g`E@>(}l3NxJP8}i_ z(mBh;N6nYYVC2dwMw>8ej$nKxmCp~RNuao2$(uhxNp`K0zK2L8gi(l@&rq-;ooDWB zl+}+btOQO@x@=T$D13Q-0#ucCh|^rIkOFY1Ka~d$MO|deQ|+cBQyK!EnWblUPtfe7 z1%W7{`}^+Ie`^Fh$iZ6aFCOlloRmKG^k0YnDMNSM*E zz#dqSg`Z2)&nfx9n2_72q5r`7tBIaTxJ0`%U>5FPmk9#AVf;2)4GRui~9FLj35S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P7wLfY!7GEor$ql;zxRpqL;qp& z@cz3jQh^eu9tlYZRO0`F;nB|j5A4+Q8}_TN-*if+$rKQ1Ka{(LCK^NPDrsvfS71uN zSpLiLXP>`;rrs!=1{OoY;Z^=j8)OsNS__}<@FuUPGEz}=dDwP(V`Yu!62y=52@Q>%HQ zatVuMukVf<4Re{rHAJvm3Dn6N6I2bc4D?YNa&HWrxjtsJI=K32jvMG&3D86U&wXH1 zqA4turc_jtk4$PQfb->FAI*0JjGp>1pYuniL+s>~bmLdVMPkzYm}B;NI`*@< z;Iy>45xwFbQXK$bfo>?(nL~A|$U_Q*y;l$`7fq5a#Z5z)pE7c1T>yP^Nu+m?+(JAG z8XNNJ%Le7nn~Vq;IWq$-k95s@@bF*r4x`XCYqrbZ{FIiKwyD>gDz1eB85kSmZ)Klh zJ5M5cI#U~p&LWlBQL-AhR}yIH(6p<4JfI@7)7s3xk~7`f)@%# zg$h;NYE*?A->NM4DAw#55?z)I=pva-1#UAlHCUUm>F8Rdv&Xp07C3yc!VVz_C9T)a zfsGEc)%{j&=^n>ws!r1NN177l9`CkIjc7dHQza(LWLN_aT=SwAkk^z|eT&lgTgV93 z58Ef=**1AvpUFt`Y%RQ&qQ0eGCZ7}k0v|vb)oAc)VXd>_O}DGZIXC395dT6H(>AMX zVS`L`*}l?@q5kY>HQaffD&ZD#mF`oTsq!nXzOl6N``rs8jD5r0V|NR@Hr@V5kCccJo*?A%4u0NcI9tHqq3zormRD73n9&9rXUIi@WhMU^eN2DX>2YF_8vmzV|T7{aQF3#Kf7 lv#I|!Y~S8&{A_6Fy{I;p4?0I)cTT^p@M{K|&(-Zi{{!+trTzc_ literal 0 HcmV?d00001 diff --git a/images/vscode_extension_wait.png b/images/vscode_extension_wait.png new file mode 100644 index 0000000000000000000000000000000000000000..7557968193a3b2ec9ab3df9aa52e37f698db4a25 GIT binary patch literal 4341 zcmZ`*2{@GP*B?Yf!ywy)j8R!)2w`m5B4v=Ru^S8~!;CRPA^SSnl`UD4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