-
Notifications
You must be signed in to change notification settings - Fork 64
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
Improve compatibility with pathlib by implementing more common methods #230
Conversation
I added a few more compatibility changes:
|
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.
Awesome PR, thanks @Gilthans !
In addition to the comments, could you:
- (1) make linting pass (
make format
thenmake lint
should check this for you) - (2) update the README.md so the table reflects the new supported methods
- (3) add a note to HISTORY.md with the updates
Codecov Report
@@ Coverage Diff @@
## master #230 +/- ##
========================================
- Coverage 94.7% 94.4% -0.4%
========================================
Files 21 21
Lines 1287 1323 +36
========================================
+ Hits 1219 1249 +30
- Misses 68 74 +6
|
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.
A couple documentation tweaks, and then testing for the cloud_prefix
and this should be good to go.
For the failing docs build in CI, can you update requirements-dev.txt
with a change like the one we had to make in another project?
https://github.com/drivendataorg/nbautoexport/pull/96/files
Thanks @Gilthans! Moving this on to a contributor branch to run the live tests. |
#230) (#232) * Added absolute, resolve and relative_to implementations * Added tests interacting with PurePosixPaths * Added is_absolute and is_relative_to as well * Accept read_text parameters * Added exist_ok paramter to touch * Added missing_ok paramter to unlink * Fixed formatting (make format) * Update history.md & readme.md * Fix relative_to on different providers (+ some naming changes * Reformat * Update history.md and bump version number to 0.9 * Update dev requirements for docs * Fix readme list order * Added test for relative_to on different provider cloud paths * Remove unused import * Updated relative_to different cloud test Co-authored-by: Daniel Rembiszewski <[email protected]>
Merged into the main branch, thanks @Gilthans ! |
#149, #151
absolute
andresolve
, which do nothing. This allows the methods to be called when the path type is unknownrelative_to
, which returns a relative PurePosixPathis_absolute
andis_relative_to
read_text
parametersexist_ok
parameter totouch
missing_ok
parameter tounlink
. Even though it defaults to False in pathlib, adding it with that default would be a breaking change, since current implementation doesn't check for existence, so I added it defaulting to True.