Parking Radio tools
Tools that automate operating Parking Radio, an independent non-profit radio in Québec City.
They're commands of parkingradio, a command-line tool that acts on the site on behalf of an admin. The site itself
is in parkingradio/website.
Design
See docs/design for what the tool does: its
conventions, and each of its commands.
Installing
With uv:
uv tool install parkingradio
parkingradio --help
uv tool upgrade parkingradio installs the latest version. uv tool install parkingradio==0.1.0 installs a given
version, e.g. to go back to the previous one. uv tool upgrade then stays on it: uv tool install parkingradio@latest
installs the latest version again. The releases list the versions.
Connecting to the site
The tool acts on the site whose address PARKINGRADIO_SITE gives, e.g. https://parking.radio for production, or
--site, before the command, e.g. parkingradio --site http://localhost:5173 auth login for a development server. It
has no default, so that it never acts on production by accident. Each site has its own connection.
It acts on the site as an admin, who connects it once, from their browser, on the computer it runs on:
parkingradio auth login
This opens the site's page where you allow "Parking Radio CLI" to act as you, once logged in as an admin. If the browser
doesn't open, open the link that the command shows. The tool then keeps the connection's tokens in your system's
credential store (the Windows Credential Manager, the macOS Keychain, or the Secret Service on Linux).
parkingradio auth status # whether the tool is connected, and whether the connection works
parkingradio auth logout # disconnects the tool, and deletes its tokens
The connection ends when it's disconnected from the site's Admins page, under "Vos applications connectées", or after 90
days without being used: run parkingradio auth login again.
Development
The tool is a Python package, parkingradio, in src/parkingradio, managed with uv, which installs the Python it needs
when it isn't there. Its dependencies are locked in uv.lock.
uv sync # creates .venv, with the tool and the development dependencies
uv run parkingradio --help # runs the tool from the checkout
uv run pytest # runs the tests
uv run ruff check # lints
uv run ruff format # formats
CI runs these checks: see .github/workflows/test.yml. The tests never reach a site, open a browser, or use the
system's credential store: they use fakes of them (see tests/conftest.py). To try the tool on a development server of
the site (see the site's README), use --site or PARKINGRADIO_SITE, as in Connecting to the
site.
Releasing
A release publishes the version in pyproject.toml to PyPI, from which
admins install the tool. Only release once what it relies on is deployed on the production site.
- Bump the version in a PR, e.g. with
uv version --bump minor, which also updates uv.lock, and merge it.
- Tag the merged commit with the version, and push the tag:
git switch main && git pull
git tag v0.2.0
git push origin v0.2.0
- The tag runs
.github/workflows/release.yml, which checks and builds the release, then waits for a maintainer to
approve publishing it, in the repository's pypi environment. Once it's published, it creates the tag's GitHub
Release, with notes generated from the PRs merged since the previous one.