Issue #32 - Unknown command errors: - Register get_board_extents in command_routes (was implemented but not registered) - Implement find_component command with pattern matching on reference/value/footprint - Add schemas for both commands Issue #30 - PCB routing replication (Phase 1): - Implement get_component_pads: returns all pads with positions, nets, shapes - Implement get_pad_position: returns specific pad coordinates and properties - Implement query_traces: query traces by net, layer, or bounding box - Add schemas for all new commands Issue #26 - Schematic workflow: - Add missing schemas for add_schematic_connection, add_schematic_net_label, connect_to_net, get_net_connections, and generate_netlist Issue #19 - macOS Python path detection: - Add Python 3.13 to version detection - Add alternative KiCAD installation paths (user Applications, capitalization variants) - Add Homebrew Python fallback paths for Apple Silicon and Intel Macs - Expand platform_helper.py with same improvements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,13 +75,39 @@ function findPythonExecutable(scriptPath: string): string {
|
||||
return kicadPython;
|
||||
}
|
||||
} else if (isMac) {
|
||||
// macOS: Try KiCAD's bundled Python (check multiple versions)
|
||||
const kicadPythonVersions = ['3.9', '3.10', '3.11', '3.12'];
|
||||
for (const version of kicadPythonVersions) {
|
||||
const kicadPython = `/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/${version}/bin/python3`;
|
||||
if (existsSync(kicadPython)) {
|
||||
logger.info(`Found KiCAD bundled Python at: ${kicadPython}`);
|
||||
return kicadPython;
|
||||
// macOS: Try KiCAD's bundled Python (check multiple versions and locations)
|
||||
const kicadPythonVersions = ['3.9', '3.10', '3.11', '3.12', '3.13'];
|
||||
|
||||
// Standard KiCAD installation paths
|
||||
const kicadAppPaths = [
|
||||
'/Applications/KiCad/KiCad.app',
|
||||
'/Applications/KiCAD/KiCad.app', // Alternative capitalization
|
||||
`${process.env.HOME}/Applications/KiCad/KiCad.app`, // User Applications folder
|
||||
];
|
||||
|
||||
// Check all KiCAD app locations with all Python versions
|
||||
for (const appPath of kicadAppPaths) {
|
||||
for (const version of kicadPythonVersions) {
|
||||
const kicadPython = `${appPath}/Contents/Frameworks/Python.framework/Versions/${version}/bin/python3`;
|
||||
if (existsSync(kicadPython)) {
|
||||
logger.info(`Found KiCAD bundled Python at: ${kicadPython}`);
|
||||
return kicadPython;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to Homebrew Python (if pcbnew is installed via pip)
|
||||
const homebrewPaths = [
|
||||
'/opt/homebrew/bin/python3', // Apple Silicon
|
||||
'/usr/local/bin/python3', // Intel Mac
|
||||
'/opt/homebrew/bin/python3.12',
|
||||
'/opt/homebrew/bin/python3.11',
|
||||
];
|
||||
|
||||
for (const path of homebrewPaths) {
|
||||
if (existsSync(path)) {
|
||||
logger.info(`Found Homebrew Python at: ${path} (ensure pcbnew is importable)`);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
} else if (isLinux) {
|
||||
|
||||
Reference in New Issue
Block a user