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

Add a Path-like API for filetree navigation #9

Open
jwodder opened this issue Oct 13, 2021 · 0 comments · May be fixed by #30
Open

Add a Path-like API for filetree navigation #9

jwodder opened this issue Oct 13, 2021 · 0 comments · May be fixed by #30
Labels
enhancement New feature or request therefor library API Relating to the public library API
Milestone

Comments

@jwodder
Copy link
Collaborator

jwodder commented Oct 13, 2021

Wheel/dist-info objects should have a filetrees (name WIP) attribute that is a dynamic mapping. Accessing this mapping with the keys "purelib", "platlib", "dist-info", "headers", "scripts", or "data" should return a PosixPath-like object for navigating through the respective subset of the files in the wheel. However — and this is key — it should not be possible to use such a path instance to access or view files outside the given filetree; this includes not being able to access the *.dist-info or *.data directories from the purelib tree (assuming root is purelib; otherwise, platlib).

  • The filetrees mapping should accept any name not containing a slash; unknown names are treated as subdirectories of *.data. If a given directory does not exist (or if the corresponding entry in *.data is a file instead of a directory), None is returned.
  • filetrees should accept a "root" (or None?) key to access purelib for purelib wheels and platlib for platlib wheels.
  • These path objects should be accepted by the API wherever wheel entry filepaths are accepted.
  • Path objects should have a wheel_path(?) attribute for getting the actual, full path of the underlying file inside the wheel.
@jwodder jwodder added the enhancement New feature or request therefor label Oct 13, 2021
jwodder added a commit that referenced this issue Oct 18, 2021
jwodder added a commit that referenced this issue Apr 8, 2022
jwodder added a commit that referenced this issue Oct 12, 2022
jwodder added a commit that referenced this issue Oct 12, 2022
jwodder added a commit that referenced this issue Dec 10, 2022
jwodder added a commit that referenced this issue Sep 25, 2023
jwodder added a commit that referenced this issue Oct 3, 2023
jwodder added a commit that referenced this issue Nov 1, 2023
@jwodder jwodder added this to the v2.0 milestone May 3, 2024
@jwodder jwodder linked a pull request May 3, 2024 that will close this issue
49 tasks
@jwodder jwodder added the library API Relating to the public library API label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request therefor library API Relating to the public library API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant