rglob 2.0 — PR Summary¶
This page mirrors the body of PR #6, preserved in-repo for historical reference. The PR description on GitHub uses repo-root paths; this page uses doc-tree-relative paths so it renders correctly under MkDocs.
Summary¶
Top-to-bottom modernization shipping rglob 2.0, delivered across six
phases per modernization-roadmap.md:
- Packaging hygiene — PEP 621 + hatchling, single-sourced
__version__,src/layout, full doc set (CHANGELOG / CONTRIBUTING / SECURITY / CODE_OF_CONDUCT / AGENTS), ASCII-banner README with badges. - Tooling overhaul — ruff (lint + format) replaces pylint, mypy
--strictwithpy.typed, pytest as primary suite (behave kept as parallel BDD job per ADR-0007), aggregated 100% coverage via Codecov (ADR-0006), three GitHub workflows (ci.yml3.11–3.14 × ubuntu/macos/windows,release.ymlOIDC trusted publishing,docs.ymlgh-pages), MkDocs Material site with Mermaid diagrams, Makefile, pre-commit hooks, renovate, codecov. - Core API on
os.scandir— newfind()/find_all()with filters forexclude/max_depth/hidden/follow_symlinks/case_sensitive/sort/on_error,**recursive globs, symlink-loop detection via realpath memo (ADR-0008), deterministic sort-by-default, OS-aware case sensitivity, hypothesis property tests. - Typer + Rich CLI — byte-compatible
find/lcount/tsize, plus new filter flags (-E,-d,-H,-L, case toggle), output formats (--json,--jsonl,-0,--format), shell pre-expansion detection,--install-completion, syrupy snapshot tests. - Fun features — new
stats/tree/top/dupessubcommands; duplicate detection (size → 4-KiB hash → full hash) usingxxhash.xxh3_64with BLAKE2b fallback;.gitignoreawareness via pathspec;--type/--min-size/--max-size/--newer-than/--older-thanfilters. - 2.0 cleanup —
__version__ = "2.0.0",Development Status :: 6 - Mature, migration guide atmigrating-to-2.0.md, final public-API class diagram.
Breaking change¶
rglob()andrglob_()now returnlist[Path](waslist[str]in 1.x). One-line migration:
paths = [str(p) for p in rglob(base, pattern)]
See migrating-to-2.0 and ADR-0003 for full context.
Decisions captured as ADRs¶
- 0001 — build backend (hatchling)
- 0002 — Python 3.11 floor
- 0003 —
list[Path]return at 2.0 - 0004 — Typer + Rich for the CLI
- 0005 — single 2.0.0 release strategy
- 0006 — aggregated 100% coverage
- 0007 — behave kept as parallel BDD
- 0008 — security model
Test plan¶
- [x]
make lint— ruff (lint + format) + mypy--strictclean - [x]
make test— pytest 119/119 passed @ 100% local coverage, behave 7/7 scenarios - [x]
make build—hatch buildproducesrglob-2.0.0.tar.gzandrglob-2.0.0-py3-none-any.whl - [x]
make docs-build—mkdocs build --strictclean - [x] End-to-end CLI smoke (
rglob find --json,rglob stats,rglob dupeswith planted duplicates) all return expected output - [ ] CI matrix (3.11–3.14 × ubuntu/macos/windows) — to confirm on the PR
- [ ] Codecov merged report hits 100% — to confirm on the PR
- [ ] Docs site renders on gh-pages — to confirm post-merge
- [ ] Dry-run
release.ymlagainst TestPyPI — to confirm separately before cuttingv2.0.0
Notes¶
- No tag pushed; the actual
v2.0.0release is a follow-up (per the single-release strategy in ADR-0005). - Branch protection on
mastershould be enabled in repo settings before merge (CONTRIBUTING.md documents the required checks).