mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 20:27:15 +01:00
`sickdays gui` opens a Tk window modelled on the phone's Sick days screen: a Monday-first month calendar (cat-2 fill, a dot for kept lockers, past days faded and inert), a five-switch panel for the clicked day, and the "Marked sick" list with "Kept: ..." lines. A free day is refused with the phone's wording. Each write starts sync_quietly() on a non-daemon thread. The window class is "sickdays" and Escape closes it. sickdays.gui.KeepPanel is the panel on its own, a plain tk.Frame with no root, mainloop, grab or wm_* call, so screen-locker can embed it under its lock-screen grab. `import sickdays` and the rest of the CLI never import tkinter: the CLI loads the gui module by name only for `gui`, and a subprocess test checks this. The tests drive real Tk on a withdrawn root, and CI now runs them under xvfb-run, as gatelock's CI does. Adds a sickdays.desktop launcher, which install.sh installs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PAhbNszs5JKdtnD4uBi3xp
50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
name: sickdays tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
# The workflow's own file counts as sickdays: editing only this file would
|
|
# otherwise trigger nothing, so a fix to the job itself could never prove
|
|
# itself.
|
|
paths: ['sickdays/**', '.github/workflows/sickdays-tests.yml']
|
|
pull_request:
|
|
branches: [main]
|
|
paths: ['sickdays/**', '.github/workflows/sickdays-tests.yml']
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: sickdays
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
cache: pip
|
|
cache-dependency-path: sickdays/requirements.txt
|
|
|
|
# crdt-sync and freedays are siblings in this repo, so they install from
|
|
# the checkout rather than from a tag -- CI must test what is on this
|
|
# branch, not what was last released. Deliberately NOT gatelock:
|
|
# importing it pulls in tkinter, and this job has no display precisely
|
|
# because sickdays must work without one.
|
|
- name: Install the sibling packages
|
|
run: pip install ../crdt-sync && pip install --no-deps ../freedays
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt && pip install --no-deps -e .
|
|
|
|
# The library draws nothing, but sickdays.gui (0.3.0) does, and its
|
|
# tests drive real Tk: option names and Checkbutton/variable wiring are
|
|
# Tk's own behaviour. Headless they skip, taking coverage with them --
|
|
# so the runner gets a virtual display, as gatelock's does.
|
|
- name: Install a virtual X display
|
|
run: sudo apt-get update && sudo apt-get install -y xvfb
|
|
|
|
- name: Run tests with coverage
|
|
run: xvfb-run -a -s "-screen 0 1600x1200x24" python -m pytest -v
|