Skip to content

Latest commit

 

History

History
207 lines (158 loc) · 5.26 KB

File metadata and controls

207 lines (158 loc) · 5.26 KB

Audio-Hotplug Migration - Files Created

Overview

All files needed to migrate audio-hotplug to a separate repository and publish to PyPI have been created.

Created Files

1. Documentation

  • MIGRATION_GUIDE.md - Comprehensive step-by-step migration guide
  • QUICK_START.md - Fast-track guide (~35 minutes total)
  • CHANGELOG.md - Version history template

2. GitHub Actions CI/CD

.github/workflows/tests.yml

  • Runs tests on Windows, macOS, Linux
  • Tests Python 3.10, 3.11, 3.12, 3.13
  • Uploads coverage to Codecov
  • Uses uv for fast dependency management

.github/workflows/publish.yml

  • Publishes to PyPI on release tags
  • Supports manual TestPyPI publishing
  • Builds and validates packages
  • Uses PyPI API tokens for authentication

.github/workflows/pre-commit.yml

  • Runs pre-commit hooks on PRs
  • Ensures code quality standards

3. Configuration Files

.pre-commit-config.yaml

  • isort, black, flake8, pyupgrade
  • Consistent with LedFx standards
  • pre-commit.ci integration enabled

MANIFEST.in

  • Ensures all necessary files included in distribution
  • Excludes pycache and .pyc files

Next Steps

Immediate (Today):

  1. Follow QUICK_START.md - Fastest path (35 minutes)

    # Start here:
    Get-Content C:\mine\development\ledfx\LedFx\audio-hotplug\QUICK_START.md
  2. Or use MIGRATION_GUIDE.md - Detailed explanations

    # For more details:
    Get-Content C:\mine\development\ledfx\LedFx\audio-hotplug\MIGRATION_GUIDE.md

This Week:

  1. Extract repository with git history
  2. Set up GitHub repository (LedFx/audio-hotplug)
  3. Configure PyPI API tokens
  4. Test publish to TestPyPI
  5. Publish v0.1.0 to PyPI

Next Week:

  1. Create clean PR in LedFx repository
  2. Verify integration works with PyPI package
  3. Merge and celebrate! 🎉

File Locations

All files are in: C:\mine\development\ledfx\LedFx\audio-hotplug\

audio-hotplug/
├── .github/
│   └── workflows/
│       ├── tests.yml          # Multi-platform testing
│       ├── publish.yml        # PyPI publishing
│       └── pre-commit.yml     # Code quality checks
├── .pre-commit-config.yaml   # Pre-commit hooks config
├── MANIFEST.in                # Distribution file list
├── MIGRATION_GUIDE.md         # Detailed migration guide
├── QUICK_START.md             # Fast-track guide
├── CHANGELOG.md               # Version history
└── (existing files...)

Key Benefits of This Approach

✅ Clean Separation

  • audio-hotplug becomes standalone package
  • Can be used by other projects
  • Independent versioning and releases

✅ Clean LedFx PR

  • ~10 files instead of 203
  • Only actual integration changes
  • No formatting noise

✅ Professional Package

  • Automated testing on 3 platforms
  • Automated PyPI publishing
  • Pre-commit hooks for quality
  • Comprehensive documentation

✅ Future-Proof

  • Easy to update audio-hotplug independently
  • Can add features without affecting LedFx
  • Other projects can benefit

Expected Timeline

Phase Duration Description
Extract repo 5 min Git commands to separate history
GitHub setup 3 min Create repository
PyPI accounts 10 min Create accounts and API tokens
Test build 5 min Verify local build works
TestPyPI 5 min Test publication flow
PyPI publish 2 min Tag release, GitHub Actions runs
Clean LedFx PR 10 min New branch with PyPI integration
Total ~40 min End-to-end completion

Testing the Migration

Before Merging LedFx PR:

  1. Verify PyPI package installs:

    pip install audio-hotplug
    python -c "from audio_hotplug import create_monitor; print('✓')"
  2. Test in LedFx:

    cd C:\mine\development\ledfx\LedFx
    git checkout feat/audio-hotplug-pypi-integration
    uv sync
    uv run python -m ledfx --offline -vv
    # Change audio devices and verify callbacks work
  3. Review PR:

    • Should show ~10 files changed
    • All tests passing
    • No formatting noise

Troubleshooting

Common Issues:

  1. git filter-repo not found

    pip install git-filter-repo
  2. PyPI token not working

    • Use __token__ as username
    • Token as password
    • Token must start with pypi-
  3. Import fails

    # Wrong:
    import audio-hotplug
    
    # Correct:
    import audio_hotplug
  4. CI tests fail

    • Check GitHub Actions logs
    • Platform-specific issues vary
    • May need to mock hardware on CI

Support

  • Migration questions: Check MIGRATION_GUIDE.md
  • Quick reference: Check QUICK_START.md
  • Technical issues: Check TESTING.md in audio-hotplug/
  • Git issues: See troubleshooting sections

Success Criteria

✅ audio-hotplug published to PyPI ✅ Tests passing on all platforms ✅ LedFx PR shows <15 files changed ✅ LedFx works with PyPI package ✅ Audio device hotplugging works ✅ No formatting issues in PR

Ready to Start?

# Begin migration now:
cd C:\mine\development\ledfx\LedFx\audio-hotplug
code QUICK_START.md

# Or read details first:
code MIGRATION_GUIDE.md

Good luck! 🚀