From a50a60cb52335774148dd90f2d27f4593cb2ceba Mon Sep 17 00:00:00 2001 From: Omair Date: Tue, 14 Apr 2026 23:21:44 -0400 Subject: [PATCH] fix: align Python version floor with KiCad's macOS bundle (3.9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit KiCad ships Python 3.9 on macOS (both v9 and v10), and `pcbnew.so` is compiled against that interpreter. The previous `>=3.10` floor was unreachable on macOS and docs referenced nonexistent `python3.11/site-packages` paths. Lower the floor and correct the docs; no source changes needed — all 49 files in `python/` already compile clean on 3.9. Also add `.venv/` to `.gitignore` (dotted form used by `python -m venv`). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 2 +- .gitignore | 1 + CONTRIBUTING.md | 2 +- README.md | 6 +++--- config/macos-config.example.json | 2 +- docs/CLIENT_CONFIGURATION.md | 2 +- pyproject.toml | 6 +++--- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 606f32a..d1a2333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: strategy: matrix: os: [ubuntu-24.04, ubuntu-22.04] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout code diff --git a/.gitignore b/.gitignore index 1f7f33a..e5dfd7c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ dmypy.json # Virtual Environments venv/ +.venv/ env/ ENV/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 72b2abd..27dd657 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ Thank you for your interest in contributing to the KiCAD MCP Server! This guide - **KiCAD 9.0 or higher** - [Download here](https://www.kicad.org/download/) - **Node.js v18+** - [Download here](https://nodejs.org/) -- **Python 3.10+** - Should come with KiCAD, or install separately +- **Python 3.9+** - Comes bundled with KiCAD (macOS builds ship Python 3.9; Linux/Windows builds ship Python 3.11) - **Git** - For version control ### Platform-Specific Setup diff --git a/README.md b/README.md index cd7b3b6..2e4e8d4 100644 --- a/README.md +++ b/README.md @@ -430,9 +430,9 @@ See [Freerouting Guide](docs/FREEROUTING_GUIDE.md) for setup and usage. - Download from [nodejs.org](https://nodejs.org/) - Verify: `node --version` and `npm --version` -**Python 3.10 or Higher** +**Python 3.9 or Higher** -- Usually included with KiCAD +- Comes bundled with KiCAD (macOS builds ship Python 3.9; Linux/Windows builds ship Python 3.11) - Required packages (auto-installed): - kicad-python (kipy) >= 0.5.0 (IPC API support, optional but recommended) - kicad-skip >= 0.1.0 (schematic support) @@ -692,7 +692,7 @@ Edit configuration file: - **Linux:** `/usr/lib/kicad/lib/python3/dist-packages` - **Windows:** `C:\Program Files\KiCad\9.0\lib\python3\dist-packages` -- **macOS:** `/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages` +- **macOS:** `/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages` #### Linux Python Detection diff --git a/config/macos-config.example.json b/config/macos-config.example.json index 5d2286c..755a87b 100644 --- a/config/macos-config.example.json +++ b/config/macos-config.example.json @@ -5,7 +5,7 @@ "args": ["/Users/YOUR_USERNAME/MCP/KiCAD-MCP-Server/dist/index.js"], "env": { "NODE_ENV": "production", - "PYTHONPATH": "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.11/site-packages", + "PYTHONPATH": "/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages", "LOG_LEVEL": "info", "KICAD_AUTO_LAUNCH": "false" }, diff --git a/docs/CLIENT_CONFIGURATION.md b/docs/CLIENT_CONFIGURATION.md index bcfd088..cc67ecf 100644 --- a/docs/CLIENT_CONFIGURATION.md +++ b/docs/CLIENT_CONFIGURATION.md @@ -241,7 +241,7 @@ PYTHONPATH=python python3 -c "from utils.platform_helper import PlatformHelper; ```bash # Typical location -/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.11/site-packages +/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.9/site-packages # Find dynamically find /Applications/KiCad -name "pcbnew.py" -type f diff --git a/pyproject.toml b/pyproject.toml index fd99a12..a353a50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,18 @@ [project] name = "kicad-mcp-server" version = "2.1.0" -requires-python = ">=3.10" +requires-python = ">=3.9" [tool.black] line-length = 100 -target-version = ["py310"] +target-version = ["py39"] [tool.isort] profile = "black" line_length = 100 [tool.mypy] -python_version = "3.10" +python_version = "3.9" warn_return_any = false warn_unused_configs = true check_untyped_defs = false