Skip to content

feat: add Python pip package distribution with cross-platform binaries#6

Merged
beonde merged 1 commit intomainfrom
feature/python-pip
Sep 29, 2025
Merged

feat: add Python pip package distribution with cross-platform binaries#6
beonde merged 1 commit intomainfrom
feature/python-pip

Conversation

@beonde
Copy link
Member

@beonde beonde commented Sep 29, 2025

Add Python pip package distribution with cross-platform binaries

🎯 Overview

Adds a new distribution channel for Capiscio CLI through Python's pip package manager, making the tool accessible to Python users without requiring Node.js.

🚀 What's New

  • New installation method: pip install capiscio
  • Zero Python dependencies: Pure wrapper around pre-built binaries
  • Cross-platform support: All 5 platform variants included (Linux/macOS/Windows × x64/ARM64)
  • Automatic CI/CD: Publishes to PyPI on GitHub releases using trusted publishing

📦 Package Details

  • PyPI Package Name: capiscio
  • Command: capiscio (same as npm version)
  • Size: ~80MB (includes all platform binaries)
  • Python Support: 3.7+ (no runtime dependencies)
  • Platform Detection: Automatically runs correct binary for user's system

🛠️ Technical Implementation

Python Package Structure

  • python-package/pyproject.toml - Package configuration
  • python-package/capiscio/__init__.py - Package metadata
  • python-package/capiscio/cli.py - Platform detection & binary execution
  • python-package/capiscio/binaries/ - All cross-platform binaries
    • capiscio-linux-x64
    • capiscio-darwin-x64
    • capiscio-darwin-arm64
    • capiscio-win-x64.exe
    • capiscio-win-arm64.exe
  • python-package/README.md

CI/CD Integration

  • GitHub Actions: publish-python.yml workflow
  • Trusted Publishing: Secure PyPI publishing without API tokens
  • Version Sync: Automatically uses version from package.json
  • Build Pipeline: Integrates with existing binary build process

Build Process

New script: npm run build:python

  1. Builds all Node.js binaries
  2. Copies binaries to Python package
  3. Updates version information
  4. Builds Python wheel and source distribution

📋 User Experience

Three Installation Options

  1. npm (Node.js required): npm install -g capiscio-cli
  2. pip (Python 3.7+ required): pip install capiscioNEW
  3. Direct download (no dependencies): Binary from GitHub releases

Consistent CLI Experience

All installation methods provide the same capiscio command with identical functionality.

🔧 Files Added

  • python-package/ - Complete Python package structure
  • .github/workflows/publish-python.yml - CI/CD for PyPI publishing
  • scripts/build-python-package.js - Build script with binary integration
  • PYTHON_PUBLISHING.md - Setup and troubleshooting documentation

📝 Files Modified

  • package.json - Added build:python script
  • README.md - Added pip installation instructions
  • .gitignore - Added Python package build artifacts

✅ Testing

  • ✅ Local testing on Windows ARM64
  • ✅ Python wrapper correctly detects platform
  • ✅ All binaries execute properly
  • ✅ Package builds successfully (~80MB)
  • ✅ pip installation works: capiscio --version returns 1.1.0
  • ✅ PyPI trusted publishing configured for capiscio project

🎉 Impact

This expands Capiscio's reach to the Python ecosystem, making it accessible to data scientists, Python developers, and DevOps teams who prefer pip over npm, while maintaining the same zero-dependency binary approach that makes Capiscio fast and reliable.

- Add complete Python package structure with pyproject.toml
- Create Python CLI wrapper that auto-detects platform and runs appropriate binary
- Include all 5 platform binaries (Linux/macOS/Windows  x64/ARM64) in package
- Add GitHub Actions workflow for automated PyPI publishing on releases
- Configure PyPI trusted publishing for secure, tokenless deployment
- Add npm script 'build:python' for local testing and development
- Update README with pip installation option alongside npm and direct download
- Add comprehensive documentation for PyPI publishing setup
- Users can now install via: pip install capiscio
- Maintains feature parity with npm package while requiring no Node.js runtime

Files added:
- python-package/ - Complete Python package structure
- .github/workflows/publish-python.yml - CI/CD for PyPI publishing
- scripts/build-python-package.js - Build script with binary integration
- PYTHON_PUBLISHING.md - Setup and troubleshooting guide

Files modified:
- package.json - Added build:python script
- README.md - Added pip installation instructions
- .gitignore - Added Python package build artifacts
@beonde beonde merged commit 4fe88df into main Sep 29, 2025
5 checks passed
@beonde beonde deleted the feature/python-pip branch September 29, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant