oe/path: three fixes plus unit coverage
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/24 patches 4 repliesIn review
- v2 posting 1/24 patches 0 repliesSuperseded
- v14 patches 0 repliesSuperseded
Patches in v2 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | oe/path: fix bare `false` NameError in __realpath's isdir guardsrc/ | +1 | 0 replies | |
| 2/4 | oe/path: don't glob-expand the destination in symlink(force=True)src/ | +12 | 0 replies | |
| 3/4 | oe/path: canonicalize('') should return '' rather than the cwdsrc/ | +5 | 0 replies | |
| 4/4 | tests/unit/test_oe_path: cover oe/path's own path logictests/ | +378 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Paul Barker |
|---|---|
| Series | R-b |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [wic][PATCH v2 0/4] oe/path: three fixes plus unit coverage
This series continues the standalone unit-test work, this time over oe/path.py. It follows the same shape the suite settled on: each source fix is its own standalone commit, and the green test module lands last, so the suite passes at every commit.
Three fixes come first, each independent of the others:
- __realpath's isdir guard assigns a bare false, which is not a Python name; when os.path.isdir() raises, the handler meant to absorb the error raises NameError instead. Use the builtin False.
- symlink(force=True) cleared the destination through remove(), which globs its argument; a destination containing glob metacharacters could fail to match itself or match unrelated files. Remove the literal destination instead.
- canonicalize('') and canonicalize(None) returned the current working directory, because os.path.realpath('') does; a stray separator injected a spurious cwd entry too. Skip empty tokens.
The final commit adds tests/unit/test_oe_path.py, covering oe/path's own logic (join, is_path_parent, symlink, make_relative_symlink, canonicalize, which_wild, realpath) and locking in the three fixes. Backing any fix out turns the matching test red. The suite is green and ruff-clean, and the series passes oe-core's wic oe-selftest with no regressions.
These same three fixes and their equivalent selftest coverage have now landed in OE-core (meta/lib/oe/path.py and oeqa/selftest/liboe.py), where oe/path.py originates. wic vendors a copy of that module; this series keeps the vendored copy from diverging by carrying the identical fixes, with the coverage expressed as wic's own pytest suite.
Trevor Woerner (4):
oe/path: fix bare false NameError in __realpath's isdir guard oe/path: don't glob-expand the destination in symlink(force=True) oe/path: canonicalize('') should return '' rather than the cwd tests/unit/test_oe_path: cover oe/path's own path logic
src/wic/oe/path.py | 21 ++- tests/unit/test_oe_path.py | 378 +++++++++++++++++++++++++++++++++++++ 2 files changed, 396 insertions(+), 3 deletions(-) create mode 100644 tests/unit/test_oe_path.py
Signature · 1 line
2.50.0.173.g8b6f19ccfc3a