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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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): b9c719df # spellchecker:disable-line
// Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 52ded8d4 # spellchecker:disable-line
}
4 changes: 2 additions & 2 deletions .devcontainer/install-ci-tooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import subprocess
import sys

UV_VERSION = "0.8.15"
COPIER_VERSION = "9.10.1"
UV_VERSION = "0.8.17"
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")
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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: |
Expand Down Expand Up @@ -223,7 +223,7 @@ 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
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 @@
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 repo...and you can paste it in the root of the repo if you want)
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-base-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)
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
19 changes: 10 additions & 9 deletions extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ class ContextUpdater(ContextHook):
@override
def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
# These are duplicated in the install-ci-tooling.py script in this repository
context["uv_version"] = "0.8.15"
context["uv_version"] = "0.8.17"
context["pre_commit_version"] = "4.3.0"
# These also in pyproject.toml
context["copier_version"] = "9.10.1"
context["copier_version"] = "9.10.2"
context["copier_template_extensions_version"] = "0.3.3"
#######
context["pnpm_version"] = "10.15.1"
context["pnpm_version"] = "10.16.1"
# These are duplicated in the pyproject.toml of this repository
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["pytest_randomly_version"] = "4.0.1"
context["pytest_cov_version"] = "7.0.0"
#######
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.15.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.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"
Expand All @@ -66,6 +66,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
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"
#######
# These are duplicated in the CI files for this repository
context["gha_checkout"] = "v5.0.0"
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ readme = "README.md"
requires-python = ">=3.12.7"
dependencies = [
"pytest>=8.4.2",
"pytest-cov>=6.3.0",
"pytest-randomly>=3.16.0",
"pytest-cov>=7.0.0",
"pytest-randomly>=4.0.1",
"pyright[nodejs]>=1.1.405",
"copier>=9.10.1",
"copier>=9.10.2",
"copier-template-extensions>=0.3.3"
]
2 changes: 1 addition & 1 deletion template/README.md.jinja-base
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:{% endraw %}{{ repo_org_name }}/{{ repo_name }}{% raw %}.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)
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
5 changes: 3 additions & 2 deletions template/extensions/context.py.jinja-base
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ class ContextUpdater(ContextHook):
context["uvicorn_version"] = "{{ uvicorn_version }}"
context["lab_auto_pulumi_version"] = "{{ lab_auto_pulumi_version }}"
context["ariadne_codegen_version"] = "{{ ariadne_codegen_version }}"
context["pytest_mock_version"] = "{{ pytest_mock_version }}"

context["node_version"] = "{{ node_version }}"
context["nuxt_ui_version"] = "{{ nuxt_ui_version }}"
context["nuxt_version"] = "{{ nuxt_version }}"
context["nuxt_icon_version"] = "{{ nuxt_icon_version }}"
context["typescript_version"] = "{{ typescript_version }}"
context["dot_env_cli_version"] = "{{ dot_env_cli_version }}"
context["playwright_version"] = "{{ playwright_version }}"
context["vue_version"] = "{{ vue_version }}"
context["vue_tsc_version"] = "{{ vue_tsc_version }}"
context["vue_devtools_api_version"] = "{{ vue_devtools_api_version }}"
context["vue_router_version"] = "{{ vue_router_version }}"
context["dotenv_cli_version"] = "{{ dot_env_cli_version }}"
context["dotenv_cli_version"] = "{{ dotenv_cli_version }}"
context["faker_version"] = "{{ faker_version }}"
context["vitest_version"] = "{{ vitest_version }}"
context["eslint_version"] = "{{ eslint_version }}"
Expand All @@ -61,6 +61,7 @@ class ContextUpdater(ContextHook):
context["graphql_codegen_cli_version"] = "{{ graphql_codegen_cli_version }}"
context["graphql_codegen_typescript_version"] = "{{ graphql_codegen_typescript_version }}"
context["graphql_codegen_typescript_operations_version"] = "{{ graphql_codegen_typescript_operations_version }}"
context["tailwindcss_version"] = "{{ tailwindcss_version }}"

context["gha_checkout"] = "{{ gha_checkout }}"
context["gha_setup_python"] = "{{ gha_setup_python }}"
Expand Down
Loading