Skip to content

Commit

Permalink
fix: pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Oct 26, 2024
1 parent e9916df commit 601b8ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sync_uv_pre_commit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import logging
import shutil
import subprocess
import sys
import tempfile
Expand Down Expand Up @@ -49,8 +50,10 @@ def resolve_pyproject(
) -> Path:
pyproject, temp_directory = Path(pyproject), Path(temp_directory)
requirements_path = temp_directory / "requirements.txt"
new_pyproject = temp_directory / "pyproject.toml"

pyproject_dict = read_pyproject(pyproject)
shutil.copy(pyproject, new_pyproject)
pyproject_dict = read_pyproject(new_pyproject)
logger.debug("before validate extras: %s", extras)
valid_extras = find_valid_extras(pyproject_dict)
logger.debug("valid extras: %s", valid_extras)
Expand Down Expand Up @@ -80,7 +83,7 @@ def resolve_pyproject(
logger.info("Running command:\n %s", " ".join(command))

uv_process = subprocess.run( # noqa: S603
command, check=False, capture_output=True, text=True
command, cwd=temp_directory, check=False, capture_output=True, text=True
)
try:
uv_process.check_returncode()
Expand Down

0 comments on commit 601b8ed

Please sign in to comment.