Skip to content

feat: port the cli/config/data/history refactor - #224

Merged
willtheorangeguy merged 1 commit into
mainfrom
port/refactor-data-config-history-cli
Aug 29, 2026
Merged

feat: port the cli/config/data/history refactor#224
willtheorangeguy merged 1 commit into
mainfrom
port/refactor-data-config-history-cli

Conversation

@willtheorangeguy

Copy link
Copy Markdown
Owner

Summary

Ports the refactor-data-config-history-cli branch onto current main. That branch shares no git history with main (disjoint root commits — main's history was rewritten/squashed after the branch was cut), so gh pr create against it fails with "no history in common" and a normal merge/rebase isn't possible.

Instead of replaying the branch's own unrelated history, I diffed the two tips directly (git diff origin/main origin/refactor-data-config-history-cli) and found the branch is really just its old fork point plus one real commit, fd8953b "feat: refactor". Everything else the raw tree diff showed (CI bumps, an old docs restructuring) was noise the branch picked up from a stale ancestor, not part of the refactor. This PR ports that one real commit's content onto today's main.

  • Splits the monolithic main.py workout() into:
    • main.py — the interactive REPL
    • cli.py — argparse entry point (-g/--group, --list, --history, --init-config, --config, --version)
    • config.py~/.pyworkout/config.json, deep-merged over built-in defaults
    • data.py — single source of truth for groups/exercises/reps
    • history.py~/.pyworkout/history.json, plus the new history command
  • Packaging consolidated into pyproject.toml (setup.py removed, setup.cfg trimmed to just the pytest config); version bumped 1.2.0 → 1.3.0.
  • CHANGELOG.md: added the v1.3.0 entry above the existing v1.2.0 one.
  • docs/internal/known-issues.md: marked issues Get the Percentages to Work  #2 (skip/stats mutual exclusion), Update README #3 (drifted duplicate help text), and Create a CONTRIBUTING file #4 (video needing source edits) as resolved by this split, with notes on what changed. Issue Fix Timer #1 (GPL-style banner text) is not fixed — the ported code keeps the same wording.
  • Fixes real bugs along the way: triceps list showing glutes exercises, start always reporting 0%, an off-by-one on five-exercise groups, and stats breaking after skip.

Deliberately not touched: main's docs site (README.md, docs/usage.md, docs/commands.md, docs/configuration.md, mkdocs structure), health files (CODE_OF_CONDUCT.md/CONTRIBUTING.md/SECURITY.md/PLANNING.md), CLAUDE.md, and CI workflows. These diverged from the refactor branch independently (main did its own "house contract" docs rewrite after the branch was cut), and main's own known-issues.md already documents that its docs are drifted from the code. Reconciling that content would mean guessing at intended doc house-style rather than porting code, so it's flagged as a follow-up in known-issues.md instead of attempted here.

Test plan

Actions minutes are exhausted, so everything below was run locally against a fresh venv (Python 3.14.7), mirroring .github/workflows/tests.yml and pylint.yml:

  • pip install -r requirements.txt pylint then pytest tests/ -v --cov=. --cov-report=term-missing53 passed, no failures
  • pylint $(git ls-files '*.py')10.00/10
  • python -m build --wheel → builds cleanly with the new py-modules list and pyworkout = "cli:main" entry point
  • Installed the built wheel into a clean venv and smoke-tested the CLI: pyworkout --version, pyworkout --list abs, pyworkout --init-config, pyworkout --history all work as expected

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

https://claude.ai/code/session_01Y38yxr1x54TZQgwdcHUbtE

…nfig-history-cli

Splits the monolithic main.py workout() into main.py (REPL), cli.py
(argparse entry point and flags), config.py (~/.pyworkout/config.json,
deep-merged over built-in defaults), data.py (single source of truth
for groups/exercises/reps), and history.py (~/.pyworkout/history.json).

The refactor-data-config-history-cli branch shares no git history with
main (disjoint roots), so this ports its actual end state - identified
via `git diff origin/main origin/refactor-data-config-history-cli` and
isolating the branch's one real commit (fd8953b "feat: refactor") from
unrelated CI/dependabot/docs-restructuring noise picked up along its
own, differently-rewritten history.

Ported: cli.py, config.py, data.py, history.py, main.py, __init__.py,
__main__.py, tests/{conftest,test_cli,test_config,test_history,test_main}.py,
docs/config.sample.json (new). Reconciled by hand: pyproject.toml (kept
main's [tool.bandit] section, added version bump/keywords/entry point/
py-modules), setup.cfg (dropped [metadata]/[options.entry_points], now
superseded by pyproject.toml), setup.py removed, CHANGELOG.md (new
v1.3.0 entry above v1.2.0), docs/internal/known-issues.md (issues #2
skip/stats, #3 drifted help text, and #4 video needing source edits
are resolved by this split; #1 GPL banner remains open; noted that
README/usage/commands/configuration docs still describe the pre-refactor
model and need a follow-up pass).

Fixes real bugs along the way: triceps `list` showing glutes exercises,
`start` always reporting 0% progress, an off-by-one on five-exercise
groups, and `stats` breaking after `skip`.

Not touched: main's docs/ house-contract site (mkdocs structure,
README.md, usage/commands/configuration/installation pages), health
files (CODE_OF_CONDUCT/CONTRIBUTING/SECURITY/PLANNING), CLAUDE.md,
CI workflows - these diverged from the refactor branch independently
and reconciling their content would mean guessing at documentation
house style rather than porting code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y38yxr1x54TZQgwdcHUbtE
@willtheorangeguy
willtheorangeguy merged commit b62357a into main Aug 29, 2026
10 of 12 checks passed
@willtheorangeguy
willtheorangeguy deleted the port/refactor-data-config-history-cli branch August 29, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant