-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix Absolute Paths (Windows/Unix) #95
Conversation
justindujardin
commented
Nov 19, 2022
•
edited
Loading
edited
- throw an error if Pathy is initialized with an absolute system path (suggest using Pathy.fluid in message)
- fix issue where windows paths weren't resolved to bucket slashes properly
- add windows test runner to CI build
- fixes How to use local Unix paths with Pathy #87
- fixes Support forward slash separated paths on Windows #69
- change the default of last_modified to None instead of -1. This is because last_modified is defined as an optional int, so None is the proper default.
- windows doesn't implement owner() in pathlib, so catch the error and return None like other corner-cases
- the unerlying abspath() call on windows resolves with \\ slashes, which we don't want when referring to bucket paths. BasePath (pathlib.Path) variants don't do this translation to preserve the os-specific slashes.
- this addresses concerns around initializing Pathy paths with unix and windows absolute paths. The correct way to initialize these paths is to use Pathy.fluid. - raise an error if an absolute system path is given when initializing Pathy objects - fixes #87 BREAKING CHANGE: Previously Pathy would allow you to initialize Pathy instances with absolute system paths (unix and windows). Now Pathy raises a ValueError if given an absolute system path that suggest using Pathy.fluid instead.
- verify some path shenanigans with Windows are working as expected
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #95 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 1105 1125 +20
=========================================
+ Hits 1105 1125 +20
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
- the github runner doesn't like the rmdir arguments 🤷
- on Windows Pathy normally only deals with bucket formats using / slashes, but when using the file:/// scheme you would have a Pathy object that contains \\ separators to represent a windows file path. In this case, convert the separator to \\ while formatting strings.
🎉 This PR is included in version 0.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |