You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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. :)
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 :)
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.
@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).
Activity
ahupp commentedon May 5, 2020
How about a environment variable?
ahupp commentedon May 6, 2020
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?
julian-r commentedon May 16, 2020
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-magicmodules 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. :)julian-r commentedon May 16, 2020
Okay, just did some investigation to my old memories:
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.
bitshift91 commentedon Jun 29, 2020
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.
ahupp commentedon Oct 14, 2020
@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?
davidfraser commentedon Feb 23, 2021
@julian-r's Windows binaries being available on PyPI are really useful, and I would love them to be maintained somehow
ahupp commentedon Aug 25, 2023
Merging into #293