Skip to content

Commit 6bec0a2

Browse files
committed
Initial plan for building this CLI too.
1 parent 306e2c0 commit 6bec0a2

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ ipython_config.py
9595
#Pipfile.lock
9696

9797
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
98+
# uv.lock is committed to version control for reproducible installs.
99+
# uv.lock
102100

103101
# poetry
104102
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.

plans/001-talk-python-cli.plan.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ features work. The CLI should:
4646

4747
Package lives at the repo root (not nested in a subdirectory):
4848

49+
Managed with **uv** — no manual venv creation, use `uv run`, `uv sync`, `uv lock`, etc.
50+
4951
```
5052
talk-python-cli/
5153
├── pyproject.toml
54+
├── uv.lock # Committed to version control
5255
├── LICENSE
5356
├── README.md
5457
├── .gitignore
@@ -73,6 +76,8 @@ talk-python-cli/
7376

7477
## Dependencies (pyproject.toml)
7578

79+
Created via `uv init`, then `uv add cyclopts httpx rich` and `uv add --dev pytest pytest-httpx`.
80+
7681
```toml
7782
[project]
7883
name = "talk-python-cli"
@@ -103,6 +108,8 @@ requires = ["hatchling"]
103108
build-backend = "hatchling.build"
104109
```
105110

111+
The `uv.lock` file is committed for reproducible installs.
112+
106113
## CLI commands
107114

108115
```
@@ -172,19 +179,19 @@ def search(query: str, *, limit: int = 10):
172179

173180
## Implementation order
174181

175-
1. Create package structure: `pyproject.toml`, `src/talk_python_cli/__init__.py`
182+
1. `uv init` — create `pyproject.toml`, then add dependencies with `uv add`
176183
2. Implement `client.py` (HTTP JSON-RPC client)
177184
3. Implement `formatting.py` (output rendering)
178185
4. Implement `app.py` + command modules (`episodes.py`, `guests.py`, `courses.py`)
179186
5. Add `__main__.py` for `python -m` support
180-
6. Add tests with mocked HTTP responses
187+
6. Add tests with mocked HTTP responses (`uv add --dev pytest pytest-httpx`)
181188
7. Verify against live server
182189

183190
## Verification
184191

185-
1. **Install**: `pip install -e ".[dev]"` (or `uv pip install -e ".[dev]"`)
186-
2. **Unit tests**: `pytest tests/ -v`
187-
3. **Smoke test**: `talkpython episodes recent --limit 3`
188-
4. **JSON output**: `talkpython --format json episodes recent --limit 3`
189-
5. **Piped output**: `talkpython episodes recent | head` — should auto-detect JSON format
190-
6. **Module entry**: `python -m talk_python_cli episodes recent --limit 3`
192+
1. **Sync**: `uv sync` (installs all deps including dev group)
193+
2. **Unit tests**: `uv run pytest tests/ -v`
194+
3. **Smoke test**: `uv run talkpython episodes recent --limit 3`
195+
4. **JSON output**: `uv run talkpython --format json episodes recent --limit 3`
196+
5. **Piped output**: `uv run talkpython episodes recent | head` — should auto-detect JSON format
197+
6. **Module entry**: `uv run python -m talk_python_cli episodes recent --limit 3`

0 commit comments

Comments
 (0)