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

refactor: construct bucket paths with scheme prefixes #18

Merged
merged 10 commits into from
Apr 24, 2020

Conversation

justindujardin
Copy link
Owner

@justindujardin justindujardin commented Apr 23, 2020

BREAKING CHANGES: GCSPaths must include a path scheme

Before GCSPath would convert /bucket-name/file into gs://bucket-name/file internally. This leads to ambiguity *(thanks @honnibal) when dealing with regular file-system paths and bucket paths together. Does the path /foo/bar point to an absolute file path or a GCS bucket named foo?

Now paths must be constructed with a path scheme. This allows GCSPath to deal with both types of paths, and is needed for the CLI app/s to come.

BREAKING CHANGES: GCSPaths must include a path scheme

Before GCSPath would convert `/bucket-name/file` into `gs://bucket-name/file` internally. This leads to ambiguity *(thanks @honnibal) when dealing with regular file-system paths and bucket paths together. Does the path `/foo/bar` point to an absolute file path or a GCS bucket named foo?

Now paths **must be** constructed with a path scheme. This allows GCSPath to deal with both types of paths, and is needed for the CLI apps to come.
@justindujardin justindujardin changed the title refactor: construct bucket paths with service prefixes refactor: construct bucket paths with scheme prefixes Apr 23, 2020
justindujardin and others added 9 commits April 23, 2020 15:53
 - add "pathy" entry point to the gcspath package
 - add Typer requirement
 - add typer CLI app for copying and moving files
 - basic test
GCSPath wants to work with many kinds of paths, and it's not always clear upfront what kind of path a string represents. If you're on a local file system, the path "/usr/bin/something" may be totally valid, but as a GCSPath it isn't valid because there's no service scheme attached to it, e.g. "gs://bucket/usr/bin/something"

FluidPath is a Union of pathlib.Path and GCSPath which allows type-checking of the paths without needing explicit knowledge of what kind of path it is, until that knowledge is needed.

*note* I originally thought of using "UnionPath" instead of "FluidPath" but the intellisense for completing "GCSPath.union" was very crowded, and a helper should be easy to type with completion.
 - removes files or folders
 - add tests
 - prints the full paths of files found in the location
 - it does more than just GCS at this point
feat(pathy): rename library to be more generic
feat(cli): add pathy executable with cp and mv commands
@justindujardin justindujardin added enhancement New feature or request merge when passing Merge the PR automatically once all status checks have passed labels Apr 24, 2020
@repo-ranger repo-ranger bot merged commit 4a85736 into master Apr 24, 2020
@repo-ranger repo-ranger bot deleted the feature/path_schemes branch April 24, 2020 15:31
@justindujardin
Copy link
Owner Author

🎉 This PR is included in version 0.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request merge when passing Merge the PR automatically once all status checks have passed released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant