-
Notifications
You must be signed in to change notification settings - Fork 262
ENH: Allow ~/ in paths #1260
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
ENH: Allow ~/ in paths #1260
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1260 +/- ##
==========================================
- Coverage 92.19% 92.19% -0.01%
==========================================
Files 99 99
Lines 12458 12457 -1
Branches 2560 2559 -1
==========================================
- Hits 11486 11485 -1
Misses 648 648
Partials 324 324
☔ View full report in Codecov by Sentry. |
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.
I don't think there's any advantage to forcing to POSIX apart from to please the tests. I would just us os.path.join
to ensure the tests are consistent with the OS.
It also won't work as-is, since Path.home()
will contain backslashes in Windows.
Some of the failures were in other, existing, tests, would you want these modified accordingly? |
See test_parse_filename in the same test file as an example. |
Oh, I see. Well, if we're munging plain strings instead of passing them through untouched, then I suppose it doesn't matter much whether they become POSIX-style or match I'm trying to think if there is any other action at a distance that this will cause. I think |
Also apologies for the repeated test pushes; I don't have access to a windows machine so I can't test locally |
Co-authored-by: Chris Markiewicz <[email protected]>
@ReinderVosDeWael I assume you saw that a new thing has broken:
Possibly the better check for these things is to assert that |
Thanks for the ping - I had not seen this. I'll see if I can find a couple minutes later today (EST timezone) to resolve this. |
That should do it; I've changed the failing tests to check for pathlib.Path equality. Again I can't test it on windows, so I'll await the CI. |
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.
Two small cleanups to the tests, but this is good to go.
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Thanks! Hopefully this makes people's lives a little easier... |
This PR modifies
_stringify_path
to allow it to expand home directories (~/
). Its output should remain the same on all other valid inputs.Tests are included to validate a variety of cases. As no prior tests existed for this function I cannot confirm that its behavior remains identical in all other cases.