refactor: use pathlib internally
Metadata
Current evaluation
Merged PR #1424 as commit cfdabafc, replacing internal os.path calls with pathlib across 95 files while preserving the public API and migration-state serialization.
Resolution: closed resolved
Reason: PR #1424 was merged as commit cfdabafc, completing the internal pathlib refactor. Maintainer bepri confirmed the implementation passes tests on Rockcraft, Charmcraft, and Imagecraft, and opened #1572 to track the two changes that couldn't be kept.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the guidelines for contributing?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint && make test`?
- [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
Change all calls to os.path that are warned PTH lints to use pathlib.Path instead.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| ~deepseek/deepseek-pro-latest | — | closed resolved | Merged PR #1424 as commit cfdabafc, replacing internal os.path calls with pathlib across 95 files while preserving the public API and migration-state serialization. | |
| ~deepseek/deepseek-pro-latest | — | closed resolved | Merged PR #1424 as commit cfdabafc, replacing internal os.path calls with pathlib across 95 files while preserving the public API and migration-state serialization. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1424 as commit cfdabafc, replacing internal os.path calls with pathlib across 95 files while preserving the public API and migration-state serialization. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1424 as cfdabafc, replacing internal os.path calls with pathlib.Path across 95 files while preserving the public API and fixing the remaining Snapcraft test failure. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Replaced deprecated os.path calls with pathlib.Path across 95 files. Maintainer applied a final patch to resolve a Snapcraft test failure, avoiding an API break. All CI checks passed prior to merge. |
Update history
| Date | Change |
|---|---|
| updated |
Related work
-
Related To:
craft-parts#1572
(confidence 95%)
Opened by maintainer bepri to track the two pathlib changes that couldn't be kept in this PR.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #264 utils: refactor os utils to use pathlib | craft-parts | merged | Merged PR #264 in commit 3a326f90, refactoring get_bin_paths(), get_include_paths(), and get_library_paths() to use pathlib instead of os.path. | |
| #1317 Migrate to pathlib | craft-parts | open | Broad os.path-to-pathlib refactor is recorded as completed by merged PR #1424 (commit cfdabafc), with migration-state YAML compatibility preserved; #1317 remains open but is ready to close. |