Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.0.69
_commit: v0.0.71
_src_path: gh:LabAutomationAndScreening/copier-base-template.git
description: Copier template for creating Python libraries and executables
python_ci_versions:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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): bec12e35 # spellchecker:disable-line
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 86b774f4 # spellchecker:disable-line
}
6 changes: 3 additions & 3 deletions .devcontainer/install-ci-tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import tempfile
from pathlib import Path

UV_VERSION = "0.8.15"
PNPM_VERSION = "10.15.1"
COPIER_VERSION = "9.10.1"
UV_VERSION = "0.8.17"
PNPM_VERSION = "10.16.1"
COPIER_VERSION = "9.10.2"
COPIER_TEMPLATE_EXTENSIONS_VERSION = "0.3.3"
PRE_COMMIT_VERSION = "4.3.0"
GITHUB_WINDOWS_RUNNER_BIN_PATH = r"C:\Users\runneradmin\.local\bin"
Expand Down
36 changes: 24 additions & 12 deletions .devcontainer/manual-setup-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
_ = parser.add_argument(
"--optionally-check-lock", action="store_true", default=False, help="Check the lock file IFF it exists"
)
_ = parser.add_argument(
"--only-create-lock", action="store_true", default=False, help="Only create the lock file, do not install"
)
_ = parser.add_argument(
"--no-python",
action="store_true",
Expand Down Expand Up @@ -58,7 +61,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 or args.optionally_check_lock
generate_lock_file_only = args.only_create_lock
check_lock_file = not (args.skip_check_lock or args.optionally_check_lock or generate_lock_file_only)
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)
Expand All @@ -74,28 +78,36 @@ def main():
if args.no_node and env.package_manager == PackageManager.PNPM:
print(f"Skipping environment {env.path} as it uses a Node package manager and --no-node is set")
continue
env_skip_check_lock = skip_check_lock
env_check_lock = check_lock_file
if args.optionally_check_lock and env.lock_file.exists():
env_skip_check_lock = False
if not env_skip_check_lock:
env_check_lock = True
if env_check_lock or generate_lock_file_only:
if env.package_manager == PackageManager.UV:
_ = subprocess.run(["uv", "lock", "--check", "--directory", str(env.path)], check=True, env=uv_env)
uv_args = [
"uv",
"lock",
]
if not generate_lock_file_only:
uv_args.append("--check")
uv_args.extend(["--directory", str(env.path)])
_ = subprocess.run(uv_args, check=True, env=uv_env)
elif env.package_manager == PackageManager.PNPM:
pass # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")
Comment on lines 94 to 97
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Support PNPM lock generation (no-op today)

When env_check_lock or lock-only is requested, PNPM path is a pass. Add a lockfile-only call here when generate_lock_file_only is true so pnpm projects also get locks created.

