-
Couldn't load subscription status.
- Fork 1.9k
docs: Rewrite Handling Paths chapter (pathlib vs utils) #6116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR rewrites the "Handling Paths" chapter in the contributing documentation to reflect the transition from legacy path utilities (syspath(), normpath(), bytestring_path(), displayable_path()) to modern pathlib.Path. The documentation now includes historical context explaining why the old utilities existed, guidance on when to use each approach, and concrete examples showing old vs. new patterns.
- Adds historical context for legacy path utilities and their original purposes
- Introduces
pathlib.Pathas the preferred approach for new code - Provides side-by-side examples comparing old and new path handling patterns
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6116 +/- ##
==========================================
- Coverage 67.22% 67.00% -0.23%
==========================================
Files 118 118
Lines 18180 18180
Branches 3079 3079
==========================================
- Hits 12221 12181 -40
- Misses 5299 5340 +41
+ Partials 660 659 -1 🚀 New features to boost your workflow:
|
|
How do we feel about moving this into the developer documentation? I don't think it should be included in the contribution guide. |
Good idea! I keep forgetting n starting to look for it there anyway!! 😂 |
c1ffa87 to
d56962a
Compare
|
@semohr moved it to the dev docs but now realize that actually this is the plugin writing section. It kind of fits there but is not only related to plugins but a general thing. Have a better idea where to put it or is fine there? Thanks for any feedback on the wording too! |
|
Awesome, although why not just create a file in Otherwise I'm happy with the new sections. I don't think the wording is that important for the dev docs in general. It is a major improvement either way and we can always iterate it if something feels off. |
|
This makes me think that we should extend the |
83f7a7c to
8215eaf
Compare
You mean for the Related question, do we recommend to store as bytes in such cases as well, I just recommended it that way over there: https://github.com/beetbox/beets/pull/4748/files#diff-5ddf2bcdeaa73deda8e015085ca50330be268bd9352cfda7ed68bcd0879b8c51R56 So basically I'm asking: In case we store paths not for |
8215eaf to
3c2c050
Compare
Nope, as mentioned already, I don't think it fits under plugins :-)
Not a native-speaker here but IMHO at least it should be halfway good english - even for dev docs :-) I get goosebumps when reading all wrongly worded documentation - no matter if for developers or endusers. Haha! ;-) You are right we can always change it if something is not 100% correct. I finally found a good place for the chapter in the main docs level. Right between "Library Database API" and "Music importer". the former talks about Also I reworded and clarified this paragraph:
Added it to the changelog and merging it now. Thanks for the feedback! @semohr ah but please give me an approval so I can press the button. Thanks! |
79cd611 to
2cbb2d7
Compare
2cbb2d7 to
528d5e6
Compare

Description
Updates the docs chapter "Handling Paths" describing how to modernise old code and intentionally includes historical details. Examples should further guide contributors while refactoring.
To Do
docs/to describe it.)docs/changelog.rstto the bottom of one of the lists near the top of the document.)