Skip to content

Commit ff27162

Browse files
committed
refactor: apply lint
1 parent 62e7884 commit ff27162

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

tests/test_build_backend_sdist.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,9 @@ def test_sdist_includes_dirs_and_files_exactly_as_expected_when_produced_via_uv_
581581
def sdist_built_at_runtime_with_build(my_run_subprocess) -> Path:
582582
"""Build project (at runtime) with 'build module', and return SDist tar.gz file."""
583583
# Create a temporary directory
584+
import os
584585
import tempfile
585586
import typing as t
586-
import os
587587

588588
# Make directory unique for pytest-xdist parallel execution
589589
worker_id = os.environ.get("PYTEST_XDIST_WORKER", "master")
@@ -608,28 +608,28 @@ def sdist_built_at_runtime_with_build(my_run_subprocess) -> Path:
608608
str(OUT_DIR),
609609
str(project_path),
610610
]
611-
611+
612612
# Add isolation to prevent cross-worker conflicts
613613
env = os.environ.copy()
614614
env["BUILD_BACKEND_ISOLATION"] = "true"
615615
env["SETUPTOOLS_SCM_DEBUG"] = "1" if worker_id != "master" else "0"
616-
616+
617617
print(f"\n[Worker {worker_id}] Building with command: {' '.join(COMMAND_LINE_ARGS)}")
618618
print(f"[Worker {worker_id}] Output directory: {OUT_DIR}")
619619
print(f"[Worker {worker_id}] Project path: {project_path}")
620620
print(f"[Worker {worker_id}] Python executable: {PYTHON}")
621621
print(f"[Worker {worker_id}] Current working directory: {os.getcwd()}")
622-
622+
623623
# Check for potential lock files that could cause conflicts
624624
lock_files = [
625625
project_path / "poetry.lock",
626626
project_path / ".build-lock",
627-
project_path / "pyproject.toml.lock"
627+
project_path / "pyproject.toml.lock",
628628
]
629629
for lock_file in lock_files:
630630
if lock_file.exists():
631631
print(f"[Worker {worker_id}] Lock file exists: {lock_file}")
632-
632+
633633
result = my_run_subprocess(*COMMAND_LINE_ARGS, check=False, env=env)
634634

635635
print()
@@ -643,24 +643,32 @@ def sdist_built_at_runtime_with_build(my_run_subprocess) -> Path:
643643
print("=" * 60)
644644
print("STDERR:")
645645
stderr_content = result.stderr if result.stderr else "(empty)"
646-
print(repr(stderr_content)) # Use repr to see hidden characters
646+
print(repr(stderr_content)) # Use repr to see hidden characters
647647
print(stderr_content)
648648
print("=" * 60)
649-
649+
650650
if result.exit_code != 0:
651651
print(f"[Worker {worker_id}] BUILD FAILED!")
652652
print(f"Command: {' '.join(COMMAND_LINE_ARGS)}")
653653
print(f"Working directory: {project_path}")
654654
print(f"Output directory exists: {OUT_DIR.exists()}")
655655
if OUT_DIR.exists():
656-
print(f"Output directory contents: {list(OUT_DIR.iterdir()) if OUT_DIR.is_dir() else 'Not a directory'}")
657-
656+
print(
657+
f"Output directory contents: {list(OUT_DIR.iterdir()) if OUT_DIR.is_dir() else 'Not a directory'}"
658+
)
659+
658660
# Additional debugging for CI environment
659661
print(f"Environment variables of interest:")
660-
debug_env_vars = ["PYTHONPATH", "PATH", "HOME", "BUILD_BACKEND_ISOLATION", "SETUPTOOLS_SCM_DEBUG"]
662+
debug_env_vars = [
663+
"PYTHONPATH",
664+
"PATH",
665+
"HOME",
666+
"BUILD_BACKEND_ISOLATION",
667+
"SETUPTOOLS_SCM_DEBUG",
668+
]
661669
for var in debug_env_vars:
662670
print(f" {var}: {env.get(var, 'NOT SET')}")
663-
671+
664672
assert result.exit_code == 0, (
665673
f"[Worker {worker_id}] Build failed with exit code {result.exit_code}\n"
666674
f"Command: {' '.join(COMMAND_LINE_ARGS)}\n"

0 commit comments

Comments
 (0)