From 7d65694752d345bc479f93779a4e644ec9f11abd Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 11:25:20 +0000 Subject: [PATCH 1/3] code --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/dependabot-post-update.yaml | 4 ++-- .github/workflows/hash_git_files.py | 4 +++- template/.github/workflows/dependabot-post-update.yaml | 4 ++-- template/.github/workflows/hash_git_files.py | 4 +++- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 4b9bf49c..900e9bca 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.37 +_commit: v0.0.37-1-g18bfaf5 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 94438a6e..b1f9fee8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -59,5 +59,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 53debcd8 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): d80b1dad # spellchecker:disable-line } diff --git a/.github/workflows/dependabot-post-update.yaml b/.github/workflows/dependabot-post-update.yaml index 620cbb11..fa4b163d 100644 --- a/.github/workflows/dependabot-post-update.yaml +++ b/.github/workflows/dependabot-post-update.yaml @@ -10,7 +10,7 @@ on: jobs: post-update: if: ${{ github.actor == 'dependabot[bot]' }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -24,7 +24,7 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Update devcontainer hash - run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update + run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero - name: Commit & push changes run: | diff --git a/.github/workflows/hash_git_files.py b/.github/workflows/hash_git_files.py index f8bcf65e..259f1d96 100644 --- a/.github/workflows/hash_git_files.py +++ b/.github/workflows/hash_git_files.py @@ -138,6 +138,7 @@ def main(): action="store_true", help="Update the hash in the devcontainer.json file based on all files relevant to devcontainer context", ) + _ = parser.add_argument("--exit-zero", action="store_true", help="Exit with code 0 even if the hash changes") args = parser.parse_args() repo_path = args.folder @@ -170,7 +171,8 @@ def main(): print( # noqa: T201 f"Updated {devcontainer_json_file} with the new hash: {overall_checksum_str}" ) - sys.exit(1) # Exit with non-zero code to indicate changes were made + if not args.exit_zero: + sys.exit(1) # Exit with non-zero code to indicate changes were made else: print(overall_checksum_str) # noqa: T201 # print this so that the value can be picked up via STDOUT when calling this in a CI pipeline or as a subprocess diff --git a/template/.github/workflows/dependabot-post-update.yaml b/template/.github/workflows/dependabot-post-update.yaml index 620cbb11..fa4b163d 100644 --- a/template/.github/workflows/dependabot-post-update.yaml +++ b/template/.github/workflows/dependabot-post-update.yaml @@ -10,7 +10,7 @@ on: jobs: post-update: if: ${{ github.actor == 'dependabot[bot]' }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -24,7 +24,7 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" - name: Update devcontainer hash - run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update + run: python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update --exit-zero - name: Commit & push changes run: | diff --git a/template/.github/workflows/hash_git_files.py b/template/.github/workflows/hash_git_files.py index f8bcf65e..259f1d96 100644 --- a/template/.github/workflows/hash_git_files.py +++ b/template/.github/workflows/hash_git_files.py @@ -138,6 +138,7 @@ def main(): action="store_true", help="Update the hash in the devcontainer.json file based on all files relevant to devcontainer context", ) + _ = parser.add_argument("--exit-zero", action="store_true", help="Exit with code 0 even if the hash changes") args = parser.parse_args() repo_path = args.folder @@ -170,7 +171,8 @@ def main(): print( # noqa: T201 f"Updated {devcontainer_json_file} with the new hash: {overall_checksum_str}" ) - sys.exit(1) # Exit with non-zero code to indicate changes were made + if not args.exit_zero: + sys.exit(1) # Exit with non-zero code to indicate changes were made else: print(overall_checksum_str) # noqa: T201 # print this so that the value can be picked up via STDOUT when calling this in a CI pipeline or as a subprocess From 39495bc976d4041180d47bc778f643cc984ba344 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 11:31:41 +0000 Subject: [PATCH 2/3] copier --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/hash_git_files.py | 7 +++++-- template/.github/workflows/hash_git_files.py | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 900e9bca..e14d0a84 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.37-1-g18bfaf5 +_commit: v0.0.37-4-g7e6abca _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b1f9fee8..cd69b010 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -59,5 +59,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): d80b1dad # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 5e3a0577 # spellchecker:disable-line } diff --git a/.github/workflows/hash_git_files.py b/.github/workflows/hash_git_files.py index 259f1d96..1da0a3f7 100644 --- a/.github/workflows/hash_git_files.py +++ b/.github/workflows/hash_git_files.py @@ -171,8 +171,11 @@ def main(): print( # noqa: T201 f"Updated {devcontainer_json_file} with the new hash: {overall_checksum_str}" ) - if not args.exit_zero: - sys.exit(1) # Exit with non-zero code to indicate changes were made + if args.exit_zero: + sys.exit(0) + else: + sys.exit(1) + else: print(overall_checksum_str) # noqa: T201 # print this so that the value can be picked up via STDOUT when calling this in a CI pipeline or as a subprocess diff --git a/template/.github/workflows/hash_git_files.py b/template/.github/workflows/hash_git_files.py index 259f1d96..1da0a3f7 100644 --- a/template/.github/workflows/hash_git_files.py +++ b/template/.github/workflows/hash_git_files.py @@ -171,8 +171,11 @@ def main(): print( # noqa: T201 f"Updated {devcontainer_json_file} with the new hash: {overall_checksum_str}" ) - if not args.exit_zero: - sys.exit(1) # Exit with non-zero code to indicate changes were made + if args.exit_zero: + sys.exit(0) + else: + sys.exit(1) + else: print(overall_checksum_str) # noqa: T201 # print this so that the value can be picked up via STDOUT when calling this in a CI pipeline or as a subprocess From a7d60bfa5b2b4bbf0fd829876ecee02b54786c29 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 11:36:04 +0000 Subject: [PATCH 3/3] tag --- .copier-answers.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index e14d0a84..24f34d32 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.37-4-g7e6abca +_commit: v0.0.38 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: