Skip to content

Default magic_file to 'magic' #137

Closed

Description

@julian-r

For windows it would be quite good, because then if the cwd contains the dll and the mgc file everything works out of the box :)

Activity

  1. ahupp commented on May 5, 2020

    @ahupp
    Owner

    How about a environment variable?

  2. ahupp commented on May 6, 2020

    @ahupp
    Owner

    Actually on second thought, I'd rather leave it up to the application to pass this through. Or do you have a situation where you don't own the code calling python-magic?

  3. julian-r commented on May 16, 2020

    @julian-r
    Author

    Its actually quite simple: there is this binary package, which is compatible with the python build for windows: https://github.com/julian-r/file-windows/. The only problem is, that this python-magic modules does not find the the dll or the mgc file. If we could adjust this, i don't need to maintain (or in this case not maintain) a extra package (https://pypi.org/project/python-magic-bin/0.4.14/). I could take care about the dll and the visual studio build in the future. I could also take an evening to build egg's for windows, but i would try to not do this in an extra project. :)

  4. julian-r commented on May 16, 2020

    @julian-r
    Author

    Okay, just did some investigation to my old memories:

    • This fork is able to build a mac and a windows binary egg. https://github.com/julian-r/python-magic
      My offer: I will help you maintaining the package, will take care about win and mac platforms. For unixes binary packages are not needed anyways. This will make the package for users on those platforms much more friendly and everyone with a build pipline can install a hassle free egg package :)

    Hope that sounds interesting for you.

  5. bitshift91 commented on Jun 29, 2020

    @bitshift91

    I would love this feature! We are currently deploying to linux but partly developing using windows.
    For windows we have to use the python-magic-bin package. For linux python-magic. With this feature we could just have one package that works cross-platform.

  6. ahupp commented on Oct 14, 2020

    @ahupp
    Owner

    @julian-r I love that you provide the binaries, but my preference is to not include them in the standard package. Any existing users (by definition) already provide their own binaries, and would in general want to use the system-provided binary.
    Same goes for the magic file; switching to a non-system file would be a big surprise.

    But I think the goal of making this more seamless is a good one. There's a general problem I have here of figuring out how to find the shared lib on various platforms, just look a the mess in magic.py to see all the special cases.

    This feels like an issue of configuration to me; you have a single codebase and want to run it in different ways (e.g pointing at a new shared lib / magic file).

    So I'll re-suggest the environment variable idea:

    PYTHON_MAGIC_SHARED_LIB=something.dll
    PYTHON_MAGIC_DB=something.mgc

    What do you think?

  7. davidfraser commented on Feb 23, 2021

    @davidfraser

    @julian-r's Windows binaries being available on PyPI are really useful, and I would love them to be maintained somehow

  8. ahupp commented on Aug 25, 2023

    @ahupp
    Owner

    Merging into #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions