Skip to content

Commit 601b8ed

Browse files
committed
fix: pyproject
1 parent e9916df commit 601b8ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sync_uv_pre_commit/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import logging
5+
import shutil
56
import subprocess
67
import sys
78
import tempfile
@@ -49,8 +50,10 @@ def resolve_pyproject(
4950
) -> Path:
5051
pyproject, temp_directory = Path(pyproject), Path(temp_directory)
5152
requirements_path = temp_directory / "requirements.txt"
53+
new_pyproject = temp_directory / "pyproject.toml"
5254

53-
pyproject_dict = read_pyproject(pyproject)
55+
shutil.copy(pyproject, new_pyproject)
56+
pyproject_dict = read_pyproject(new_pyproject)
5457
logger.debug("before validate extras: %s", extras)
5558
valid_extras = find_valid_extras(pyproject_dict)
5659
logger.debug("valid extras: %s", valid_extras)
@@ -80,7 +83,7 @@ def resolve_pyproject(
8083
logger.info("Running command:\n %s", " ".join(command))
8184

8285
uv_process = subprocess.run( # noqa: S603
83-
command, check=False, capture_output=True, text=True
86+
command, cwd=temp_directory, check=False, capture_output=True, text=True
8487
)
8588
try:
8689
uv_process.check_returncode()

0 commit comments

Comments
 (0)