Skip to content

Commit 9c722d7

Browse files
committed
fix: use subprocess
1 parent 78ca05f commit 9c722d7

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- "-l DEBUG"
88
- "-g dev"
99
repo: https://github.com/phi-friday/sync-uv-pre-commit
10-
rev: v0.6.4
10+
rev: c793eb2
1111

1212
- hooks:
1313
- id: ruff

.pre-commit-hooks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
- id: sync-uv-pre-commit
22
name: Sync uv and pre commit
33
description: Sync uv and pre commit
4-
language: script
5-
entry: "uv run script.py"
4+
language: python
5+
entry: sync_uv_pre_commit
66
minimum_pre_commit_version: "3.5.0"
77
require_serial: true
88
always_run: true

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ classifiers = [
1212
"Programming Language :: Python :: 3.12",
1313
"Programming Language :: Python :: Implementation :: CPython",
1414
]
15-
scripts = { generate_cli_script = "sync_uv_pre_commit.render:generate_script" }
1615
dependencies = [
1716
"packaging",
1817
"pre-commit>=3.5.0",
1918
"tomlkit>=0.13.2",
2019
"typing-extensions>=4.12.2",
2120
]
21+
22+
[project.scripts]
23+
generate_cli_script = "sync_uv_pre_commit.render:generate_script"
24+
sync_uv_pre_commit = "sync_uv_pre_commit.script:main"
25+
2226
[dependency-groups]
2327
dev = [
2428
"ruff==0.8.4",

src/sync_uv_pre_commit/script.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from __future__ import annotations
2+
3+
import subprocess
4+
from pathlib import Path
5+
6+
WORKSPACE = Path(__file__).parent.parent.parent
7+
8+
9+
def main() -> None: # noqa: D103
10+
subprocess.run(["uv", "run", str(WORKSPACE / "script.py")], check=True, text=True) # noqa: S603, S607

0 commit comments

Comments
 (0)