-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
pyFilesystem support for loading and saving data #205
Comments
does it mean wherever moban uses file system, use pyFilesystem? |
possible, but not a good idea imo. Also pyfs doesnt support git. this is only for non-local files, so e.g. deployment could be done with moban. |
A github driver is at https://github.com/merlink01/fs.github . Not particularly useful as it doesnt support GitLab, but may be use in addition to a git driver, if one is created. |
When we do switch, there is a jinja template loader, https://github.com/althonos/jinja2-fsloader |
We could take the Hyde approach and have one custom driver for git, and use pyfs for everything else, and transparently wrap the git repo in a pyfs layer. |
Created merlink01/fs.github#9 to see if they are interested in GitLab/etc support. If not, we may need to create a fs.IGitt ourselves. |
do we want to expose pyfilesystem2 syntax to our users(downstream projects)? |
Optional, but yes. Maybe even recommended where a value might be ambiguous without a pyfilesystem2 prefix. It allows users to host their config & templates in any filesystem-like provider, and use a pyflesystem2 URL to tell moban where it is. This is a natural way to say "moban supports any data/file host" without adding/maintaining drivers for all of them. And we inherit the naming conventions of pyfilesystem which prevents any conflicts/ambiguity, and means moban users can use pyfilesystem docs for precise semantics of the URLs. Our users get new file hosts each time pyfilesystem core includes a new one. The most obvious "win" is that if we can get a git driver for pyfilesystem, we dont need to create special code for mercurial and other VCS: anyone who wants those can create their own pyfilesystem driver. The standardisation inside moban codebase will also be beneficial. It's support of PyPI packages would be a simple wrapper that can be creating using the core pyfilesystem2 drivers.(I expect it would be an internal driver, not a separately pypi published one). |
Yes, pyfilesystem2 actually complements our vision with any location and any format. With jinja2_loader, our template could sit on s3. I am finding a blocker in practice: moban scans input and forms a list of things to do, for example: here is a template file, a data file, please render an output. Then moban does it. moban collects absolute file paths into a data structure. then take them out to read or write. Essentially with pyfilesystem2: we need it to fulfil two fundamental things:
pseudo code: with open_fs('pypi://pypi-mobans-pkg/templates') as pypi_fs:
fs.write('pypi://pypi-mobans-pkg/templates/reminder.txt', 'my content', 'my encoding') My concern is: a. can |
it is funny: fs.errors.InvalidCharsInPath: path 'C:\Users\VssAdministrator\AppData\Local\moban\moban\Cache\repos\pypi-mobans\config\data.yml' contains invalid characters https://dev.azure.com/moremoban/moban/_build/results?buildId=484 |
on python 2: TypeError: paths must be unicode (not str) <-- well, python file system 2 said path should be unicode. |
@jayvdb , two internal openers for pypi and github were done. but it does not cover:
because they are overlapping |
I think that is ok, as long as it is a new minor release. I would prefer to keep We could re-add I'll review the PR #302 later today. |
the support is to be released in v0.6.0 |
https://github.com/PyFilesystem
moban currently supports custom filesystem 'git'.
To add more it should adopt a generic fs layer, like hyde.
The text was updated successfully, but these errors were encountered: