Contributing
Thank you for considering contributing to Megaloader. This guide covers the essentials for developers to get started and contribute effectively.
We review for correctness, test coverage, style, performance, documentation, and type safety. Automated checks run on PRs, followed by maintainer review.
Getting started
Prerequisites
- Python 3.10+ (3.13+ recommended)
- uv package manager (v0.9.10+)
- mise (optional, for task management)
- Git
Development setup
Fork and clone the repository:
git clone https://github.com/totallynotdavid/megaloader
cd megaloaderInstall dependencies:
mise install
mise run syncuv sync --all-packages --extra devVerify setup:
mise run test-unituv run pytest packages/core/tests/unitThe workspace uses uv's workspace feature for editable installs.
Development workflow
Code style
We use Ruff for formatting and linting:
mise run formatruff format .
ruff check --fix .Guidelines: 88-character lines, Python 3.10 target, absolute imports, type hints required for core.
Type checking
Strict mypy checking:
mise run lintuv run mypy .Testing
Run tests:
mise run test-unit # Fast unit tests
mise run test # All tests including liveuv run pytest packages/core/tests/unit/test_item.py -v
uv run pytest packages/core/tests -vOrganization:
tests/unit/- Fast unit tests (no network)tests/live/- Live tests with@pytest.mark.live- Use
uv run pytest packages/core/tests --run-livefor live tests
Commit messages
Follow conventional commits:
feat: add new platform support
fix: resolve Bunkr download issue
docs: update installation guide
test: add Cyberdrop plugin tests
refactor: simplify retry logicContributing code
Pull request process
- Create a feature branch:
git checkout -b feature/your-feature - Make changes and commit:
git commit -m "type: description" - Push to your fork:
git push origin feature/your-feature - Create a Pull Request on GitHub
Requirements:
- All tests pass
- Code formatted with Ruff
- Type hints updated
- Documentation updated
- New features have tests
See GitHub's PR documentation for details.
Areas for contribution
High priority
- Bug fixes for core plugins (Bunkr, PixelDrain, Cyberdrop, GoFile)
- Test coverage improvements
- Documentation updates
Medium priority
- New core plugins with stable APIs
- CLI enhancements
- Performance optimizations
Low priority
- Extended plugins for additional platforms
- API demo improvements
Adding features
New core plugin
Checklist:
- Create plugin in
packages/core/megaloader/plugins/ - Inherit
BasePlugin, implementextract() - Register in
PLUGIN_REGISTRY - Add unit tests in
tests/unit/ - Add live tests with
@pytest.mark.live - Update
docs/reference/platforms.md
New CLI command
- Add to
packages/cli/megaloader_cli/main.py - Update
docs/reference/cli.mdanddocs/guide/cli.md
New core feature
- Discuss in GitHub Discussions
- Write tests first (TDD)
- Implement in core library
- Update
docs/reference/api.md
Contributing to documentation
We use VitePress. Setup:
cd docs
bun installRun dev server:
mise run docs-servebun run docs:devGuidelines: Clear language, complete examples, relative links. Update docs with code changes.
Validate Python code snippets in documentation:
mise run validate-snippetspython scripts/validate-code-snippets.pyThis checks syntax of all Python code blocks in markdown files. Automatically runs as part of mise run check.
Maintenance tasks
Updating tool versions
Update Python, uv, ruff, or other tool versions consistently across the repository.
Preview changes (dry run):
python scripts/update-tool-versions.py --tool python --version 3.14.0 --dry-runUpdate Python exact version in mise.toml, workflows, .python-version:
python scripts/update-tool-versions.py --tool python --version 3.14.0Update uv across mise.toml and all workflows:
python scripts/update-tool-versions.py --tool uv --version 0.10.0Update Python test matrix in workflows:
python scripts/update-tool-versions.py --tool python-matrix --matrix-versions "3.13,3.14"Update minimum Python requirement (>=3.10 a >=3.11):
python scripts/update-tool-versions.py --tool python-min --version 3.11Supported tools: python, python-min, python-matrix, uv, ruff, bun, biome, mypy, pytest.
The script uses pattern-based matching to update versions across .python-version, mise.toml, all pyproject.toml files, and GitHub Actions workflows. Always use --dry-run first to preview changes.
Releasing
I use GitHub Actions to automate the release workflows for both the core library and the CLI (see release-core.yml and release-cli.yml). No manual steps are required beyond tagging. Both workflows use PyPI's Trusted Publisher system.
Before tagging a release, you should test builds locally:
mise run build-binFor core library releases:
Update the version in
packages/core/pyproject.toml.Commit and push the change.
Tag the release and push the tag:
bashgit tag vcore-X.Y.Z git push origin vcore-X.Y.Z
The workflow automatically publishes the core package to PyPI.
For CLI releases:
Update the version in
packages/cli/pyproject.toml.Commit and push the change.
Tag the release and push the tag:
bashgit tag vcli-X.Y.Z git push origin vcli-X.Y.Z
The workflow builds cross-platform binaries, publishes to PyPI, and, additionally, creates a GitHub release. For security reasons, I have to manually approve the publishing step.
All releases are available at: https://github.com/totallynotdavid/megaloader/releases
Getting help
For questions, ideas, or feedback, use GitHub Discussions. If you encounter a bug, please report it there first. Maintainers may convert it to an Issue if necessary.