Skip to content

overhaul packaging and project layout, bring in line with templates, first pass for fsspec #231

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

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

painebot
Copy link
Contributor

@painebot painebot commented Feb 16, 2025

This PR does a few things.

fsspec support

fixes #102 (xref #222)
adapts @martindurant's code from main...martindurant:changes

top is pyfilesystem, buttom is fsspec
tmp

move to @tree-finder

fixes #185

Moves from tree-finder to @tree-finder/base which has some fixes and is actively developed

adjust snippets for fsspec support

Tweaks snippets to allow for fsspec, adjusts some text. Allows for backend-specific snippets (by type fsspec/pyfs and also url e.g. local://).

pyfs
Screenshot 2025-02-16 at 18 15 41

fsspec
Screenshot 2025-02-16 at 18 15 30

move to centralized template

http://github.com/python-project-templates/base

Easier to support from one location

move to pnpm

faster, better, standard with template

🚨 this pr *should* be backwards-compatible with the current code (all defaults set to pyfilesystem), but we should bump a minor version

@painebot painebot force-pushed the tkp/overhaul branch 6 times, most recently from 8880bf6 to a227e68 Compare February 16, 2025 22:02
@painebot
Copy link
Contributor Author

painebot commented Feb 16, 2025

browsing s3 with s3fs

Screenshot 2025-02-16 at 17 06 48

@painebot painebot force-pushed the tkp/overhaul branch 3 times, most recently from f4b6b9e to 5b166cf Compare February 16, 2025 23:15
@painebot
Copy link
Contributor Author

tmp

Copy link
Contributor

@vidartf vidartf left a comment

Choose a reason for hiding this comment

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

Thanks @timkpaine ! I have some small fixes in a PR that I will submit shortly, but I also made some comments/notes for some parts of this that I'm not 100% sure on. Would appreciate if you had a look.

"type": {
"description": "Backend type that the snippet works with",
"type": "string",
"default": ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this also be an enum?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep i think so, i have validation on the backend


self.resources = []
self._default_root_manager = self._jupyterfsConfig.root_manager_class(**self._kwargs)
self._managers = dict((("", self._default_root_manager),))

# copy kwargs to pyfs_kw, removing kwargs not relevant to pyfs
self._pyfs_kw.update(kwargs)
for k in (k for k in ("config", "log", "parent") if k in self._pyfs_kw):
self._pyfs_kw.pop(k)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to retain this behavior to ensure traitlets kwargs gets passed correctly to the child-managers for all possible config routes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can add it back in, we may need to separate pyfs_kw and fsspec_kw

elif resource["type"] == "fsspec":
manager_type = FSSpecManager

managers[_hash] = manager_type.create(
urlSubbed,
default_writable=default_writable,
parent=self,
**self._pyfs_kw,
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable should depend on type.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep good catch

@timkpaine
Copy link
Collaborator

thanks for the review @vidartf! I will wait for your reviews, i wasn't sure if you had time to look and didn't want to impose

@vidartf
Copy link
Contributor

vidartf commented Feb 21, 2025

thanks for the review @vidartf! I will wait for your reviews, i wasn't sure if you had time to look and didn't want to impose

Yeah, no worries! As long as releases aren't rushed out I can always post-review like this (although that is less convenient). And if I'm offline for a while I shouldn't block everything either 😃

@painebot painebot deleted the tkp/overhaul branch February 22, 2025 00:18
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.

Port to @tree-finder Use fsspec instead of pyfilesystem2
3 participants