Skip to content
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

Pathlib like #325

Merged
merged 10 commits into from
Aug 27, 2017
Merged

Pathlib like #325

merged 10 commits into from
Aug 27, 2017

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented May 25, 2017

Minor additions to add path lib like syntax. Added paths to quickref.

@coveralls
Copy link

coveralls commented May 25, 2017

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 81.075% when pulling f27adea on pathlib-like into dc76427 on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 80.996% when pulling 3dbd994 on pathlib-like into dc76427 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Aug 25, 2017

Coverage Status

Coverage decreased (-0.2%) to 80.996% when pulling 3dbd994 on pathlib-like into dc76427 on master.

@coveralls
Copy link

coveralls commented Aug 26, 2017

Coverage Status

Changes Unknown when pulling 19d9367 on pathlib-like into ** on master**.

@coveralls
Copy link

coveralls commented Aug 26, 2017

Coverage Status

Coverage decreased (-0.08%) to 80.996% when pulling f6a6d9a on pathlib-like into a6dec8b on master.

@coveralls
Copy link

coveralls commented Aug 27, 2017

Coverage Status

Coverage increased (+0.01%) to 81.085% when pulling 2d2b274 on pathlib-like into a6dec8b on master.

@henryiii henryiii changed the title WIP: Pathlib like Pathlib like Aug 27, 2017
@henryiii henryiii merged commit 969adee into master Aug 27, 2017
@henryiii henryiii deleted the pathlib-like branch August 27, 2017 20:49
@piotr-dobrogost
Copy link

piotr-dobrogost commented Sep 4, 2017

Couldn't pathlib just be vendored in (ideally optionally if not present)? This would make Plumbum 100% compatible and would cut some maintenance costs.

@henryiii
Copy link
Collaborator Author

henryiii commented Sep 5, 2017

That would be great, but there are several things that make that difficult:

  1. Plumbum has remote paths. That doesn't exist in Pathlib
  2. In Plumbum, all paths are absolute
  3. Plumbum has a lot of custom methods that would need to be ported in (at least for a while, some would stay)
  4. Plumbum has to support Py2 for a while, which would mean that the back ported pathlib2 should be part of Plumbum (the 2.6 support that was "recently" added helps, licenses is OK, I believe)

The first bullet point is the hardest, and the others would just take work. I don't have time, but would be okay to help someone interested.

@piotr-dobrogost
Copy link

The first bullet point is the hardest (…)

Do you have any idea how to go about integrating this functionality with pathlib?

@henryiii
Copy link
Collaborator Author

henryiii commented Sep 5, 2017

I have a rough plan if interested:

  1. Plumbum could provide a subclass of Path that would add the remote functionality.
  2. All paths generated by Plumbum would simply be absolute (resolved). That would be pretty easy.
  3. In the same way as 1, Plumbum would provide a subclass that would add the extra methods Plumbum provides for local paths.

A few other points:

  • Plumbum parts should remain as separated as possible (modular). So the parts that use paths should only use official methods wherever possible. If the more useful methods (or even remote paths) could eventually be added to pathlib, that would allow Plumbum to drop them completely.
  • This could initially be called plumbum.pathlib
  • The differences sheet in the QuickRef should be filled out to make transition easier.
  • If you got, say, plumbum.cli without the rest of plumbum, it should be able to use pathlib

Of course, I mean pathlib2 on older versions of Python.

@henryiii
Copy link
Collaborator Author

henryiii commented Sep 5, 2017

This could be extended to add remote paths:

inheritance diagram

Pathlib is pretty simple, and is a single file. The remote paths should be general enough to not specifically depend on Plumbum (possibly in a non-concrete and concrete version?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants