- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
[25.0] Directory converters: fix for flat zip files #20857
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
[25.0] Directory converters: fix for flat zip files #20857
Conversation
| <option value="directory">directory</option> | ||
| <option value="zarr">zarr</option> | ||
| <option value="ome_zarr">ome_zarr</option> | ||
| <option value="lexicmap_index">lexicmap_index</option> | 
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.
Wondering why the tar2directory converter does not have this parameter. Should I add it?
Edit: Or should the tar2directory converter be replaced by this tool?
EditEdit: Ahh it already is.
| Hrm, Timeout for the test? Worked with  Edit: Guess this was the galaxy-tool-util problem with conda | 
| Setting this to draft until this is tested: galaxyproject/tools-iuc#7106 (comment) | 
| Instead of 4679231 one might modify the extract method .. but I was afraid of the fallout. | 
| <datatype extension='qiime2.tabular' type="galaxy.datatypes.qiime2:QIIME2Metadata" display_in_upload="true"/> | ||
| <datatype extension="zip" type="galaxy.datatypes.binary:CompressedZipArchive" display_in_upload="true"> | ||
| <converter file="archive_to_directory.xml" target_datatype="directory" /> | ||
| <converter file="archive_to_directory.xml" target_datatype="lexicmap_index"/> | 
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 doesn't really make sense to me, that means every zip file is also a lexicmap_index.
| <!-- Don't use tar directly so we can verify safety of results - tar -xzf '$input1'; --> | ||
| <requirements> | ||
| <requirement type="package" version="23.2.1">galaxy-util</requirement> | ||
| <requirement type="package" version="25.0.2">galaxy-util</requirement> | 
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.
Is this the fix you're referring to in https://github.com/galaxyproject/tools-iuc/pull/7257/files#r2323290063 ?
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.
The fix is in the command block.
The bump is essentially a backport of #20834
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.
I tried to cleanup the PR and removed all the lexicmap stuff
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.
The command block doesn't look right to me, if the input was flat files or directories it either shouldn't be needed or there is a fix necessary in CompressedFile.
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.
https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/util/compression_utils.py#L257-L259 that seems like it would be a problem, and is rather unpredictable.
with conda I get
```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from galaxy.util.compression_utils import CompressedFile; CompressedFile('/tmp/tmp3v2nuot4/files/a/9/7/dataset_a97aebb4-46f7-47a9-b418-11ff1deeed74.dat').extract('.')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/compression_utils.py", line 29, in <module>
    from .checkers import (
    ...<2 lines>...
    )
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/checkers.py", line 20, in <module>
    from galaxy.util.image_util import image_type
  File "/home/berntm/miniforge3/envs/[email protected]/lib/python3.13/site-packages/galaxy/util/image_util.py", line 3, in <module>
    import imghdr
ModuleNotFoundError: No module named 'imghdr'
```
    zip files whose content is in a single top dir is correctly extracted. but if the content is contained in the zip's root the extract method will [add another level (the dataset name)](https://github.com/galaxyproject/galaxy/blob/af2d24082c52cbf8709561044f2082758aec6ff3/lib/galaxy/util/compression_utils.py#L256).
b93adb7    to
    bfbaf7a      
    Compare
  
    47886e4    to
    bfbaf7a      
    Compare
  
    | Closing in favor of: #20929 | 
Was wondering converters should be added automatically for subclassed datatypes?
How to test the changes?
(Select all options that apply)
License