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

[24.1] Make pylibmagic import optional #18813

Merged

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Sep 14, 2024

I was trying to use the galaxy-data container for data source tools, but it fails with:

Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/test/functional/tools/data_source.py", line 13, in <module>
    from galaxy.datatypes import sniff
  File "/usr/local/lib/python3.12/site-packages/galaxy/datatypes/sniff.py", line 40, in <module>
    import pylibmagic  # noqa: F401  # isort:skip
    ^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pylibmagic'

pylibmagic is just shipping the magic library and adds it to path, but that's not needed for the conda-package which installs libmagic (https://github.com/conda-forge/python-magic-feedstock/blob/main/recipe/meta.yaml)

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

I was trying to use the galaxy-data container for data source tools,
but it fails with:
```
Traceback (most recent call last):
  File "/Users/mvandenb/src/galaxy/test/functional/tools/data_source.py", line 13, in <module>
    from galaxy.datatypes import sniff
  File "/usr/local/lib/python3.12/site-packages/galaxy/datatypes/sniff.py", line 40, in <module>
    import pylibmagic  # noqa: F401  # isort:skip
    ^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pylibmagic'
```
pylibmagic is just shipping the magic library and adds it to path,
but that's not needed for the data-data container which can use magic
just fine.
@martenson martenson merged commit ca33e23 into galaxyproject:release_24.1 Sep 16, 2024
48 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants