fix: align Python version floor with KiCad's macOS bundle (3.9)

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 <noreply@anthropic.com>
This commit is contained in:
Omair
2026-04-14 23:21:44 -04:00
parent eea43d18f1
commit a50a60cb52
7 changed files with 11 additions and 10 deletions

View File

@@ -45,7 +45,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-24.04, ubuntu-22.04] 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: steps:
- name: Checkout code - name: Checkout code

1
.gitignore vendored
View File

@@ -39,6 +39,7 @@ dmypy.json
# Virtual Environments # Virtual Environments
venv/ venv/
.venv/
env/ env/
ENV/ ENV/

View File

@@ -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/) - **KiCAD 9.0 or higher** - [Download here](https://www.kicad.org/download/)
- **Node.js v18+** - [Download here](https://nodejs.org/) - **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 - **Git** - For version control
### Platform-Specific Setup ### Platform-Specific Setup

View File

@@ -430,9 +430,9 @@ See [Freerouting Guide](docs/FREEROUTING_GUIDE.md) for setup and usage.
- Download from [nodejs.org](https://nodejs.org/) - Download from [nodejs.org](https://nodejs.org/)
- Verify: `node --version` and `npm --version` - 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): - Required packages (auto-installed):
- kicad-python (kipy) >= 0.5.0 (IPC API support, optional but recommended) - kicad-python (kipy) >= 0.5.0 (IPC API support, optional but recommended)
- kicad-skip >= 0.1.0 (schematic support) - kicad-skip >= 0.1.0 (schematic support)
@@ -692,7 +692,7 @@ Edit configuration file:
- **Linux:** `/usr/lib/kicad/lib/python3/dist-packages` - **Linux:** `/usr/lib/kicad/lib/python3/dist-packages`
- **Windows:** `C:\Program Files\KiCad\9.0\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 #### Linux Python Detection

View File

@@ -5,7 +5,7 @@
"args": ["/Users/YOUR_USERNAME/MCP/KiCAD-MCP-Server/dist/index.js"], "args": ["/Users/YOUR_USERNAME/MCP/KiCAD-MCP-Server/dist/index.js"],
"env": { "env": {
"NODE_ENV": "production", "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", "LOG_LEVEL": "info",
"KICAD_AUTO_LAUNCH": "false" "KICAD_AUTO_LAUNCH": "false"
}, },

View File

@@ -241,7 +241,7 @@ PYTHONPATH=python python3 -c "from utils.platform_helper import PlatformHelper;
```bash ```bash
# Typical location # 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 dynamically
find /Applications/KiCad -name "pcbnew.py" -type f find /Applications/KiCad -name "pcbnew.py" -type f

View File

@@ -1,18 +1,18 @@
[project] [project]
name = "kicad-mcp-server" name = "kicad-mcp-server"
version = "2.1.0" version = "2.1.0"
requires-python = ">=3.10" requires-python = ">=3.9"
[tool.black] [tool.black]
line-length = 100 line-length = 100
target-version = ["py310"] target-version = ["py39"]
[tool.isort] [tool.isort]
profile = "black" profile = "black"
line_length = 100 line_length = 100
[tool.mypy] [tool.mypy]
python_version = "3.10" python_version = "3.9"
warn_return_any = false warn_return_any = false
warn_unused_configs = true warn_unused_configs = true
check_untyped_defs = false check_untyped_defs = false