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

BlobTree API refactor including newfile() / newdir(), and renaming. #45

Merged
merged 8 commits into from
May 20, 2022

Conversation

c42f
Copy link
Contributor

@c42f c42f commented May 16, 2022

This PR updates and refines the BlobTree API and renames BlobTree->FileTree and Blob->File as mentioned to fix #41. In the rename, the previous name BlobTree is still allowed for now, though both the binding and use in Data.toml are deprecated.

It also significantly updates and refines the mutation API — the newfile() and newdir() functions so that they're primarily in-place APIs. The older out-of-place newfile() and newdir() have been deprecated. (Before this refactor the API looked slightly nicer, but was inherently less efficient than the native file APIs.)

In addition, add a few missing pieces of query functionality

  • Allow /-separated path strings in any FileTree accessors for convenience. (Previously these would raise an error.)
  • Implement delete!(tree, path). Requires the tree's root object to implement delete!(root, path)
  • deprecate rm(tree).

TODO

  • A few more tests for newfile() and newdir().

c42f added 5 commits May 16, 2022 12:02
Refactor newfile() / newdir() into primarily in-place APIs. A
temporary directory can still be created with newdir().
Before this refactor the API looked slightly nicer, but we would never
be able to reach the efficiency of the native file APIs. In
particular, we might end up moving data across devices as a last step
in constructing a directory tree — this seemed bad!

Various changes to BlobTree API to make it more Dict-like and less
reliant on overloading filesystem-like functions.

* Further document the BlobTree API
* Allow path strings as keys in more places in BlobTree
* Deprecations of some filesystem-like functions
* The big rename
* Add deprecations for Blob, BlobTree
Not including documentation on writing to a file tree yet; that will
come in a future change.
Also some docstring refinement
c42f added 3 commits May 19, 2022 19:43
* Additional tests for FileTree - the whole API should be covered now.
* Remove internal TempFilesystemRoot; replace with a simple flag on
  FileSystemRoot.
* Remove internal AbstractFileSystemRoot; this seems unnecessary now.
@c42f c42f merged commit a6f769e into master May 20, 2022
@c42f c42f deleted the cjf/blobtree-API-refactor branch May 20, 2022 08:29
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.

Rename BlobTree -> FileTree
1 participant