8000 Could you publish the 0.4.28, which ease my work on windows ? · Issue #350 · ahupp/python-magic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Could you publish the 0.4.28, which ease my work on windows ? #350

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

Open
sinfomicien opened this issue Apr 4, 2025 · 0 comments
Open

Could you publish the 0.4.28, which ease my work on windows ? #350

sinfomicien opened this issue Apr 4, 2025 · 0 comments

Comments

@sinfomicien
Copy link

Hello dear maintainers,

Since a while, i worked on windows. At the beginning, i worked with python-magic-bin. But few years ago my security team reject the lib because of some flaw in the .dll. So i started to use the vcpkg port of libmagic. And i prefer that way of doing, separate the lib from the python code. My main pain point was to maintain a fork of pythom-magic with a good way to find the lib. I discovered recently the work done to load lib on windows, so i’m not using anymore a fork, but directly the main branch.
Let me show you my requirements.txt:

python-magic==0.4.27; platform_system != "Windows"
python-magic @ git+https://github.com/ahupp/python-magic@62bd3c6a562b26e4005a012c30a0e86428b8defc ; platform_system == "Windows"

If you could release a 0.4.28 , i will use the same version of the lib in dev and in production. Pleaassseeeeee release 😻 🙏

I could also submit a PR to explain how to set-up Windows env if you wish ! Something like:

Install vcpkg in the directory C:\opt

cd /opt
git clone https://github.com/microsoft/vcpkg/
cd vcpkg
.\bootstrap-vcpkg.bat

Compile and install libmagic

cd /opt/vcpkg
./vcpkg.exe install libmagic

Add to your User Path C:\opt\vcpkg\installed\x64-windows\bin

[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\opt\vcpkg\installed\x64-windows\bin", [System.EnvironmentVariableTarget]::User)

Then you need to create a MAGIC env variable pointing to magic.mgc:

[System.Environment]::SetEnvironmentVariable("MAGIC", "C:\opt\vcpkg\installed\x64-windows\tools\libmagic\share\misc\magic.mgc", [System.EnvironmentVariableTarget]::User)

P.S.: and a HUGE Thanks You all for writing and maintaining the python-magic library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0