From 06f62f15e78aa1c7f8f2395574ba5f9ba6f00e27 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 21 Jul 2025 10:26:42 +0000 Subject: [PATCH 1/3] copier --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .devcontainer/install-ci-tooling.py | 2 +- .github/dependabot.yml | 3 +++ .pre-commit-config.yaml | 24 +++++++++++++++++++++--- biome.json | 8 -------- biome.jsonc | 16 ++++++++++++++++ extensions/context.py | 14 +++++++------- pyproject.toml | 2 +- ruff.toml | 1 + template/.pre-commit-config.yaml | 24 +++++++++++++++++++++--- template/biome.json | 8 -------- template/biome.jsonc | 16 ++++++++++++++++ template/ruff.toml | 1 + uv.lock | 8 ++++---- 15 files changed, 94 insertions(+), 37 deletions(-) delete mode 100644 biome.json create mode 100644 biome.jsonc delete mode 100644 template/biome.json create mode 100644 template/biome.jsonc diff --git a/.copier-answers.yml b/.copier-answers.yml index b70c4e2a..8d4e3ba8 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.55 +_commit: v0.0.57 _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 70e83060..94466237 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): 6ebb97a5 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 01ec0f62 # spellchecker:disable-line } diff --git a/.devcontainer/install-ci-tooling.py b/.devcontainer/install-ci-tooling.py index 67d413f3..1e96d67c 100644 --- a/.devcontainer/install-ci-tooling.py +++ b/.devcontainer/install-ci-tooling.py @@ -8,7 +8,7 @@ from pathlib import Path UV_VERSION = "0.7.12" -PNPM_VERSION = "10.12.1" +PNPM_VERSION = "10.13.1" COPIER_VERSION = "9.7.1" COPIER_TEMPLATES_EXTENSION_VERSION = "0.3.1" PRE_COMMIT_VERSION = "4.2.0" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b85da09c..88e8ee27 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4637c4a4..b3568c93 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,9 +42,16 @@ repos: # Reformatting (should generally come before any file format or other checks, because reformatting can change things) - repo: https://github.com/crate-ci/typos - rev: 0f0ccba9ed1df83948f0c15026e4f5ccfce46109 # frozen: v1.32.0 + rev: 392b78fe18a52790c53f42456e46124f77346842 # frozen: v1.34.0 hooks: - id: typos + exclude: + | + (?x)^( + .*\.min.js| + .*\.min.css| + .*\.umd.js| + )$ - repo: https://github.com/pre-commit/pre-commit-hooks rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 hooks: @@ -77,17 +84,21 @@ repos: .*devcontainer.json| .*pyrightconfig.json| .*tsconfig.json| + .*biome.jsonc| .*/vendor_files/.*| )$ args: [--autofix, --no-sort-keys] - repo: https://github.com/biomejs/pre-commit - rev: 748e40d32e076a6aaaf3353a2564c8fe43764f79 # frozen: v2.0.0-beta.1 + rev: a450e9c04887b1305951c298db5999cd30155f74 # frozen: v2.1.1 hooks: - id: biome-check + # exclude generated files from codegen and strawberry exclude: | (?x)^( .*generated/graphql.ts| + .*/schema.graphql| + .*pyrightconfig\.json| )$ - repo: https://github.com/pre-commit/mirrors-prettier # TODO: switch to a different approach...this was archived in 2024 @@ -102,10 +113,17 @@ repos: .*devcontainer.json| .*pyrightconfig.json| .*tsconfig.json| + .*/__snapshots__/.*| + .*.min.js| + .*.min.css| + .*.umd.js| .*.yaml| .*.yml| .*.md| + .*.jsonc| .*/vendor_files/.*| + .*/schema.graphql| + .*generated/graphql.ts| )$ files: (.*.json)|(.*.ts)|(.*.jsx)|(.*.tsx)|(.*.yaml)|(.*.yml)|(.*.md)|(.*.html)|(.*.css)|(.*.scss)|(.*.less)|(.*.vue)|(.*.graphql)|(.*.gql) @@ -204,7 +222,7 @@ repos: description: Runs hadolint to lint Dockerfiles - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 24e02b24b8ab2b7c76225602d13fa60e12d114e6 # frozen: v0.11.9 + rev: 3d44372123ca5e8617fdb65d9f11facd159b9e95 # frozen: v0.12.3 hooks: - id: ruff name: ruff-src diff --git a/biome.json b/biome.json deleted file mode 100644 index 7dbe4e1e..00000000 --- a/biome.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "formatter": { - "enabled": false - }, - "linter": { - "enabled": false - } -} diff --git a/biome.jsonc b/biome.jsonc new file mode 100644 index 00000000..e0ea5856 --- /dev/null +++ b/biome.jsonc @@ -0,0 +1,16 @@ +{ + "formatter": { + "enabled": false, + }, + "linter": { + "enabled": false, + }, + "files": { + "includes": [ + "**", + "!template/template/biome.jsonc", + "!template/biome.jsonc", + "!**/*.css", // still too many false positives, so we exclude CSS files + ], + }, +} diff --git a/extensions/context.py b/extensions/context.py index 1d4a9cd0..70b2e30b 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -11,16 +11,16 @@ class ContextUpdater(ContextHook): @override def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["uv_version"] = "0.7.12" - context["pnpm_version"] = "10.12.1" + context["pnpm_version"] = "10.13.1" context["pre_commit_version"] = "4.2.0" - context["pyright_version"] = "1.1.402" + context["pyright_version"] = "1.1.403" context["pytest_version"] = "8.4.0" 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["sphinx_version"] = "8.1.3" - context["pulumi_version"] = "3.177.0" + context["pulumi_version"] = "3.181.0" context["pulumi_aws_version"] = "6.83.0" context["pulumi_aws_native_version"] = "1.30.0" context["pulumi_command_version"] = "1.1.0" @@ -28,13 +28,13 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["pulumi_okta_version"] = "4.20.0" context["boto3_version"] = "1.38.38" context["ephemeral_pulumi_deploy_version"] = "0.0.4" - context["pydantic_version"] = "2.11.5" + context["pydantic_version"] = "2.11.7" context["pyinstaller_version"] = "6.13.0" context["setuptools_version"] = "80.7.1" context["strawberry_graphql_version"] = "0.270.4" - context["fastapi_version"] = "0.115.12" - context["uvicorn_version"] = "0.34.2" - context["lab_auto_pulumi_version"] = "0.1.14" + context["fastapi_version"] = "0.115.14" + 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" diff --git a/pyproject.toml b/pyproject.toml index 9330afea..33c91030 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dependencies = [ "pytest>=8.4.0", "pytest-cov>=6.2.1", "pytest-randomly>=3.16.0", - "pyright[nodejs]>=1.1.402", + "pyright[nodejs]>=1.1.403", "copier>=9.7.1", "copier-templates-extensions>=0.3.1" diff --git a/ruff.toml b/ruff.toml index c76d77ba..087bc366 100644 --- a/ruff.toml +++ b/ruff.toml @@ -61,6 +61,7 @@ ignore = [ "TD002", # Adding author names to TODOs erodes shared ownership of codebase. Git history provides information about who originally created the TODO if that information is vitally needed "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 ] # Allow fix for all enabled rules (when `--fix`) is provided. diff --git a/template/.pre-commit-config.yaml b/template/.pre-commit-config.yaml index 4637c4a4..b3568c93 100644 --- a/template/.pre-commit-config.yaml +++ b/template/.pre-commit-config.yaml @@ -42,9 +42,16 @@ repos: # Reformatting (should generally come before any file format or other checks, because reformatting can change things) - repo: https://github.com/crate-ci/typos - rev: 0f0ccba9ed1df83948f0c15026e4f5ccfce46109 # frozen: v1.32.0 + rev: 392b78fe18a52790c53f42456e46124f77346842 # frozen: v1.34.0 hooks: - id: typos + exclude: + | + (?x)^( + .*\.min.js| + .*\.min.css| + .*\.umd.js| + )$ - repo: https://github.com/pre-commit/pre-commit-hooks rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 hooks: @@ -77,17 +84,21 @@ repos: .*devcontainer.json| .*pyrightconfig.json| .*tsconfig.json| + .*biome.jsonc| .*/vendor_files/.*| )$ args: [--autofix, --no-sort-keys] - repo: https://github.com/biomejs/pre-commit - rev: 748e40d32e076a6aaaf3353a2564c8fe43764f79 # frozen: v2.0.0-beta.1 + rev: a450e9c04887b1305951c298db5999cd30155f74 # frozen: v2.1.1 hooks: - id: biome-check + # exclude generated files from codegen and strawberry exclude: | (?x)^( .*generated/graphql.ts| + .*/schema.graphql| + .*pyrightconfig\.json| )$ - repo: https://github.com/pre-commit/mirrors-prettier # TODO: switch to a different approach...this was archived in 2024 @@ -102,10 +113,17 @@ repos: .*devcontainer.json| .*pyrightconfig.json| .*tsconfig.json| + .*/__snapshots__/.*| + .*.min.js| + .*.min.css| + .*.umd.js| .*.yaml| .*.yml| .*.md| + .*.jsonc| .*/vendor_files/.*| + .*/schema.graphql| + .*generated/graphql.ts| )$ files: (.*.json)|(.*.ts)|(.*.jsx)|(.*.tsx)|(.*.yaml)|(.*.yml)|(.*.md)|(.*.html)|(.*.css)|(.*.scss)|(.*.less)|(.*.vue)|(.*.graphql)|(.*.gql) @@ -204,7 +222,7 @@ repos: description: Runs hadolint to lint Dockerfiles - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 24e02b24b8ab2b7c76225602d13fa60e12d114e6 # frozen: v0.11.9 + rev: 3d44372123ca5e8617fdb65d9f11facd159b9e95 # frozen: v0.12.3 hooks: - id: ruff name: ruff-src diff --git a/template/biome.json b/template/biome.json deleted file mode 100644 index 7dbe4e1e..00000000 --- a/template/biome.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "formatter": { - "enabled": false - }, - "linter": { - "enabled": false - } -} diff --git a/template/biome.jsonc b/template/biome.jsonc new file mode 100644 index 00000000..e0ea5856 --- /dev/null +++ b/template/biome.jsonc @@ -0,0 +1,16 @@ +{ + "formatter": { + "enabled": false, + }, + "linter": { + "enabled": false, + }, + "files": { + "includes": [ + "**", + "!template/template/biome.jsonc", + "!template/biome.jsonc", + "!**/*.css", // still too many false positives, so we exclude CSS files + ], + }, +} diff --git a/template/ruff.toml b/template/ruff.toml index c76d77ba..087bc366 100644 --- a/template/ruff.toml +++ b/template/ruff.toml @@ -61,6 +61,7 @@ ignore = [ "TD002", # Adding author names to TODOs erodes shared ownership of codebase. Git history provides information about who originally created the TODO if that information is vitally needed "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 ] # Allow fix for all enabled rules (when `--fix`) is provided. diff --git a/uv.lock b/uv.lock index c05e5b7d..c16522e4 100644 --- a/uv.lock +++ b/uv.lock @@ -61,7 +61,7 @@ dependencies = [ requires-dist = [ { name = "copier", specifier = ">=9.7.1" }, { name = "copier-templates-extensions", specifier = ">=0.3.1" }, - { name = "pyright", extras = ["nodejs"], specifier = ">=1.1.402" }, + { name = "pyright", extras = ["nodejs"], specifier = ">=1.1.403" }, { name = "pytest", specifier = ">=8.4.0" }, { name = "pytest-cov", specifier = ">=6.2.1" }, { name = "pytest-randomly", specifier = ">=3.16.0" }, @@ -358,15 +358,15 @@ wheels = [ [[package]] name = "pyright" -version = "1.1.402" +version = "1.1.403" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/aa/04/ce0c132d00e20f2d2fb3b3e7c125264ca8b909e693841210534b1ea1752f/pyright-1.1.402.tar.gz", hash = "sha256:85a33c2d40cd4439c66aa946fd4ce71ab2f3f5b8c22ce36a623f59ac22937683", size = 3888207 } +sdist = { url = "https://files.pythonhosted.org/packages/fe/f6/35f885264ff08c960b23d1542038d8da86971c5d8c955cfab195a4f672d7/pyright-1.1.403.tar.gz", hash = "sha256:3ab69b9f41c67fb5bbb4d7a36243256f0d549ed3608678d381d5f51863921104", size = 3913526 } wheels = [ - { url = "https://files.pythonhosted.org/packages/fe/37/1a1c62d955e82adae588be8e374c7f77b165b6cb4203f7d581269959abbc/pyright-1.1.402-py3-none-any.whl", hash = "sha256:2c721f11869baac1884e846232800fe021c33f1b4acb3929cff321f7ea4e2982", size = 5624004 }, + { url = "https://files.pythonhosted.org/packages/49/b6/b04e5c2f41a5ccad74a1a4759da41adb20b4bc9d59a5e08d29ba60084d07/pyright-1.1.403-py3-none-any.whl", hash = "sha256:c0eeca5aa76cbef3fcc271259bbd785753c7ad7bcac99a9162b4c4c7daed23b3", size = 5684504 }, ] [package.optional-dependencies] From 728cacd089978d0704655b9550870a3556f7cb54 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 21 Jul 2025 10:27:53 +0000 Subject: [PATCH 2/3] ci --- template/.github/workflows/publish.yaml.jinja | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/.github/workflows/publish.yaml.jinja b/template/.github/workflows/publish.yaml.jinja index 34dd78f9..6fdf0167 100644 --- a/template/.github/workflows/publish.yaml.jinja +++ b/template/.github/workflows/publish.yaml.jinja @@ -165,6 +165,8 @@ jobs: time: 60s{% endraw %}{% endif %}{% raw %} - name: Install from staging registry run: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://www.pypi.org/simple {% endraw %}{{ package_name | replace('_', '-') }}{% raw %}==${{ needs.get-values.outputs.package-version }} + - name: Display dependencies + run: pip list - name: Confirm library can be imported successfully run: python -c "import {% endraw %}{{ package_name | replace('-', '_') }}{% raw %}" @@ -237,5 +239,7 @@ jobs: time: 60s{% endraw %}{% endif %}{% raw %} - name: Install from primary registry run: pip install {% endraw %}{{ package_name | replace('_', '-') }}{% raw %}==${{ needs.get-values.outputs.package-version }} + - name: Display dependencies + run: pip list - name: Confirm library can be imported successfully run: python -c "import {% endraw %}{{ package_name | replace('-', '_') }}{% raw %}"{% endraw %} From d9df6b5d06c33c843301ec3b28c9cac2f6cfc62b Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Mon, 21 Jul 2025 10:47:07 +0000 Subject: [PATCH 3/3] param install from --- template/.github/workflows/publish.yaml.jinja | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/template/.github/workflows/publish.yaml.jinja b/template/.github/workflows/publish.yaml.jinja index 6fdf0167..1701cd2d 100644 --- a/template/.github/workflows/publish.yaml.jinja +++ b/template/.github/workflows/publish.yaml.jinja @@ -152,12 +152,29 @@ jobs: install-from-staging: name: Install package from staging registry needs: [ publish-to-staging, get-values ] - runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} + strategy: + matrix: + os: + - "{% endraw %}{{ gha_linux_runner }}{% raw %}" +{% endraw %}{% if use_windows_in_ci %} - {{ gha_windows_runner }}{% endif %}{% raw %} + python-version: +{% endraw %}{% for item in python_ci_versions %} + - {{ item }} +{% endfor %}{% raw %} + include: + - os: "{% endraw %}{{ gha_linux_runner }}{% raw %}" + python-version: "{% endraw %}{{ python_ci_versions[0] }}{% raw %}" + JOB_MATCHING_DEV_ENV: true + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python uses: actions/setup-python@{% endraw %}{{ gha_setup_python }}{% raw %} with: - python-version: {% endraw %}{{ python_version }}{% raw %} + python-version: ${{ matrix.python-version }} {% endraw %}{% if python_package_registry == "PyPI" %}{% raw %} - name: Sleep to allow PyPI Index to update before proceeding to the next step uses: juliangruber/sleep-action@{% endraw %}{{ gha_sleep }}{% raw %} @@ -226,12 +243,29 @@ jobs: name: Install package from primary registry if: ${{ github.event.inputs.publish_to_primary }} needs: [ publish-to-primary, get-values ] - runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} + strategy: + matrix: + os: + - "{% endraw %}{{ gha_linux_runner }}{% raw %}" +{% endraw %}{% if use_windows_in_ci %} - {{ gha_windows_runner }}{% endif %}{% raw %} + python-version: +{% endraw %}{% for item in python_ci_versions %} + - {{ item }} +{% endfor %}{% raw %} + include: + - os: "{% endraw %}{{ gha_linux_runner }}{% raw %}" + python-version: "{% endraw %}{{ python_ci_versions[0] }}{% raw %}" + JOB_MATCHING_DEV_ENV: true + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python uses: actions/setup-python@{% endraw %}{{ gha_setup_python }}{% raw %} with: - python-version: {% endraw %}{{ python_version }}{% raw %} + python-version: ${{ matrix.python-version }} {% endraw %}{% if python_package_registry == "PyPI" %}{% raw %} - name: Sleep to allow PyPI Index to update before proceeding to the next step uses: juliangruber/sleep-action@{% endraw %}{{ gha_sleep }}{% raw %}