-            elif env.package_manager == PackageManager.PNPM:
-                pass  # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
+            elif env.package_manager == PackageManager.PNPM:
+                if generate_lock_file_only:
+                    _ = subprocess.run(
+                        ["pnpm", "install", "--dir", str(env.path), "--lockfile-only"],
+                        check=True,
+                    )
+                # No strict "check" mode in pnpm; we validate via a subsequent frozen install.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
elif env.package_manager == PackageManager.PNPM:
pass # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")
elif env.package_manager == PackageManager.PNPM:
if generate_lock_file_only:
_ = subprocess.run(
["pnpm", "install", "--dir", str(env.path), "--lockfile-only"],
check=True,
)
# No strict "check" mode in pnpm; we validate via a subsequent frozen install.
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")
🤖 Prompt for AI Agents
In .devcontainer/manual-setup-deps.py around lines 94 to 97, the PNPM branch
currently has a noop; when generate_lock_file_only (or the equivalent flag used
for env_check_lock/lock-only) is requested we should run PNPM's lock-only
install so a lockfile gets created. Replace the pass with logic that, if
generate_lock_file_only is true, invokes pnpm to generate a lock (e.g. run "pnpm
install --lockfile-only" or equivalent via the existing subprocess/run helper),
propagate or log errors on failure, and otherwise keep it as a no-op for normal
checks.

if env.package_manager == PackageManager.UV:
sync_command = ["uv", "sync", "--directory", str(env.path)]
if not env_skip_check_lock:
if env_check_lock:
sync_command.append("--frozen")
_ = subprocess.run(
sync_command,
check=True,
env=uv_env,
)
if not generate_lock_file_only:
_ = subprocess.run(
sync_command,
check=True,
env=uv_env,
)
elif env.package_manager == PackageManager.PNPM:
pnpm_command = ["pnpm", "install", "--dir", str(env.path)]
if not env_skip_check_lock:
if env_check_lock:
pnpm_command.append("--frozen-lockfile")
if is_windows:
pwsh = shutil.which("pwsh") or shutil.which("powershell")
Expand Down
41 changes: 32 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ 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: 65a25783d8705c6a72d9fead19c44d87b4ff03c3 # frozen: v1
rev: edb4e206047e89b93ebe08f1a2ccc3d581a70cc7 # frozen: v1
hooks:
- id: typos
exclude:
|
exclude: |
(?x)^(
.*\.min.js|
.*\.min.css|
Expand All @@ -56,16 +55,14 @@ repos:
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: trailing-whitespace
exclude:
|
exclude: |
(?x)^(
.*/vendor_files/.*|
.*tests/.*/__snapshots__/.*|
)$
- id: end-of-file-fixer
# the XML formatter hook doesn't leave a blank line at the end, so excluding XML files from this hook to avoid conflicts
exclude:
| # the extra trailing newline in the pull request template makes it easier to click there in the github console. The CLI that programmatically generates devcontainer-lock.json always ends the file incompatible with this hook.
exclude: | # the extra trailing newline in the pull request template makes it easier to click there in the github console. The CLI that programmatically generates devcontainer-lock.json always ends the file incompatible with this hook.
(?x)^(
.github/pull_request_template.md|
template/.github/pull_request_template.md|
Expand Down Expand Up @@ -226,34 +223,60 @@ repos:
description: Runs hadolint to lint Dockerfiles

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: db90487f48a9dd992d243ef63c156eaffddeaf28 # frozen: v0.12.11
rev: 13a6bda8ea7612b3aec844ded16569d424b9a1ab # frozen: v0.13.0
hooks:
- id: ruff
name: ruff-src
args: [--fix, --config=./ruff.toml]
files: src/.+\.py$
exclude: |
(?x)^(
.*/graphql_codegen/.*|
.*/openapi_codegen/.*|
)$
- id: ruff
name: ruff-tests
args: [--fix, --config=./ruff-test.toml]
files: tests?/.+\.py$
exclude: |
(?x)^(
.*/graphql_codegen/.*|
.*/openapi_codegen/.*|
)$
- id: ruff-format
exclude: |
(?x)^(
.*/graphql_codegen/.*|
.*/openapi_codegen/.*|
)$

- repo: https://github.com/pylint-dev/pylint
rev: 98942ba4126a6fe1657bad77027bcc11016d16da # frozen: v3.3.8
hooks:
- id: pylint
name: pylint
# exclude the template files---duplication within them will be discovered during CI of that template instantiation
exclude: |
(?x)^(
.*/graphql_codegen/.*|
.*/openapi_codegen/.*|
template/.*|
)$
args:
- --rcfile=./pylintrc.toml
verbose: true
exclude: ^template/.* # exclude the template files---duplication within them will be discovered during CI of that template instantiation

- repo: local
hooks:
- id: pyright
name: pyright
entry: bash -c "uv run pyright"
files: '.+\.py$'
exclude: |
(?x)^(
.*/graphql_codegen/.*|
.*/openapi_codegen/.*|
)$
# don't pass filenames else the command line sees them twice
pass_filenames: false
language: system
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 `python .devcontainer/manual-setup-deps.py --optionally-check-lock` to generate the lock file(s)
1. Run `python .devcontainer/manual-setup-deps.py --only-create-lock` to generate the lock file(s)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Docs mismatch due to PNPM behavior

The step says “--only-create-lock” generates lock files without installing. Current script still installs PNPM deps; fix the script as suggested or clarify PNPM behavior.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo "--- .devcontainer listing ---"
ls -la .devcontainer || true
echo
echo "--- Show README.md (first 160 lines) ---"
sed -n '1,160p' README.md || true
echo
echo "--- Show .devcontainer/manual-setup-deps.py (up to 400 lines) ---"
if [ -f .devcontainer/manual-setup-deps.py ]; then
  sed -n '1,400p' .devcontainer/manual-setup-deps.py
else
  echo "File not found: .devcontainer/manual-setup-deps.py"
fi
echo
echo "--- Grep for related keywords across repo ---"
grep -nHR --color=never -E "--only-create-lock|only-create-lock|pnpm|pnpm install|pnpm i|--lock|--lockfile-only|lockfile-only|--frozen-lockfile|--prefer-offline" . || true

Length of output: 8870


Docs mismatch: --only-create-lock does not prevent pnpm from installing
.manual-setup-deps.py's PNPM branch unconditionally runs pnpm install (the elif env.package_manager == PackageManager.PNPM block in .devcontainer/manual-setup-deps.py), so either: skip running pnpm when --only-create-lock is set, or update README.md (the step that mentions --only-create-lock) to explicitly state PNPM will still install because it lacks a lock-only mode.

🤖 Prompt for AI Agents
In README.md around line 13 and in .devcontainer/manual-setup-deps.py in the
PNPM branch (the elif env.package_manager == PackageManager.PNPM block), fix the
docs-code mismatch by making the script respect the --only-create-lock flag for
PNPM: detect the flag and run pnpm in lockfile-only mode (pnpm install
--lockfile-only) when set, otherwise run the normal pnpm install; alternatively,
if you prefer not to change behavior, update README.md to explicitly state PNPM
will still run a full install because the script lacks a lock-only flow.

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)
Expand Down
31 changes: 17 additions & 14 deletions extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,58 @@ class ContextUpdater(ContextHook):

@override
def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["uv_version"] = "0.8.15"
context["pnpm_version"] = "10.15.1"
context["uv_version"] = "0.8.17"
context["pnpm_version"] = "10.16.1"
context["pre_commit_version"] = "4.3.0"
context["pyright_version"] = "1.1.405"
context["pytest_version"] = "8.4.2"
context["pytest_randomly_version"] = "3.16.0"
context["pytest_cov_version"] = "6.3.0"
context["copier_version"] = "9.10.1"
context["pytest_randomly_version"] = "4.0.1"
context["pytest_cov_version"] = "7.0.0"
context["copier_version"] = "9.10.2"
context["copier_template_extensions_version"] = "0.3.3"
context["sphinx_version"] = "8.1.3"
context["pulumi_version"] = "3.193.0"
context["pulumi_version"] = "3.196.0"
context["pulumi_aws_version"] = "7.7.0"
context["pulumi_aws_native_version"] = "1.33.0"
context["pulumi_command_version"] = "1.1.0"
context["pulumi_github_version"] = "6.7.3"
context["pulumi_okta_version"] = "5.2.0"
context["boto3_version"] = "1.40.25"
context["boto3_version"] = "1.40.30"
context["ephemeral_pulumi_deploy_version"] = "0.0.5"
context["pydantic_version"] = "2.11.7"
context["pyinstaller_version"] = "6.13.0"
context["pyinstaller_version"] = "6.16.0"
context["setuptools_version"] = "80.7.1"
context["strawberry_graphql_version"] = "0.282.0"
context["fastapi_version"] = "0.116.1"
context["fastapi_offline_version"] = "1.7.4"
context["uvicorn_version"] = "0.35.0"
context["lab_auto_pulumi_version"] = "0.1.16"
context["ariadne_codegen_version"] = "0.15.2"
context["pytest_mock_version"] = "3.15.0"

context["node_version"] = "24.7.0"
context["nuxt_ui_version"] = "^3.3.2"
context["nuxt_ui_version"] = "^3.3.3"
context["nuxt_version"] = "^4.1.0"
context["nuxt_icon_version"] = "^2.0.0"
context["typescript_version"] = "^5.8.2"
context["dot_env_cli_version"] = "^9.0.0"
context["playwright_version"] = "^1.55.0"
context["vue_version"] = "^3.5.21"
context["vue_tsc_version"] = "^3.0.6"
context["vue_devtools_api_version"] = "^8.0.0"
context["vue_router_version"] = "^4.5.1"
context["dotenv_cli_version"] = "^9.0.0"
context["dotenv_cli_version"] = "^10.0.0"
context["faker_version"] = "^10.0.0"
context["vitest_version"] = "^3.2.4"
context["eslint_version"] = "^9.34.0"
context["eslint_version"] = "^9.35.0"
context["nuxt_eslint_version"] = "^1.9.0"
context["zod_version"] = "^4.1.5"
context["zod_from_json_schema_version"] = "^0.5.0"
context["types_node_version"] = "^24.3.1"
context["nuxt_apollo_version"] = "5.0.0-alpha.15"
context["graphql_codegen_cli_version"] = "^5.0.5"
context["graphql_codegen_typescript_version"] = "^4.1.6"
context["graphql_codegen_cli_version"] = "^6.0.0"
context["graphql_codegen_typescript_version"] = "^5.0.0"
context["graphql_codegen_typescript_operations_version"] = "^5.0.0"
context["tailwindcss_version"] = "^4.1.11"

Comment on lines +61 to 65
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New codegen/tailwind entries — ensure pre-commit excludes are comprehensive.

Looks covered in this PR; just double-check template-side excludes too.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'graphql_codegen|openapi_codegen|tailwind' template/.pre-commit-config.yaml template/pyrightconfig.json

Length of output: 853


Add tailwind exclude entries to template configs

graphql/openapi codegen excludes exist (template/pyrightconfig.json — lines 13–14; template/.pre-commit-config.yaml — entries around 234–278). Tailwind is not excluded — add matching patterns:

  • template/pyrightconfig.json: add "**/tailwindcss" to the exclude array.
  • template/.pre-commit-config.yaml: add "./tailwindcss/.|" into the same regex block that contains ./graphql_codegen/. and ./openapi_codegen/..
🤖 Prompt for AI Agents
In extensions/context.py around lines 61–65, the project adds codegen/version
context but doesn't propagate Tailwind to template exclude lists; update
template/pyrightconfig.json by adding "**/tailwindcss" to the "exclude" array
(same area as the existing graphql/openapi excludes) and update
template/.pre-commit-config.yaml by inserting ".*/tailwindcss/.*|" into the same
regex block that currently contains ".*/graphql_codegen/.*" and
".*/openapi_codegen/.*" so Tailwind-generated files are excluded by both pyright
and pre-commit checks.

context["gha_checkout"] = "v5.0.0"
context["gha_setup_python"] = "v6.0.0"
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ requires-python = ">=3.12.7"
dependencies = [
# Managed by upstream template
"pytest>=8.4.2",
"pytest-cov>=6.3.0",
"pytest-randomly>=3.16.0",
"pytest-cov>=7.0.0",
"pytest-randomly>=4.0.1",
Comment on lines +10 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Version bumps look good; verify alignment and compatibility.

pytest-cov>=7.0.0, pytest-randomly>=4.0.1, copier>=9.10.2 align with context updates. Please verify:

  • Compatibility with pytest 8.4.2.
  • Versions mirrored in extensions/context.py.
  • Python version (>=3.12.7) matches devcontainer and Copier answers.

Also applies to: 13-13


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "pyproject deps:"
rg -n 'pytest(\-cov|\-randomly)|copier>=' pyproject.toml
echo "context versions:"
rg -n 'pytest_(cov|randomly)_version|copier_version' extensions/context.py
echo "Python versions across files:"
rg -n 'requires-python|python_version|python_ci_versions|py31[23]_version' pyproject.toml .copier-answers.yml extensions/context.py

Length of output: 575


Fix unsatisfiable pytest plugin version bumps

  • pyproject.toml pins pytest-cov>=7.0.0 and pytest-randomly>=4.0.1 (pyproject lines 10–13) and extensions/context.py mirrors them (lines 18–20); Python >=3.12.7 is consistent across pyproject.toml, .copier-answers.yml and extensions/context.py (py312_version).
  • PyPI currently shows pytest-cov latest 6.2.1 and pytest-randomly latest 3.x — requiring >=7.0.0 / >=4.0.1 is likely unsatisfiable; revert to published plugin versions or update to released versions that explicitly support pytest 8.4.2. (pypi.org)
  • Actions: update pyproject.toml and extensions/context.py to installable versions (or relax the constraints) — locations: pyproject.toml (lines 10–13), extensions/context.py (lines 18–20).
🤖 Prompt for AI Agents
In pyproject.toml (lines 10–11) and extensions/context.py (lines 18–20) the
pytest plugin constraints require non-existent major versions (pytest-cov>=7.0.0
and pytest-randomly>=4.0.1); change those pins to published, installable
versions (e.g., pytest-cov==6.2.1 and pytest-randomly==3.x) or relax to
compatible ranges (e.g., pytest-cov>=6.2.1,<7 and pytest-randomly>=3.0,<4) so
the dependencies are satisfiable with pytest 8.4.2, updating both files
consistently.

"pyright[nodejs]>=1.1.405",
"copier>=9.10.1",
"copier>=9.10.2",
"copier-template-extensions>=0.3.3"

# Specific to this template
Expand Down
2 changes: 2 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"**/.pipx_cache",
"**/__pycache__",
"**/vendor_files",
"**/graphql_codegen",
"**/openapi_codegen",
"**/.venv",
"**/venv"
],
Expand Down
36 changes: 24 additions & 12 deletions template/.devcontainer/manual-setup-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
_ = parser.add_argument(
"--optionally-check-lock", action="store_true", default=False, help="Check the lock file IFF it exists"
)
_ = parser.add_argument(
"--only-create-lock", action="store_true", default=False, help="Only create the lock file, do not install"
)
_ = parser.add_argument(
"--no-python",
action="store_true",
Expand Down Expand Up @@ -58,7 +61,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 or args.optionally_check_lock
generate_lock_file_only = args.only_create_lock
check_lock_file = not (args.skip_check_lock or args.optionally_check_lock or generate_lock_file_only)
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)
Expand All @@ -74,28 +78,36 @@ def main():
if args.no_node and env.package_manager == PackageManager.PNPM:
print(f"Skipping environment {env.path} as it uses a Node package manager and --no-node is set")
continue
env_skip_check_lock = skip_check_lock
env_check_lock = check_lock_file
if args.optionally_check_lock and env.lock_file.exists():
env_skip_check_lock = False
if not env_skip_check_lock:
env_check_lock = True
if env_check_lock or generate_lock_file_only:
if env.package_manager == PackageManager.UV:
_ = subprocess.run(["uv", "lock", "--check", "--directory", str(env.path)], check=True, env=uv_env)
uv_args = [
"uv",
"lock",
]
if not generate_lock_file_only:
uv_args.append("--check")
uv_args.extend(["--directory", str(env.path)])
_ = subprocess.run(uv_args, check=True, env=uv_env)
elif env.package_manager == PackageManager.PNPM:
pass # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")
Comment on lines 94 to 97
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add PNPM lock generation in the lock/check phase

Match uv behavior by generating pnpm lock with --lockfile-only during "only-create-lock".

-            elif env.package_manager == PackageManager.PNPM:
-                pass  # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
+            elif env.package_manager == PackageManager.PNPM:
+                if generate_lock_file_only:
+                    _ = subprocess.run(
+                        ["pnpm", "install", "--dir", str(env.path), "--lockfile-only"],
+                        check=True,
+                    )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
elif env.package_manager == PackageManager.PNPM:
pass # doesn't seem to be a way to do this https://github.com/orgs/pnpm/discussions/3202
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")
elif env.package_manager == PackageManager.PNPM:
if generate_lock_file_only:
_ = subprocess.run(
["pnpm", "install", "--dir", str(env.path), "--lockfile-only"],
check=True,
)
else:
raise NotImplementedError(f"Package manager {env.package_manager} does not support lock file checking")

if env.package_manager == PackageManager.UV:
sync_command = ["uv", "sync", "--directory", str(env.path)]
if not env_skip_check_lock:
if env_check_lock:
sync_command.append("--frozen")
_ = subprocess.run(
sync_command,
check=True,
env=uv_env,
)
if not generate_lock_file_only:
_ = subprocess.run(
sync_command,
check=True,
env=uv_env,
)
elif env.package_manager == PackageManager.PNPM:
pnpm_command = ["pnpm", "install", "--dir", str(env.path)]
if not env_skip_check_lock:
if env_check_lock:
pnpm_command.append("--frozen-lockfile")
if is_windows:
pwsh = shutil.which("pwsh") or shutil.which("powershell")
Expand Down
Loading