Add bundled binary for CLI using PyInstaller
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 172
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
It would be nice to have a binary file for the CLI tool available for download (in Releases section, next to the archive of the source code) for systems without python installed. I've used pyinstaller in my local fork, and it seems to work just fine for my use case, but 2 things arise:
- I think this would require another test harness; and
- I think this breaks runtime plugin support.
This might be a dealbreaker, so an alternative to bundling might be to just add instructions to the installation section of the docs. Here's what I've used:
% uv venv
% source .venv/bin/activate.fish
% uv pip install -e . pyinstaller
This creates the environment and installs dependencies. Then create cli.py with the following content:
from sqlite_utils.cli import cli
if __name__ == "__main__":
cli()
And then bundle and do a quick sanity check:
% pyinstaller --onefile --name sqlite-utils --copy-metadata sqlite-utils cli.py
% cd dist/
% ./sqlite-utils --version
% ./sqlite-utils create-table my.db people id integer name text height float --pk id --strict
Thanks for sqlite-utils :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
First clarify whether the goal is a PyInstaller binary in Releases or installation instructions, since the issue leaves both options open and flags plugin and test-harness concerns. Start from the proposed cli.py entry point importing sqlite_utils.cli.cli, then run the listed PyInstaller commands and sanity checks for --version and create-table. Done means the chosen approach is documented and verified, including its plugin and testing implications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- build-system, cli, release
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100