[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
1254fdf3ad
commit
e089b04b0e
3 changed files with 3 additions and 12 deletions
|
|
@ -279,7 +279,6 @@ def _local_project_name(token):
|
|||
if os.path.isfile(_pyproject):
|
||||
try:
|
||||
import tomllib
|
||||
|
||||
with open(_pyproject, "rb") as f:
|
||||
_name = (tomllib.load(f).get("project") or {}).get("name")
|
||||
if _name:
|
||||
|
|
|
|||
|
|
@ -43,10 +43,7 @@ def test_sys_executable_braces_spaced_rewritten():
|
|||
|
||||
|
||||
def test_absolute_interpreter_path_rewritten():
|
||||
assert (
|
||||
_rewrite("!/opt/unsloth-venv/bin/python -m pip install peft\n")
|
||||
== "!pip install peft\n"
|
||||
)
|
||||
assert _rewrite("!/opt/unsloth-venv/bin/python -m pip install peft\n") == "!pip install peft\n"
|
||||
|
||||
|
||||
def test_absolute_interpreter_versioned_path_rewritten():
|
||||
|
|
@ -54,10 +51,7 @@ def test_absolute_interpreter_versioned_path_rewritten():
|
|||
|
||||
|
||||
def test_quoted_interpreter_path_rewritten():
|
||||
assert (
|
||||
_rewrite('!"/opt/unsloth venv/bin/python" -m pip install peft')
|
||||
== "!pip install peft"
|
||||
)
|
||||
assert _rewrite('!"/opt/unsloth venv/bin/python" -m pip install peft') == "!pip install peft"
|
||||
|
||||
|
||||
def test_indent_preserved():
|
||||
|
|
|
|||
|
|
@ -663,9 +663,7 @@ def test_uv_exact_flag_stripped(shim):
|
|||
def _make_local_project(tmp_path, dirname, project_name):
|
||||
proj = tmp_path / dirname
|
||||
proj.mkdir()
|
||||
(proj / "pyproject.toml").write_text(
|
||||
f'[project]\nname = "{project_name}"\nversion = "1.0"\n'
|
||||
)
|
||||
(proj / "pyproject.toml").write_text(f'[project]\nname = "{project_name}"\nversion = "1.0"\n')
|
||||
return str(proj)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue