Repository navigation
Releasing
How to publish a new version to PyPI (and a desktop
app release on GitHub). Every step is a block you can copy and paste. Run them from the
financial_planner folder.
- One-time setup
- 1. Set the version
- 2. Test
- 3. Build and check
- 4. Try it on TestPyPI
- 5. Publish to PyPI
- 6. Tag and push
- 7. Desktop app release (optional)
- 8. Check the release
- How the desktop app gets updates
- Fixing a bad release
- What's in the package
- Create accounts on pypi.org and test.pypi.org (separate accounts) and turn on two-factor authentication.
- Create an API token on each: Account settings › API tokens › Add API token. For the very
first upload the scope must be "Entire account"; after the project exists you can replace it
with a token scoped to
financial-planner. - Save both tokens in
~/.pypirc(paste your tokens in place of thepypi-…placeholders):
cat > ~/.pypirc <<'EOF'
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-PASTE-YOUR-PYPI-TOKEN-HERE
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-PASTE-YOUR-TESTPYPI-TOKEN-HERE
EOF
chmod 600 ~/.pypirc- Make sure the dev environment is installed (it includes
buildandtwine):
pixi install -e devThe version lives in one place, src/financial_planner/__init__.py. Set the new one (use
semantic versioning: bug fix 0.1.1, new features 0.2.0):
pixi run -e dev test-allPython tests and the forecast-math tests must all pass.
Rebuilds the web app, builds the package into dist/ and checks it:
pixi run -e dev dist-checkYou should see Successfully built financial_planner-<version>… and two PASSED lines.
Upload to the test server:
pixi run -e dev publish-testInstall it from there in a throwaway environment and open the demo (dependencies come from the real PyPI):
rm -rf /tmp/fp-test && python3 -m venv /tmp/fp-test
/tmp/fp-test/bin/pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ "financial-planner[desktop]==$VERSION"
/tmp/fp-test/bin/financial_plan init /tmp/fp-test/demo --demo
/tmp/fp-test/bin/financial_plan start /tmp/fp-test/demoThe demo opens in your browser. Press Ctrl+C to stop, then clean up:
rm -rf /tmp/fp-testTestPyPI never accepts the same version twice; to retry, bump to e.g. 0.1.1rc1 in step 1.
pixi run -e dev publishThis rebuilds and checks first, then uploads. The project page is https://pypi.org/project/financial-planner/.
Commit the version change, tag the release and push both:
git add src/financial_planner/__init__.py pixi.lock
git commit -m "(release) __init__.py: v$VERSION"
git tag -a "v$VERSION" -m "v$VERSION"
git push && git push --tagsCreate the GitHub release (needs the GitHub CLI, gh auth login once):
gh release create "v$VERSION" --title "v$VERSION" --generate-notes dist/*Build the no-code Mac apps (Apple Silicon and Intel) and attach them to the release:
bash installer/macos/make-dist.sh
gh release upload "v$VERSION" installer/dist/FinancialPlanner-macos-arm64.zip installer/dist/FinancialPlanner-macos-x86_64.zipRebuild your own installed app from the release too:
bash installer/macos/make-local-app.shInstall from the real PyPI in a fresh environment:
rm -rf /tmp/fp-check && python3 -m venv /tmp/fp-check
/tmp/fp-check/bin/pip install "financial-planner[desktop]==$VERSION"
/tmp/fp-check/bin/financial_plan --help
rm -rf /tmp/fp-checkPeople can now install it with pip install financial-planner (add [desktop] for the Mac
menu-bar app), or in a pixi project with:
[pypi-dependencies]
financial-planner = { version = ">=0.1", extras = ["desktop"] }The desktop app installs financial-planner from PyPI (installer/manifest/pixi.toml
allows any 0.x version), so:
- A new install gets the newest 0.x release; no git or developer tools needed.
- Check for Updates… in the menu-bar icon picks up each new PyPI release. Pushing to GitHub alone doesn't reach desktop users; publishing does.
- Going to
1.0: widen the range in the manifest (e.g.">=0.1,<2") and rebuild the app zips (step 7), since existing apps won't cross the upper bound.
PyPI never lets you re-upload a version number. Fix the problem, bump the version (e.g. 0.1.1)
and release again. To hide a broken version from installs, yank it on its PyPI page
(Manage › Releases › Options › Yank); it stays downloadable only for people who pin it exactly.
- The Python package with the built web app (
src/financial_planner/web/, so users don't need Node), the app icons, the blank plan template and the demo plan (copied into the package at build time). - The
financial_plancommand. - Optional extras:
desktop(pystray + Pillow for the menu-bar app) anddev(pytest, httpx).
The source package (.tar.gz) leaves out web/node_modules, built app zips and the README's
assets/ folder.
Getting started
Using the app
Setting up your plan
- Plan Folder
- Settings Editor
- Data Sources (CSVs)
- Categories
- Categorizing and Rules
- Setup with an AI Assistant
Reference