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

gitfs: better comply with fsspec #56

Merged
merged 5 commits into from
May 2, 2022
Merged

gitfs: better comply with fsspec #56

merged 5 commits into from
May 2, 2022

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Apr 11, 2022

Closes #40

@efiop efiop changed the title gitfs: better comply with fsspec [WIP] gitfs: better comply with fsspec Apr 11, 2022
if relparts == ["."]:
return ()
relparts = path.split(self.sep)
if relparts and relparts[0] in (".", ""):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better to normalize the path beforehand, but our fs.path is not yet available in fsspec, so we'll get to it later.

@efiop efiop changed the title [WIP] gitfs: better comply with fsspec gitfs: better comply with fsspec May 2, 2022
@efiop efiop changed the title gitfs: better comply with fsspec [WIP] gitfs: better comply with fsspec May 2, 2022
@efiop efiop changed the title [WIP] gitfs: better comply with fsspec gitfs: better comply with fsspec May 2, 2022
efiop added 5 commits May 2, 2022 21:52
This PR makes our fs accept paths relative to the root of the repo and using / as a separator.
Previous behaviour was a legacy from old dvc.

Pre-requisite for making dvcfs/repofs/etc switch to the same relative repo paths and / separators.
fsspec filesystems don't yet have a notion of cwd, so "." should not be used.
Instead, we should support using fs.root_marker ("" in our case), which is
currently broken.
@@ -20,6 +20,124 @@
from scmrepo.git.objects import GitTrie


class Path:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary copy from dvc/fs/path.py until we get it into fsspec. Useful for handling chdirs.

@efiop efiop merged commit 1c2b23b into iterative:main May 2, 2022
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.

1 participant