Skip to content

Package Chirp for pip install (PyPI distribution) #35

@TamirEliav

Description

@TamirEliav

Background

Chirp currently ships as a Windows EXE built with PyInstaller (dist/Chirp.exe) and as a cloned-repo installation (pip install -r requirements.txt && python -m chirp). Neither is great for:

  • Python users on Linux/macOS who want the app via their usual toolchain.
  • Scripted/remote deployments where pip install chirp-audio (or similar) is the obvious incantation.
  • Reusing Chirp's DSP/trigger modules as a library in other projects — currently requires a git submodule or manual PYTHONPATH.

Aim

Publish Chirp as a standard installable Python package so pip install chirp-recorder (name TBD — chirp is taken on PyPI) gets you a working chirp CLI entry point and importable modules.

Proposed Implementation

Package metadata

  • Add pyproject.toml with PEP 621 metadata (project name, version driven from chirp.__version__, description, license, Python requirement, authors).
  • Use setuptools or hatchling as the build backend — hatchling is lighter and handles version-from-file cleanly.
  • Move install requirements from requirements.txt into [project.dependencies]. Keep requirements.txt as a dev/pinned-versions file for developers.
  • Entry point: [project.scripts] chirp = "chirp.main:main" so pip install gives a chirp command in PATH.
  • Include manual.html as package data.

PyPI name

chirp is already taken. Candidate names:

  • chirp-recorder
  • chirp-audio
  • chirp-trigger
  • bioacoustic-chirp

Pick one and reserve it on TestPyPI first.

Build + publish

  • Add build/twine as dev dependencies.
  • GitHub Actions workflow: on tag push (v*), build sdist + wheel, upload to PyPI via pypa/gh-action-pypi-publish. Use trusted publishing (OIDC) rather than API tokens.
  • Test installation on Linux, macOS, and Windows via the workflow before publishing.

PyInstaller compatibility

  • Keep chirp.py shim at the repo root so dist/Chirp.exe still builds the same way.
  • Verify PyInstaller picks up the package correctly when installed from wheel.

Docs

  • README section: "Install from PyPI" with the one-line pip install … command.
  • Link to the manual; mention conda env name is optional (not required post-pip-install).

Tests

  • Add a workflow step that does pip install -e . and then runs pytest tests/ -q — confirms the package layout is valid for editable installs.
  • Smoke-test: after install, chirp --version prints the right version and python -c "import chirp; print(chirp.__version__)" works.

Notes

Low-risk, mostly plumbing, but high-value for distribution. The post-Phase-1 package layout (chirp/ with subpackages) is already pip-friendly — the work is mostly metadata and CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions