diff --git a/onboard.py b/onboard.py index 994372a..75743ff 100644 --- a/onboard.py +++ b/onboard.py @@ -5,11 +5,11 @@ import re import shutil import subprocess +import tomllib from pathlib import Path import questionary import typer -import yaml from rich import print as rprint from rich.console import Console from rich.panel import Panel @@ -64,7 +64,7 @@ def _run_orchestrator() -> None: " 1. Rename - Set project name and description\n" " 2. Dependencies - Install project dependencies\n" " 3. Environment - Configure API keys and secrets\n" - " 4. Hooks - Activate pre-commit hooks\n" + " 4. Hooks - Activate prek hooks\n" " 5. Media - Generate banner and logo assets\n" " 6. Jules - Enable/disable automated maintenance workflows", title="Welcome to Project Onboarding", @@ -406,15 +406,16 @@ def env() -> None: @app.command() def hooks() -> None: - """Step 4: Activate pre-commit hooks.""" - config_path = PROJECT_ROOT / ".pre-commit-config.yaml" + """Step 4: Activate prek hooks.""" + config_path = PROJECT_ROOT / "prek.toml" if not config_path.exists(): - rprint("[red]✗ .pre-commit-config.yaml not found.[/red]") + rprint("[red]✗ prek.toml not found.[/red]") raise typer.Exit(code=1) - config = yaml.safe_load(config_path.read_text()) + with open(config_path, "rb") as f: + config = tomllib.load(f) - table = Table(title="Configured Pre-commit Hooks") + table = Table(title="Configured Prek Hooks") table.add_column("Hook ID", style="cyan") table.add_column("Description", style="white") @@ -428,7 +429,7 @@ def hooks() -> None: rprint("") activate = questionary.confirm( - "Activate pre-commit hooks? (Recommended)", + "Activate prek hooks? (Recommended)", default=True, ).ask() if activate is None: @@ -436,7 +437,7 @@ def hooks() -> None: if activate: result = subprocess.run( - ["uv", "run", "pre-commit", "install"], + ["uv", "tool", "run", "prek", "install"], cwd=PROJECT_ROOT, capture_output=True, text=True, @@ -444,11 +445,11 @@ def hooks() -> None: if result.returncode != 0: rprint(f"[red]✗ Failed to activate hooks:[/red]\n{result.stderr}") raise typer.Exit(code=1) - rprint("[green]✓ Pre-commit hooks activated.[/green]") + rprint("[green]✓ Prek hooks activated.[/green]") else: rprint( "[yellow]Skipped.[/yellow] You can activate later with: " - "[bold]pre-commit install[/bold]" + "[bold]uv tool run prek install[/bold]" ) diff --git a/pyproject.toml b/pyproject.toml index 5eed1b7..ed14e1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,6 +110,5 @@ show_missing = true [dependency-groups] dev = [ - "pre-commit>=4.5.1", "pytest-check-links>=0.9.1", ] diff --git a/uv.lock b/uv.lock index 669eeda..63d90e7 100644 --- a/uv.lock +++ b/uv.lock @@ -278,15 +278,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" }, ] -[[package]] -name = "cfgv" -version = "3.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, -] - [[package]] name = "charset-normalizer" version = "3.4.2" @@ -558,15 +549,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3f/27/4570e78fc0bf5ea0ca45eb1de3818a23787af9b390c0b0a0033a1b8236f9/diskcache-5.6.3-py3-none-any.whl", hash = "sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19", size = 45550, upload-time = "2023-08-31T06:11:58.822Z" }, ] -[[package]] -name = "distlib" -version = "0.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" }, -] - [[package]] name = "distro" version = "1.9.0" @@ -1019,15 +1001,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a3/fb/ee29329b25ffea61994b98f72f4efdefcca5703de4d9d37d89871b7ddc53/human_id-0.2.0-py3-none-any.whl", hash = "sha256:d2c7f0fea0244114a3a6e9b30343733515522031c6948bfdf3e0294a7d76335e", size = 4466, upload-time = "2022-03-24T23:59:00.422Z" }, ] -[[package]] -name = "identify" -version = "2.6.16" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5b/8d/e8b97e6bd3fb6fb271346f7981362f1e04d6a7463abd0de79e1fda17c067/identify-2.6.16.tar.gz", hash = "sha256:846857203b5511bbe94d5a352a48ef2359532bc8f6727b5544077a0dcfb24980", size = 99360, upload-time = "2026-01-12T18:58:58.201Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b8/58/40fbbcefeda82364720eba5cf2270f98496bdfa19ea75b4cccae79c698e6/identify-2.6.16-py2.py3-none-any.whl", hash = "sha256:391ee4d77741d994189522896270b787aed8670389bfd60f326d677d64a6dfb0", size = 99202, upload-time = "2026-01-12T18:58:56.627Z" }, -] - [[package]] name = "idna" version = "3.10" @@ -1504,15 +1477,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/60/90/81ac364ef94209c100e12579629dc92bf7a709a84af32f8c551b02c07e94/nltk-3.9.2-py3-none-any.whl", hash = "sha256:1e209d2b3009110635ed9709a67a1a3e33a10f799490fa71cf4bec218c11c88a", size = 1513404, upload-time = "2025-10-01T07:19:21.648Z" }, ] -[[package]] -name = "nodeenv" -version = "1.10.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, -] - [[package]] name = "numpy" version = "2.4.2" @@ -1869,22 +1833,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, ] -[[package]] -name = "pre-commit" -version = "4.5.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cfgv" }, - { name = "identify" }, - { name = "nodeenv" }, - { name = "pyyaml" }, - { name = "virtualenv" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/40/f1/6d86a29246dfd2e9b6237f0b5823717f60cad94d47ddc26afa916d21f525/pre_commit-4.5.1.tar.gz", hash = "sha256:eb545fcff725875197837263e977ea257a402056661f09dae08e4b149b030a61", size = 198232, upload-time = "2025-12-16T21:14:33.552Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5d/19/fd3ef348460c80af7bb4669ea7926651d1f95c23ff2df18b9d24bab4f3fa/pre_commit-4.5.1-py2.py3-none-any.whl", hash = "sha256:3b3afd891e97337708c1674210f8eba659b52a38ea5f822ff142d10786221f77", size = 226437, upload-time = "2025-12-16T21:14:32.409Z" }, -] - [[package]] name = "prompt-toolkit" version = "3.0.52" @@ -2278,7 +2226,6 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "pre-commit" }, { name = "pytest-check-links" }, ] @@ -2316,10 +2263,7 @@ requires-dist = [ ] [package.metadata.requires-dev] -dev = [ - { name = "pre-commit", specifier = ">=4.5.1" }, - { name = "pytest-check-links", specifier = ">=0.9.1" }, -] +dev = [{ name = "pytest-check-links", specifier = ">=0.9.1" }] [[package]] name = "pytz" @@ -3051,20 +2995,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a7/c2/fe1e52489ae3122415c51f387e221dd0773709bad6c6cdaa599e8a2c5185/urllib3-2.5.0-py3-none-any.whl", hash = "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc", size = 129795, upload-time = "2025-06-18T14:07:40.39Z" }, ] -[[package]] -name = "virtualenv" -version = "20.39.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "distlib" }, - { name = "filelock" }, - { name = "platformdirs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ed/54/809199edc537dbace273495ac0884d13df26436e910a5ed4d0ec0a69806b/virtualenv-20.39.0.tar.gz", hash = "sha256:a15f0cebd00d50074fd336a169d53422436a12dfe15149efec7072cfe817df8b", size = 5869141, upload-time = "2026-02-23T18:09:13.349Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f7/b4/8268da45f26f4fe84f6eae80a6ca1485ffb490a926afecff75fc48f61979/virtualenv-20.39.0-py3-none-any.whl", hash = "sha256:44888bba3775990a152ea1f73f8e5f566d49f11bbd1de61d426fd7732770043e", size = 5839121, upload-time = "2026-02-23T18:09:11.173Z" }, -] - [[package]] name = "vulture" version = "2.14"