Skip to content

Commit d514d6c

Browse files
claudewilltheorangeguy
authored andcommitted
Update CLAUDE.md with comprehensive codebase documentation
Add CI workflow details, file reference table, test class inventory, entry point documentation, and coding convention details to give AI assistants a complete picture of the project structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NS99cT6Wysv4m21LXqihx
1 parent 6c0ba48 commit d514d6c

1 file changed

Lines changed: 48 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
ProgramVer is a Python/tkinter GUI app that replicates Microsoft's `winver` — it displays a customizable window with program version info, copyright notices, and buttons to open a License or EULA file in a secondary window. It is published to PyPI and is designed to be forked and customized per-program.
7+
ProgramVer is a Python/tkinter GUI app that replicates Microsoft's `winver` — it displays a customizable window with program version info, copyright notices, and buttons to open a License or EULA file in a secondary window. It is published to PyPI as `programver` and is designed to be forked and customized per-program. Current version: **1.9.0**.
88

99
## Commands
1010

@@ -25,10 +25,10 @@ python -m pytest tests/ -v
2525
### Run a single test
2626
```bash
2727
# Linux
28-
xvfb-run -a python -m pytest tests/test_main.py::TestProgramVer::test_name -v
28+
xvfb-run -a python -m pytest tests/test_main.py::TestClassName::test_name -v
2929

3030
# Windows / macOS
31-
python -m pytest tests/test_main.py::TestProgramVer::test_name -v
31+
python -m pytest tests/test_main.py::TestClassName::test_name -v
3232
```
3333

3434
### Run tests with coverage
@@ -46,22 +46,62 @@ pylint $(git ls-files '*.py')
4646
All application logic lives in a single module: **`main.py`**. It exposes four functions:
4747

4848
- `get_resource_path(filename)` — resolves paths relative to the module file (needed for PyPI installs where the CWD may differ from the package location).
49-
- `ProgramVer()` — builds and runs the main tkinter window: logo images, version/copyright labels, and two buttons.
49+
- `ProgramVer()` — builds and runs the main tkinter window: logo images, version/copyright labels, and two buttons. Calls `window.mainloop()` so it blocks until the window is closed.
5050
- `openLicense()` — opens `LICENSE.txt` in a new `Tk()` window.
5151
- `openEULA()` — opens `EULA.txt` in a new `Tk()` window.
5252

53-
`__main__.py` is the entry point; it just calls `ProgramVer()`. `setup.cfg` / `pyproject.toml` register the `programver` console script pointing at `main:ProgramVer`.
53+
### Entry points
54+
55+
- `__main__.py` — calls `ProgramVer()`, enabling `python -m programver`.
56+
- `__init__.py` — declares `__all__ = ["main"]` for PyPI packaging.
57+
- `setup.cfg` / `pyproject.toml` / `setup.py` — all register the `programver` console script pointing at `main:ProgramVer`.
58+
59+
### Key files
60+
61+
| Path | Purpose |
62+
|------|---------|
63+
| `main.py` | All application logic |
64+
| `tests/test_main.py` | Unit tests (mocked tkinter) |
65+
| `imgs/` | Image assets (`dfdlogo.gif`, `pythonpoweredlengthgif.gif`) |
66+
| `LICENSE.txt` | License text displayed at runtime by `openLicense()` |
67+
| `EULA.txt` | EULA text displayed at runtime by `openEULA()` |
68+
| `pytest.ini` | Pytest configuration (testpaths, addopts) |
69+
| `.deepsource.toml` | DeepSource static analysis config (uses `black` formatter) |
5470

5571
**Customization intent:** The strings inside `ProgramVer()` (window title, version label, trademark text, license blurb) and the image files in `imgs/` are expected to be replaced when the project is forked. `LICENSE.txt` and `EULA.txt` in the repo root are the files opened at runtime.
5672

5773
## Testing
5874

59-
Tests are in `tests/test_main.py` using `unittest.TestCase`. All tkinter calls are mocked with `unittest.mock.patch` so tests run headlessly. The `# pylint: disable=import-error, invalid-name` comments at the top of both `main.py` and `test_main.py` are intentional — do not remove them.
75+
Tests are in `tests/test_main.py` using `unittest.TestCase` with five test classes:
76+
77+
- `TestGetResourcePath` — path resolution helper
78+
- `TestOpenLicense` — license window creation and content display
79+
- `TestOpenEULA` — EULA window creation and content display
80+
- `TestProgramVer` — main window components (images, labels, buttons, commands)
81+
- `TestModuleIntegration` — import and callable checks
82+
83+
All tkinter calls are mocked with `unittest.mock.patch` so tests run headlessly.
84+
85+
### CI Workflows (`.github/workflows/`)
86+
87+
| Workflow | Trigger | What it does |
88+
|----------|---------|--------------|
89+
| `tests.yml` | push/PR to `master` | Runs pytest across Ubuntu/Windows/macOS x Python 3.9-3.12; uploads coverage to Codecov |
90+
| `pylint.yml` | any push | Runs pylint on all `.py` files (Python 3.9) |
91+
| `codeql-analysis.yml` | push/PR to `master`, weekly schedule | CodeQL security scanning |
92+
| `push-to-pypi.yml` | GitHub release published | Builds and publishes to PyPI |
6093

61-
CI runs the full matrix: Ubuntu, Windows, macOS × Python 3.9–3.12. Coverage target is 100% for `main.py`.
94+
The default branch is `master`.
6295

6396
## Coding Conventions
6497

6598
- 4-space indentation (no tabs).
6699
- Semantic Versioning for releases.
67-
- Version number appears in `main.py` (the `info` label), `pyproject.toml`, `setup.cfg`, and `setup.py` — update all four on a version bump.
100+
- Version number appears in **four places** — update all on a version bump:
101+
1. `main.py` (the `info` label text)
102+
2. `pyproject.toml` (`[project] version`)
103+
3. `setup.cfg` (`[metadata] version`)
104+
4. `setup.py` (`version` kwarg)
105+
- The `# pylint: disable=import-error, invalid-name` comments at the top of `main.py`, `__main__.py`, `__init__.py`, and `test_main.py` are intentional — do not remove them.
106+
- `test_main.py` also disables `wrong-import-position`, `import-outside-toplevel`, and `unused-argument` — do not remove these either.
107+
- Black is configured as the code formatter via `.deepsource.toml`.

0 commit comments

Comments
 (0)