From 2b60d3dffaa5d1b9e226463b381ced62fef1decf Mon Sep 17 00:00:00 2001 From: Takayuki SHIMIZUKAWA Date: Sun, 26 May 2024 07:28:30 +0000 Subject: [PATCH 1/3] add devcontainer and related dependabot config --- .devcontainer/devcontainer.json | 42 ++++++++++++++++++++++++++++++ .devcontainer/on_create_command.sh | 9 +++++++ .github/dependabot.yml | 14 ++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/on_create_command.sh create mode 100644 .github/dependabot.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..406e984 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/git:1": "latest", + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers-contrib/features/act:1": {}, + "ghcr.io/devcontainers-contrib/features/ruff:1": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", + + "onCreateCommand": "bash .devcontainer/on_create_command.sh", + + // Configure tool-specific properties. + // "customizations": {}, + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "charliermarsh.ruff" + ], + // Set *default* container specific settings.json values on container create. + "settings": { + "ruff.path": ["/usr/local/py-utils/bin/ruff"] + } + } + }, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/on_create_command.sh b/.devcontainer/on_create_command.sh new file mode 100755 index 0000000..0193e48 --- /dev/null +++ b/.devcontainer/on_create_command.sh @@ -0,0 +1,9 @@ +# setup + +sudo pip install -U pip setuptools wheel setuptools_scm +sudo pip install -r requirements-dev.txt + +# Install Transifex CLI tool +# refer to Installation instructions https://github.com/transifex/cli#installation + +(cd `mktemp -d` && curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash && sudo mv ./tx /usr/local/bin ) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1478bd4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" From 4a10023c3059c0d23f37891a17a9c062cdfdeb3c Mon Sep 17 00:00:00 2001 From: Takayuki SHIMIZUKAWA Date: Sun, 26 May 2024 17:50:54 +0900 Subject: [PATCH 2/3] dependabot interval for gha monthly --- .github/dependabot.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1478bd4..9f4ccf3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,14 +1,17 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - - package-ecosystem: "devcontainers" - directory: "/" - schedule: - interval: weekly - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" - - package-ecosystem: "pip" + interval: "monthly" + groups: + # Name for the group, which will be used in PR titles and branch names + all-github-actions: + # Group all updates together + patterns: + - "*" + - package-ecosystem: "devcontainers" directory: "/" schedule: - interval: "daily" + interval: "monthly" From 76792323ae7bedc92e784fb77bf1b65293a276ef Mon Sep 17 00:00:00 2001 From: Takayuki SHIMIZUKAWA Date: Sat, 1 Jun 2024 07:22:32 +0000 Subject: [PATCH 3/3] devcontainer uses OS Python --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 406e984..de03baf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers/features/git:1": "latest", "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/python:1": "none", "ghcr.io/devcontainers-contrib/features/act:1": {}, "ghcr.io/devcontainers-contrib/features/ruff:1": {} },