Skip to content

Commit 2fefac9

Browse files
committed
CHORE: Clean up unused imports and fix cross-platform build script detection
- Remove unused 'sys' and 'Path' imports from build_backend.py - Remove unused 'os' import from setup.py - Fix find_pybind_dir() to check for platform-appropriate build script (build.bat on Windows, build.sh on Unix)
1 parent 7966b90 commit 2fefac9

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

build_ddbc/build_backend.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
backend-path = ["."]
1212
"""
1313

14-
import sys
15-
from pathlib import Path
16-
1714
# Import setuptools build backend - we'll wrap its functions
1815
from setuptools.build_meta import (
1916
build_wheel as _setuptools_build_wheel,

build_ddbc/compiler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,15 @@ def find_pybind_dir() -> Path:
6363
Path.cwd() / "mssql_python" / "pybind",
6464
]
6565

66+
# Check for platform-appropriate build script
67+
build_script = "build.bat" if sys.platform.startswith("win") else "build.sh"
68+
6669
for path in possible_paths:
67-
if path.exists() and (path / "build.sh").exists():
70+
if path.exists() and (path / build_script).exists():
6871
return path
6972

7073
raise FileNotFoundError(
71-
"Could not find mssql_python/pybind directory. "
74+
f"Could not find mssql_python/pybind directory with {build_script}. "
7275
"Make sure you're running from the project root."
7376
)
7477

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
pip install -e . # Editable install with auto-compile
1515
"""
1616

17-
import os
1817
import sys
1918

2019
from setuptools import setup, find_packages

0 commit comments

Comments
 (0)