From 652448adb25b47fcdd6e359448709cfdd5383201 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 2 Aug 2025 18:18:10 +0000 Subject: [PATCH 1/2] copier --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .devcontainer/install-ci-tooling.py | 10 +++--- .devcontainer/manual-setup-deps.py | 4 +-- .github/workflows/pre-commit.yaml | 2 +- README.md | 3 +- copier.yml | 4 +-- extensions/context.py | 36 ++++++++++--------- pyproject.toml | 6 ++-- ruff.toml | 1 + .../.devcontainer/install-ci-tooling.py.jinja | 4 +-- template/.devcontainer/manual-setup-deps.py | 4 +-- template/.github/workflows/pre-commit.yaml | 2 +- template/ruff.toml | 1 + uv.lock | 22 ++++++------ 15 files changed, 54 insertions(+), 49 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 8d4e3ba8..facfe1e9 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.57 +_commit: v0.0.60 _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 94466237..e0fdfc53 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -61,5 +61,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): 01ec0f62 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 2b781a57 # spellchecker:disable-line } diff --git a/.devcontainer/install-ci-tooling.py b/.devcontainer/install-ci-tooling.py index 1e96d67c..fc427100 100644 --- a/.devcontainer/install-ci-tooling.py +++ b/.devcontainer/install-ci-tooling.py @@ -7,10 +7,10 @@ import tempfile from pathlib import Path -UV_VERSION = "0.7.12" -PNPM_VERSION = "10.13.1" -COPIER_VERSION = "9.7.1" -COPIER_TEMPLATES_EXTENSION_VERSION = "0.3.1" +UV_VERSION = "0.8.3" +PNPM_VERSION = "10.14.0" +COPIER_VERSION = "9.8.0" +COPIER_TEMPLATE_EXTENSIONS_VERSION = "0.3.2" PRE_COMMIT_VERSION = "4.2.0" GITHUB_WINDOWS_RUNNER_BIN_PATH = r"C:\Users\runneradmin\.local\bin" INSTALL_SSM_PLUGIN_BY_DEFAULT = False @@ -78,7 +78,7 @@ def main(): "install", f"copier=={COPIER_VERSION}", "--with", - f"copier-templates-extensions=={COPIER_TEMPLATES_EXTENSION_VERSION}", + f"copier-template-extensions=={COPIER_TEMPLATE_EXTENSIONS_VERSION}", ], check=True, env=uv_env, diff --git a/.devcontainer/manual-setup-deps.py b/.devcontainer/manual-setup-deps.py index 415796f3..722ef422 100644 --- a/.devcontainer/manual-setup-deps.py +++ b/.devcontainer/manual-setup-deps.py @@ -58,8 +58,8 @@ def main(): is_windows = platform.system() == "Windows" uv_env = dict(os.environ) uv_env.update({"UV_PYTHON_PREFERENCE": "only-system", "UV_PYTHON": args.python_version}) - skip_check_lock = args.skip_check_lock - if skip_check_lock and args.optionally_check_lock: + skip_check_lock = args.skip_check_lock or args.optionally_check_lock + if args.skip_check_lock and args.optionally_check_lock: print("Cannot skip and optionally check the lock file at the same time.") sys.exit(1) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index a924422e..ecb2cd0d 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -39,7 +39,7 @@ jobs: if: ${{ github.event_name != 'push' }} uses: actions/checkout@v4.2.2 - - name: Install latest versions of packages + - name: Install latest versions of packages uses: ./.github/actions/install_deps with: python-version: ${{ inputs.python-version }} diff --git a/README.md b/README.md index 11a09560..46f032a3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ To create a new repository using this template: 1. Inside that devcontainer, run `python .devcontainer/install-ci-tooling.py` to install necessary tooling to instantiate the template (you can copy/paste the script from this 1. Delete all files currently in the repository. Optional...but makes it easiest to avoid git conflicts. 1. Run copier to instantiate the template: `copier copy --trust gh:LabAutomationAndScreening/copier-python-package-template.git .` -1. Run `uv lock` to generate the lock file +1. Run `python .devcontainer/manual-setup-deps.py --optionally-check-lock` to generate the lock file(s) +1. Stage all files to prepare for commit (`git add .`) 1. Run `python3 .github/workflows/hash_git_files.py . --for-devcontainer-config-update` to update the hash for your devcontainer file 1. Commit the changes (optional) 1. Rebuild your new devcontainer diff --git a/copier.yml b/copier.yml index 97a7d790..7529ed06 100644 --- a/copier.yml +++ b/copier.yml @@ -124,7 +124,7 @@ _templates_suffix: .jinja _exclude: - "copier.yml" -# adapted from https://github.com/copier-org/copier-templates-extensions#context-hook-extension +# adapted from https://github.com/copier-org/copier-template-extensions#context-hook-extension _jinja_extensions: -- copier_templates_extensions.TemplateExtensionLoader +- copier_template_extensions.TemplateExtensionLoader - extensions/context.py:ContextUpdater diff --git a/extensions/context.py b/extensions/context.py index 70b2e30b..6aa117f9 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -1,8 +1,8 @@ -# adapted from https://github.com/copier-org/copier-templates-extensions#context-hook-extension +# adapted from https://github.com/copier-org/copier-template-extensions#context-hook-extension from typing import Any from typing import override -from copier_templates_extensions import ContextHook +from copier_template_extensions import ContextHook class ContextUpdater(ContextHook): @@ -10,23 +10,23 @@ class ContextUpdater(ContextHook): @override def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: - context["uv_version"] = "0.7.12" - context["pnpm_version"] = "10.13.1" + context["uv_version"] = "0.8.3" + context["pnpm_version"] = "10.14.0" context["pre_commit_version"] = "4.2.0" context["pyright_version"] = "1.1.403" - context["pytest_version"] = "8.4.0" + context["pytest_version"] = "8.4.1" context["pytest_randomly_version"] = "3.16.0" context["pytest_cov_version"] = "6.2.1" - context["copier_version"] = "9.7.1" - context["copier_templates_extension_version"] = "0.3.1" + context["copier_version"] = "9.8.0" + context["copier_template_extensions_version"] = "0.3.2" context["sphinx_version"] = "8.1.3" - context["pulumi_version"] = "3.181.0" - context["pulumi_aws_version"] = "6.83.0" - context["pulumi_aws_native_version"] = "1.30.0" + context["pulumi_version"] = "3.186.0" + context["pulumi_aws_version"] = "7.1.0" + context["pulumi_aws_native_version"] = "1.31.0" context["pulumi_command_version"] = "1.1.0" - context["pulumi_github_version"] = "6.7.2" + context["pulumi_github_version"] = "6.7.3" context["pulumi_okta_version"] = "4.20.0" - context["boto3_version"] = "1.38.38" + context["boto3_version"] = "1.39.14" context["ephemeral_pulumi_deploy_version"] = "0.0.4" context["pydantic_version"] = "2.11.7" context["pyinstaller_version"] = "6.13.0" @@ -36,12 +36,14 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["uvicorn_version"] = "0.35.0" context["lab_auto_pulumi_version"] = "0.1.15" - context["nuxt_ui_version"] = "^3.1.2" - context["nuxt_version"] = "^3.17.3" + context["nuxt_ui_version"] = "^3.3.0" + context["nuxt_version"] = "^3.18.0" context["typescript_version"] = "^5.8.2" - context["vue_version"] = "^3.5.13" - context["vue_router_version"] = "^4.5.0" - context["faker_version"] = "^9.8.0" + context["dot_env_cli_version"] = "^9.0.0" + context["playwright_version"] = "^1.52.0" + context["vue_version"] = "^3.5.18" + context["vue_router_version"] = "^4.5.1" + context["faker_version"] = "^9.9.0" context["graphql_codegen_cli_version"] = "^5.0.5" context["graphql_codegen_typescript_version"] = "^4.1.6" diff --git a/pyproject.toml b/pyproject.toml index 33c91030..e0c367af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,12 +6,12 @@ readme = "README.md" requires-python = ">=3.12.7" dependencies = [ # Managed by upstream template - "pytest>=8.4.0", + "pytest>=8.4.1", "pytest-cov>=6.2.1", "pytest-randomly>=3.16.0", "pyright[nodejs]>=1.1.403", - "copier>=9.7.1", - "copier-templates-extensions>=0.3.1" + "copier>=9.8.0", + "copier-template-extensions>=0.3.2" # Specific to this template diff --git a/ruff.toml b/ruff.toml index 087bc366..ed93b2d4 100644 --- a/ruff.toml +++ b/ruff.toml @@ -62,6 +62,7 @@ ignore = [ "TD003", # Up to the author's judgement whether a TODO requires a link to an issue or not "TID252", # Sometimes it makes sense to use relative imports, that's a judgement call for us, not ruff "TC006", # Adding quotes around classes unnecessarily confuses the IDE for automatic refactoring + "SIM114", # Using `or` statements to simplify this would confuse the coverage checker ] # Allow fix for all enabled rules (when `--fix`) is provided. diff --git a/template/.devcontainer/install-ci-tooling.py.jinja b/template/.devcontainer/install-ci-tooling.py.jinja index 171f45ba..7a5e4f3c 100644 --- a/template/.devcontainer/install-ci-tooling.py.jinja +++ b/template/.devcontainer/install-ci-tooling.py.jinja @@ -10,7 +10,7 @@ from pathlib import Path UV_VERSION = "{% endraw %}{{ uv_version }}{% raw %}" PNPM_VERSION = "{% endraw %}{{ pnpm_version }}{% raw %}" COPIER_VERSION = "{% endraw %}{{ copier_version }}{% raw %}" -COPIER_TEMPLATES_EXTENSION_VERSION = "{% endraw %}{{ copier_templates_extension_version }}{% raw %}" +COPIER_TEMPLATE_EXTENSIONS_VERSION = "{% endraw %}{{ copier_template_extensions_version }}{% raw %}" PRE_COMMIT_VERSION = "{% endraw %}{{ pre_commit_version }}{% raw %}" GITHUB_WINDOWS_RUNNER_BIN_PATH = r"C:\Users\runneradmin\.local\bin" INSTALL_SSM_PLUGIN_BY_DEFAULT = {% endraw %}{% if is_child_of_copier_base_template is not defined and install_aws_ssm_port_forwarding_plugin is defined and install_aws_ssm_port_forwarding_plugin is sameas(true) %}True{% else %}False{% endif %}{% raw %} @@ -78,7 +78,7 @@ def main(): "install", f"copier=={COPIER_VERSION}", "--with", - f"copier-templates-extensions=={COPIER_TEMPLATES_EXTENSION_VERSION}", + f"copier-template-extensions=={COPIER_TEMPLATE_EXTENSIONS_VERSION}", ], check=True, env=uv_env, diff --git a/template/.devcontainer/manual-setup-deps.py b/template/.devcontainer/manual-setup-deps.py index 415796f3..722ef422 100644 --- a/template/.devcontainer/manual-setup-deps.py +++ b/template/.devcontainer/manual-setup-deps.py @@ -58,8 +58,8 @@ def main(): is_windows = platform.system() == "Windows" uv_env = dict(os.environ) uv_env.update({"UV_PYTHON_PREFERENCE": "only-system", "UV_PYTHON": args.python_version}) - skip_check_lock = args.skip_check_lock - if skip_check_lock and args.optionally_check_lock: + skip_check_lock = args.skip_check_lock or args.optionally_check_lock + if args.skip_check_lock and args.optionally_check_lock: print("Cannot skip and optionally check the lock file at the same time.") sys.exit(1) diff --git a/template/.github/workflows/pre-commit.yaml b/template/.github/workflows/pre-commit.yaml index a924422e..ecb2cd0d 100644 --- a/template/.github/workflows/pre-commit.yaml +++ b/template/.github/workflows/pre-commit.yaml @@ -39,7 +39,7 @@ jobs: if: ${{ github.event_name != 'push' }} uses: actions/checkout@v4.2.2 - - name: Install latest versions of packages + - name: Install latest versions of packages uses: ./.github/actions/install_deps with: python-version: ${{ inputs.python-version }} diff --git a/template/ruff.toml b/template/ruff.toml index 087bc366..ed93b2d4 100644 --- a/template/ruff.toml +++ b/template/ruff.toml @@ -62,6 +62,7 @@ ignore = [ "TD003", # Up to the author's judgement whether a TODO requires a link to an issue or not "TID252", # Sometimes it makes sense to use relative imports, that's a judgement call for us, not ruff "TC006", # Adding quotes around classes unnecessarily confuses the IDE for automatic refactoring + "SIM114", # Using `or` statements to simplify this would confuse the coverage checker ] # Allow fix for all enabled rules (when `--fix`) is provided. diff --git a/uv.lock b/uv.lock index c16522e4..5350f0db 100644 --- a/uv.lock +++ b/uv.lock @@ -22,7 +22,7 @@ wheels = [ [[package]] name = "copier" -version = "9.7.1" +version = "9.9.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama" }, @@ -39,9 +39,9 @@ dependencies = [ { name = "pyyaml" }, { name = "questionary" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/08/ac/4d8fc462d06dcd25d35b0e8983b5a7466d82a8d8fa50c17f616d1fa65ee8/copier-9.7.1.tar.gz", hash = "sha256:83da2cbe5e28a1593c649f5dac37d916774b07a3ba3ce66e6966a3e84e557885", size = 606482 } +sdist = { url = "https://files.pythonhosted.org/packages/bc/54/badd656b902a69915851caf0ad0dcb06682929f4e6a2f218acf15c373421/copier-9.9.0.tar.gz", hash = "sha256:db48d89bd30d957faa8c96fed757cb5718fdc0fe6b83bebb201424f448cb5216", size = 581833 } wheels = [ - { url = "https://files.pythonhosted.org/packages/83/df/36f3fa22894a3d74bc847732614f697f70b149c783b5a5020f45ed7a7ace/copier-9.7.1-py3-none-any.whl", hash = "sha256:89f2a3f3f9134af35a7d4e2aa63b6468dbff18d82c8369f995b126de9faf0f08", size = 54456 }, + { url = "https://files.pythonhosted.org/packages/a1/95/dd0da5d106b3000c91614010f33ff4f3b6dc5a77eb11d6f01cd000228892/copier-9.9.0-py3-none-any.whl", hash = "sha256:d3484178560456fc3f138ec67349872dd2b378051c2360f95d7f31005ea9794d", size = 55985 }, ] [[package]] @@ -50,7 +50,7 @@ version = "0.1.0" source = { virtual = "." } dependencies = [ { name = "copier" }, - { name = "copier-templates-extensions" }, + { name = "copier-template-extensions" }, { name = "pyright", extra = ["nodejs"] }, { name = "pytest" }, { name = "pytest-cov" }, @@ -59,24 +59,24 @@ dependencies = [ [package.metadata] requires-dist = [ - { name = "copier", specifier = ">=9.7.1" }, - { name = "copier-templates-extensions", specifier = ">=0.3.1" }, + { name = "copier", specifier = ">=9.8.0" }, + { name = "copier-template-extensions", specifier = ">=0.3.2" }, { name = "pyright", extras = ["nodejs"], specifier = ">=1.1.403" }, - { name = "pytest", specifier = ">=8.4.0" }, + { name = "pytest", specifier = ">=8.4.1" }, { name = "pytest-cov", specifier = ">=6.2.1" }, { name = "pytest-randomly", specifier = ">=3.16.0" }, ] [[package]] -name = "copier-templates-extensions" -version = "0.3.1" +name = "copier-template-extensions" +version = "0.3.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "copier" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f2/c4/1827fa1457401eea9c2665423a552614dbe13c1341587b48aa379c928405/copier_templates_extensions-0.3.1.tar.gz", hash = "sha256:f604f6dc58814204b79aa0697d919b94077b28942595d2fa0a20e4d94b6890a6", size = 34921 } +sdist = { url = "https://files.pythonhosted.org/packages/8a/47/1a6638b4323a9eba2f19f4b1364bd77fcdb2b525a1c1cccb1f73422ff97e/copier_template_extensions-0.3.3.tar.gz", hash = "sha256:86bd5e2e89c94b6f9321e4078781b4456c5658b820bcae49ac60fd1e1dd23c10", size = 34991 } wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/a7/85c6ac6e91d80eede4683fa7dda285cf77720ac0f567680a24322249d810/copier_templates_extensions-0.3.1-py3-none-any.whl", hash = "sha256:d0834ecacaaeef84f81e745fd8fdcd519cb0731ddb5bd45bc0129633c717f5e2", size = 9355 }, + { url = "https://files.pythonhosted.org/packages/c6/da/117372469b9bb1555ae7f8a0b1f3e00345044e6006c50f3f6d3cb20c9843/copier_template_extensions-0.3.3-py3-none-any.whl", hash = "sha256:bf6bbdebada26132640d6e1128723fa1ff7eb59d008de07a7543c51e0facb0ea", size = 9893 }, ] [[package]] From 4d16e42876b8c6fab46165fd3125e5dd108729e3 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Sat, 2 Aug 2025 18:18:59 +0000 Subject: [PATCH 2/2] depend --- template/.github/dependabot.yml.jinja | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/.github/dependabot.yml.jinja b/template/.github/dependabot.yml.jinja index 73649732..c604f3c8 100644 --- a/template/.github/dependabot.yml.jinja +++ b/template/.github/dependabot.yml.jinja @@ -9,6 +9,9 @@ updates: time: "16:00" open-pull-requests-limit: 5 ignore: + - dependency-name: "*" + update-types: + - "version-update:semver-patch" # we don't want to be bothered with patch updates for anything except security updates - dependency-name: "boto3" # boto3 gets patch updates way too frequently and they're usually not important update-types: - "version-update:semver-patch"