ahupp / ahupp/python-magic

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

Open
#350 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
304
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Windows-specific requirement in requirements.txt and inspect commit 62bd3c6a562b26e4005a012c30a0e86428b8defc to confirm the requested changes. Check the project's release entry point, which the issue does not name; done means publishing python-magic 0.4.28 so Windows users can install the released version rather than the commit URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems, release
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.