build: Add Cython compilation support for wheel obfuscation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- build-system, release
Direzione di ricerca
Esamina le PR di airbyte-ops-mcp e connector-builder-mcp a cui si fa riferimento, quindi analizza la struttura dei package di PyAirbyte e i workflow esistenti di pubblicazione e release. Determina se enable_cython_build.py e strip_source_from_wheel.py possono essere adattati, quali moduli devono essere esclusi e se è possibile produrre wheel specifiche per la piattaforma senza compromettere uv sync o le installazioni editable.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Add Cython compilation to the PyAirbyte build pipeline so that PyPI-published wheels contain compiled .so/.pyd extensions instead of readable .py source files, providing basic code obfuscation for distribution from the private repo.
Context
This pattern has been prototyped in the airbyte-ops-mcp and connector-builder-mcp repos:
- Ops MCP PR: https://github.com/airbytehq/airbyte-ops-mcp/pull/343
- Connector Builder MCP PR: https://github.com/airbytehq/connector-builder-mcp/pull/208
- Related ops-mcp issue: https://github.com/airbytehq/airbyte-ops-mcp/issues/346
The approach uses:
hatch-cythonizebuild hook (maintained fork of hatch-cython) to compile.py→.c→.soduring wheel builds- Build-time injection of Cython config (not stored in
pyproject.toml) to avoid breakinguv sync/ editable installs - Post-build source stripping to remove
.pyfiles from wheels where compiled.socounterparts exist - Exclusion of modules that break under Cython compilation (e.g., MCP/Pydantic presentation layers)
Key Learnings from Ops MCP Implementation
- Cython config must NOT be in
pyproject.toml— it runs during editable installs (uv sync), breaking CI workflows. Solution: inject at build time via a script. - Pydantic/FastMCP modules must be excluded — Cython-compiled functions (
cyfunction) don't expose type annotations the same way, breaking Pydantic schema generation. __init__.pyfiles must be excluded — required for Python package structure.- Platform-specific wheels — must build per OS (Linux, macOS) and Python version (3.10, 3.11, 3.12).
Action Items
- Evaluate whether this pattern should be applied to PyAirbyte
- If yes, adapt the
enable_cython_build.pyandstrip_source_from_wheel.pyscripts for PyAirbyte's package structure - Identify which modules (if any) need to be excluded from compilation
- Integrate with existing publish/release workflows
Devin session: https://app.devin.ai/sessions/7c8622f9452141d1bbad93f74079278f
Requested by: @aaronsteers
- Lingua principale
- Python
- Stelle
- 343
- Fork
- 77
- Merge medio
- 1g 4h
- PR unite (30g)
- 54
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di airbytehq/PyAirbyte
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Tutte le issue di airbytehq/PyAirbyte
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
PolicyEngine/policyengine-us#9559 ·