-
Notifications
You must be signed in to change notification settings - Fork 30
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
Crate init #46
Crate init #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice! Thank you!
I merged it, but there is a build issue on Windows: https://github.com/ResearchObject/ro-crate-py/runs/1887751730?check_suite_focus=true test/test_read.py::test_init[True] FAILED [ 38%]
...
for p in fpaths:
> assert isinstance(crate.dereference(p), File)
E AssertionError: assert False
E + where False = isinstance(None, File)
E + where None = <bound method ROCrate.dereference of <rocrate.rocrate.ROCrate object at 0x00000199E82CCF08>>('test/test1/input.bed')
E + where <bound method ROCrate.dereference of <rocrate.rocrate.ROCrate object at 0x00000199E82CCF08>> = <rocrate.rocrate.ROCrate object at 0x00000199E82CCF08>.dereference
test\test_read.py:191: AssertionError
=========================== short test summary info ===========================
FAILED test/test_read.py::test_init[False] - AssertionError: assert False
FAILED test/test_read.py::test_init[True] - AssertionError: assert False |
Perhaps breaks because
is repeated in two tests? |
No, every test has its own directory tree. The problems seems to be that file IDs are being added to the crate with backslashes. I'm working on a fix. |
Windows build fixed in #47. |
Adds an "init" mode that allows to initialize an RO-Crate from an existing directory tree, i.e., build an RO-Crate object that references all files and directories in the tree.
Also adds an "rocrate" command with a nested interface, with
init
as its first implemented subcommand.rocrate init top_dir
initializes the directory tree rooted attop_dir
, adding anro-crate-metadata.json
that references files and directories.Note that the
add
command is not implemented yet.