Skip to content

Commit 10e6bb0

Browse files
authored
Merge pull request #23 from abhiksark/dev
release: v0.3.0 — rename to pythonlings
2 parents a6567e3 + c265d74 commit 10e6bb0

149 files changed

Lines changed: 3564 additions & 1650 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ labels: bug
1515
- OS:
1616
- Python:
1717
- Terminal:
18-
- Pylings version:
18+
- Pythonlings version:

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
- run: pip install -e ".[dev]"
2020
- run: pytest -v
21-
- run: pylings --root tests/fixtures/passing_curriculum verify
21+
- run: pythonlings --root tests/fixtures/passing_curriculum verify
2222
- run: python -m pip install build
2323
- run: python -m build
2424
- run: python -m pip install --force-reinstall dist/*.whl
25-
- run: pylings init --path /tmp/pylings-workspace
26-
- run: pylings --root /tmp/pylings-workspace list
25+
- run: pythonlings init --path /tmp/pythonlings-workspace
26+
- run: pythonlings --root /tmp/pythonlings-workspace list

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
- run: python -m pip install build
3131
- run: python -m build
3232
- run: python -m pip install --force-reinstall dist/*.whl
33-
- run: pylings --version
34-
- run: pylings init --path /tmp/pylings-workspace
35-
- run: pylings --root /tmp/pylings-workspace list
36-
- run: pylings --root /tmp/pylings-workspace solution variables1
37-
- run: pylings --root /tmp/pylings-workspace reset variables1 --yes
38-
- run: pylings --root tests/fixtures/passing_curriculum verify
33+
- run: pythonlings --version
34+
- run: pythonlings init --path /tmp/pythonlings-workspace
35+
- run: pythonlings --root /tmp/pythonlings-workspace list
36+
- run: pythonlings --root /tmp/pythonlings-workspace solution variables1
37+
- run: pythonlings --root /tmp/pythonlings-workspace reset variables1 --yes
38+
- run: pythonlings --root tests/fixtures/passing_curriculum verify
3939
- uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
# Pylings runtime state (root install and any nested fixture roots)
132-
.pylings/
131+
# Pythonlings runtime state (root install and any nested fixture roots)
132+
.pythonlings/
133133
.superpowers/
134134
.worktrees
135135

136-
# Local artifacts from older pylings workspaces; not part of this package.
137-
/pylings/.gitignore
138-
/pylings/.git/
139-
/pylings/.pylings.toml
140-
/pylings/exercises/
136+
# Local artifacts from older pythonlings workspaces; not part of this package.
137+
/pythonlings/.gitignore
138+
/pythonlings/.git/
139+
/pythonlings/.pythonlings.toml
140+
/pythonlings/exercises/

AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
## Project Structure & Module Organization
44

5-
`pylings/` contains the installable application package. Core exercise loading, workspace setup, state, reset, solutions, and runner logic live in `pylings/core/`; CLI entry points are in `pylings/cli.py` and `pylings/__main__.py`; Textual screens/widgets live in `pylings/screens/` and `pylings/widgets/`; `pylings/pylings.tcss` holds TUI styles.
5+
`pythonlings/` contains the installable application package. Core exercise loading, workspace setup, state, reset, solutions, and runner logic live in `pythonlings/core/`; CLI entry points are in `pythonlings/cli.py` and `pythonlings/__main__.py`; Textual screens/widgets live in `pythonlings/screens/` and `pythonlings/widgets/`; `pythonlings/pythonlings.tcss` holds TUI styles.
66

77
Curriculum files are split between `exercises/<topic>/<exercise>.py` for learner code, `checks/<topic>/<exercise>.py` for hidden assertions, and `solutions/<exercise>.py` for reference answers. Keep these trees aligned with `info.toml`, which defines order, hints, and docs URLs. Tests live in `tests/unit/`, `tests/integration/`, and `tests/tui/`, with fixtures in `tests/fixtures/`.
88

99
## Build, Test, and Development Commands
1010

11-
- `pip install -e ".[dev]"`: install pylings locally with pytest dependencies.
12-
- `pylings init --path ./learn-python`: create a self-contained learner workspace.
13-
- `pylings`, `pylings topics`, `pylings list`: launch the TUI or inspect progress.
14-
- `pylings run variables1`, `pylings dry-run variables1`, `pylings solution variables1`: test exercise and solution flows.
15-
- `pylings --root tests/fixtures/passing_curriculum verify`: smoke-test a known passing fixture.
11+
- `pip install -e ".[dev]"`: install pythonlings locally with pytest dependencies.
12+
- `pythonlings init --path ./learn-python`: create a self-contained learner workspace.
13+
- `pythonlings`, `pythonlings topics`, `pythonlings list`: launch the TUI or inspect progress.
14+
- `pythonlings run variables1`, `pythonlings dry-run variables1`, `pythonlings solution variables1`: test exercise and solution flows.
15+
- `pythonlings --root tests/fixtures/passing_curriculum verify`: smoke-test a known passing fixture.
1616
- `python -m pytest -q`: run the full suite configured in `pyproject.toml`.
1717
- `python -m build`: build source and wheel distributions.
1818

@@ -22,7 +22,7 @@ Use Python 3.11+ idioms and 4-space indentation. Prefer small, typed functions w
2222

2323
## Testing Guidelines
2424

25-
Use pytest for all tests; async tests are supported by `pytest-asyncio` in auto mode. Add unit tests for core behavior, integration tests for CLI/workspace flows, and TUI tests for Textual interactions. When changing curriculum, update `exercises/`, `checks/`, `solutions/`, and `info.toml`, then run relevant pytest files plus `pylings --root tests/fixtures/passing_curriculum verify`.
25+
Use pytest for all tests; async tests are supported by `pytest-asyncio` in auto mode. Add unit tests for core behavior, integration tests for CLI/workspace flows, and TUI tests for Textual interactions. When changing curriculum, update `exercises/`, `checks/`, `solutions/`, and `info.toml`, then run relevant pytest files plus `pythonlings --root tests/fixtures/passing_curriculum verify`.
2626

2727
## Commit & Pull Request Guidelines
2828

CHANGELOG.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
# Changelog
22

3-
All notable changes to this project are documented here. Pylings follows
3+
All notable changes to this project are documented here. Pythonlings follows
44
Semantic Versioning.
55

6+
## [0.3.0] - 2026-06-10
7+
8+
### Added
9+
10+
- The in-app reference (`F5`) now bundles a second complementary section from
11+
the official Python documentation for every topic, roughly tripling each
12+
topic's offline reference content.
13+
14+
### Changed
15+
16+
- The project is renamed from pylings to **pythonlings**. The PyPI package
17+
(previously `python-learnings`), the CLI command (previously `pylings`),
18+
and the Python package are all now `pythonlings`. Existing workspaces are
19+
migrated automatically: a legacy `.pylings/` state directory is renamed to
20+
`.pythonlings/` on the next run, preserving progress and reset snapshots.
21+
- The README and quick-start now describe the built-in editor accurately:
22+
checks rerun as you type in the TUI editor.
23+
24+
### Fixed
25+
26+
- Running `pythonlings` outside a workspace now explains how to create one
27+
with `pythonlings init` instead of a bare "info.toml not found".
28+
29+
### Removed
30+
31+
- The unused `watchdog` dependency, for a lighter install.
32+
633
## [0.2.0] - 2026-05-30
734

835
### Added
@@ -34,7 +61,7 @@ Semantic Versioning.
3461
- 292 Python exercises across 31 topics with mirrored hidden checks.
3562
- Bundled local Python documentation snippets generated from official docs.
3663
- In-app documentation modal with `F5`, `Esc`, and `O` keyboard flow.
37-
- PyPI distribution name `python-learnings`, which installs the `pylings` command.
64+
- PyPI distribution name `pythonlings`, which installs the `pythonlings` command.
3865
- Contributor guide, screenshots, release flow notes, and MIT license.
3966

4067
### Verified

CLAUDE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
Pythonlings is "Rustlings for Python": a terminal TUI (Textual) where learners fix small broken exercises and checks rerun on save. Published on PyPI as `pythonlings` (formerly `python-learnings`; the unrelated `pylings` PyPI name belongs to a different project).
6+
7+
## Commands
8+
9+
```bash
10+
pip install -e ".[dev]" # local install with pytest deps
11+
12+
python -m pytest -q # full suite
13+
python -m pytest tests/unit/test_runner.py -q # one file
14+
python -m pytest tests/unit/test_state.py::test_name -q # one test
15+
16+
pylings --root tests/fixtures/passing_curriculum verify # smoke-test: all solutions pass their checks
17+
18+
python -m build # sdist + wheel
19+
```
20+
21+
Manual testing of flows: `pylings init --path ./learn-python` (create a learner workspace), `pylings` (TUI), `pylings run variables1`, `pylings dry-run variables1`, `pylings solution variables1`, `pylings hint`, `pylings list`, `pylings topics`, `pylings reset`. `--root` points any command at an arbitrary workspace (used heavily by tests against `tests/fixtures/`).
22+
23+
## Architecture
24+
25+
Two distinct trees in this repo:
26+
27+
1. **The application**`pylings/` (installable package)
28+
2. **The curriculum** — repo-root `exercises/`, `checks/`, `solutions/`, and `info.toml`
29+
30+
At build time, hatch `force-include` maps the curriculum into the wheel as `pylings/curriculum/` (see `pyproject.toml`). `pylings init` copies that bundled curriculum into a self-contained learner workspace; progress lives in `<workspace>/.pylings/state.json` (written atomically, with `.bak` recovery on corruption).
31+
32+
### Curriculum model
33+
34+
Each exercise is a triple that must stay in sync, plus a manifest entry:
35+
36+
- `exercises/<topic>/<name>.py` — the broken code the learner edits, containing the `# I AM NOT DONE` marker (defined in `core/exercise.py`)
37+
- `checks/<topic>/<name>.py` — hidden bare `assert` statements (not pytest)
38+
- `solutions/<name>.py` — reference answer
39+
- `info.toml` — ordered `[[exercises]]` entries with `name`, `path`, `hint`, `docs` URL; this file is the source of truth for exercise order and topics
40+
41+
When changing curriculum, update all four, then run the relevant tests plus `pylings --root tests/fixtures/passing_curriculum verify`. Exercise names are topic + ordinal (`variables1`, `collections10`).
42+
43+
### How checks run (`core/runner.py`)
44+
45+
An exercise passes when a generated runner script `exec()`s the exercise source and then the check source in a shared namespace, in a fresh subprocess with a 5s timeout. The check sees the exercise's variables directly — that's why checks are bare asserts. Passing checks alone aren't enough: the learner must also remove `# I AM NOT DONE` to advance.
46+
47+
### Layering
48+
49+
- `pythonlings/core/` — all filesystem, manifest, state, reset, solutions, and runner logic. No UI imports. (Checks rerun on a debounce in the TUI editor, not a filesystem watcher.)
50+
- `pylings/screens/` and `pylings/widgets/` — Textual UI only; `pylings/app.py` wires them up; `pylings.tcss` holds styles.
51+
- `pylings/cli.py` — argparse subcommands; entry point `pylings = "pylings.cli:main"`.
52+
53+
Keep UI behavior in screens/widgets and behavior logic in core — tests depend on this split (`tests/unit/` for core, `tests/integration/` for CLI/workspace flows, `tests/tui/` for Textual pilot tests, fixtures in `tests/fixtures/`).
54+
55+
## Conventions
56+
57+
- `requires-python = ">=3.9"`: guard newer-stdlib usage (e.g. `tomllib` falls back to `tomli` in `core/manifest.py`); `from __future__ import annotations` at the top of modules.
58+
- Async tests run under `pytest-asyncio` in auto mode (configured in `pyproject.toml`).
59+
- Tests are named `test_<behavior>.py` / `test_<expected_behavior>`.
60+
- Commits use conventional prefixes (`feat:`, `fix:`, `docs:`, `chore:`); work flows through `feature/*``dev``main`.
61+
- `AGENTS.md` holds the same contributor guidelines in long form.

CNAME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pylings.abhik.ai
1+
pythonlings.abhik.ai

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Code of Conduct
22

3-
Pylings follows the Contributor Covenant Code of Conduct, version 2.1.
3+
Pythonlings follows the Contributor Covenant Code of Conduct, version 2.1.
44

55
## Our Standards
66

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Contributing
22

3-
Pylings is actively developed and **open to contributors** — beginners welcome.
4-
The fastest way in is a [`good first issue`](https://github.com/abhiksark/pylings/issues?q=is%3Aopen+label%3A%22good+first+issue%22).
3+
Pythonlings is actively developed and **open to contributors** — beginners welcome.
4+
The fastest way in is a [`good first issue`](https://github.com/abhiksark/pythonlings/issues?q=is%3Aopen+label%3A%22good+first+issue%22).
55

66
## Where the work is
77

88
- **[0.3.0 roadmap](docs/roadmap/0.3.0.md)** — the current focus (wider adoption
99
for beginners). Each roadmap issue is written to be picked up cold: it has
1010
context, scope, the exact files to touch, and how to verify.
11-
- Browse open issues by label: [`good first issue`](https://github.com/abhiksark/pylings/issues?q=is%3Aopen+label%3A%22good+first+issue%22),
12-
[`help wanted`](https://github.com/abhiksark/pylings/issues?q=is%3Aopen+label%3A%22help+wanted%22).
11+
- Browse open issues by label: [`good first issue`](https://github.com/abhiksark/pythonlings/issues?q=is%3Aopen+label%3A%22good+first+issue%22),
12+
[`help wanted`](https://github.com/abhiksark/pythonlings/issues?q=is%3Aopen+label%3A%22help+wanted%22).
1313

1414
## Claiming an issue
1515

@@ -23,8 +23,8 @@ No need to wait for a formal assignment; claiming by comment is enough.
2323
## Development Setup
2424

2525
```bash
26-
git clone git@github.com:abhiksark/pylings.git
27-
cd pylings
26+
git clone git@github.com:abhiksark/pythonlings.git
27+
cd pythonlings
2828
pip install -e ".[dev]" # or: uv pip install -e ".[dev]"
2929
python -m pytest -q
3030
```

0 commit comments

Comments
 (0)