-
Notifications
You must be signed in to change notification settings - Fork 1
Copier update (bump pytest-cov) #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainDocs 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" . || trueLength of output: 8870 Docs mismatch: 🤖 Prompt for AI Agents |
||
| 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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainNew 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.jsonLength 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:
🤖 Prompt for AI Agents |
||
| context["gha_checkout"] = "v5.0.0" | ||
| context["gha_setup_python"] = "v6.0.0" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVersion 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:
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.pyLength of output: 575 Fix unsatisfiable pytest plugin version bumps
🤖 Prompt for AI Agents |
||
| "pyright[nodejs]>=1.1.405", | ||
| "copier>=9.10.1", | ||
| "copier>=9.10.2", | ||
| "copier-template-extensions>=0.3.3" | ||
|
|
||
| # Specific to this template | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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", | ||||||||||||||||||||||||||
|
|
@@ -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) | ||||||||||||||||||||||||||
|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
|
||||||||||||||||||||||||||
| 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") | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
📝 Committable suggestion
🤖 Prompt for AI Agents