diff options
| author | Yuval Adam <_@yuv.al> | 2026-07-24 12:54:41 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2026-07-24 12:54:41 +0200 |
| commit | 8732722aca10833d8799ada6f82ed334ce2e085d (patch) | |
| tree | d1998d73e612e9585c80dd816288aaee633f9b70 | |
| parent | b509b20e05dcc481b20ae1e8181553e860ca5e34 (diff) | |
Run development directly with system Python
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | .python-version | 1 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rwxr-xr-x | scripts/enable-ibus-test | 5 | ||||
| -rwxr-xr-x | scripts/install-dev | 12 | ||||
| -rwxr-xr-x | scripts/install-extension | 2 | ||||
| -rwxr-xr-x | scripts/parley | 5 | ||||
| -rwxr-xr-x | scripts/parley-ibus | 5 | ||||
| -rwxr-xr-x | scripts/parleyctl | 5 | ||||
| -rwxr-xr-x | scripts/parleyd | 5 | ||||
| -rw-r--r-- | uv.lock | 12 |
11 files changed, 33 insertions, 26 deletions
@@ -1,6 +1,5 @@ __pycache__/ *.py[cod] -.venv/ build/ dist/ *.egg-info/ diff --git a/.python-version b/.python-version deleted file mode 100644 index 6324d40..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.14 @@ -76,18 +76,16 @@ This is not yet a polished end-user release. See [SPEC.md](SPEC.md) for architec ## Development -Use Arch's system Python through `uv` so the environment can access system PyGObject bindings: +Parley has no third-party Python package dependencies. It runs directly with Arch's system Python and system PyGObject bindings: ```bash -uv venv --python /usr/bin/python --system-site-packages -uv pip install -e . ./scripts/install-dev ``` Run tests and inspect the daemon: ```bash -uv run python -m unittest discover -s tests +PYTHONPATH=src /usr/bin/python -m unittest discover -s tests systemctl --user restart parley.service journalctl --user -u parley.service -f ``` diff --git a/scripts/enable-ibus-test b/scripts/enable-ibus-test index b0a32cc..d95e296 100755 --- a/scripts/enable-ibus-test +++ b/scripts/enable-ibus-test @@ -5,7 +5,10 @@ state_dir=${XDG_STATE_HOME:-$HOME/.local/state}/parley dropin_dir=${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user/parley.service.d mkdir -p "$state_dir" "$dropin_dir" -previous=$(ibus engine) +previous=$(ibus engine 2>/dev/null || true) +if [[ -z "$previous" ]]; then + previous=xkb:us::eng +fi if [[ "$previous" != "parley" ]]; then printf '%s\n' "$previous" > "$state_dir/previous-ibus-engine" fi diff --git a/scripts/install-dev b/scripts/install-dev index e0fbb99..c5afea9 100755 --- a/scripts/install-dev +++ b/scripts/install-dev @@ -6,19 +6,19 @@ unit_dir=${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user dbus_dir=${XDG_DATA_HOME:-$HOME/.local/share}/dbus-1/services cd "$root" -uv venv --python /usr/bin/python --system-site-packages --clear -uv pip install --editable . +/usr/bin/python -c 'import gi' >/dev/null mkdir -p "$unit_dir" "$dbus_dir" -sed "s|^ExecStart=.*|ExecStart=$root/.venv/bin/parleyd|" \ +sed "s|^ExecStart=.*|ExecStart=$root/scripts/parleyd|" \ data/systemd/parley.service > "$unit_dir/parley.service" -sed "s|^ExecStart=.*|ExecStart=$root/.venv/bin/parley-ibus|" \ +sed "s|^ExecStart=.*|ExecStart=$root/scripts/parley-ibus|" \ data/systemd/parley-ibus.service > "$unit_dir/parley-ibus.service" install -m644 data/dbus/org.parley.Transcription1.service \ "$dbus_dir/org.parley.Transcription1.service" systemctl --user daemon-reload -systemctl --user enable --now parley.service parley-ibus.service +systemctl --user enable parley.service parley-ibus.service +systemctl --user restart parley.service parley-ibus.service echo "Installed local development service from $root" -echo "Run: uv run parleyctl status" +echo "Run: $root/scripts/parleyctl status" diff --git a/scripts/install-extension b/scripts/install-extension index 2d42288..e32e9da 100755 --- a/scripts/install-extension +++ b/scripts/install-extension @@ -14,7 +14,7 @@ fi ln -s "$root/extension" "$destination" cd "$root" -uv run python - "$uuid" <<'PY' +/usr/bin/python - "$uuid" <<'PY' import sys from gi.repository import Gio diff --git a/scripts/parley b/scripts/parley new file mode 100755 index 0000000..9213cbd --- /dev/null +++ b/scripts/parley @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +export PYTHONPATH="$root/src${PYTHONPATH:+:$PYTHONPATH}" +exec /usr/bin/python -m parley.cli "$@" diff --git a/scripts/parley-ibus b/scripts/parley-ibus new file mode 100755 index 0000000..22ca2c1 --- /dev/null +++ b/scripts/parley-ibus @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +export PYTHONPATH="$root/src${PYTHONPATH:+:$PYTHONPATH}" +exec /usr/bin/python -m parley.ibus_engine "$@" diff --git a/scripts/parleyctl b/scripts/parleyctl new file mode 100755 index 0000000..2973c88 --- /dev/null +++ b/scripts/parleyctl @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +export PYTHONPATH="$root/src${PYTHONPATH:+:$PYTHONPATH}" +exec /usr/bin/python -m parley.ctl "$@" diff --git a/scripts/parleyd b/scripts/parleyd new file mode 100755 index 0000000..9e66846 --- /dev/null +++ b/scripts/parleyd @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) +export PYTHONPATH="$root/src${PYTHONPATH:+:$PYTHONPATH}" +exec /usr/bin/python -m parley.daemon "$@" diff --git a/uv.lock b/uv.lock deleted file mode 100644 index 1e05ee2..0000000 --- a/uv.lock +++ /dev/null @@ -1,12 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.14" - -[options] -exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. -exclude-newer-span = "P7D" - -[[package]] -name = "parley-dictation" -version = "0.1.0.dev0" -source = { editable = "." } |
