-
Notifications
You must be signed in to change notification settings - Fork 306
Comments
Build platform-specific wheels containing libmagic#294
Build platform-specific wheels containing libmagic #294ddelange wants to merge 59 commits intoahupp:master from
Conversation
a98f13b to
dc9c393
Compare
d672b91 to
14f7dbb
Compare
14f7dbb to
ec952d7
Compare
apirogov
commented
Sep 12, 2023
This is nice! Hope this will be merged soon!
Just ran into issues with my library being not usable by Mac and Windows users because I rely on python-magic. If there are wheels, I don't need to find a workaround or replace the library :)
python-magic-bin did not work for some of them, by the way.
.github/workflows/main.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small improvement here might be to use the PyPa Action instead: https://github.com/pypa/gh-action-pypi-publish
The big advantage is trusted publishing, instead of storing a password or token as a secret
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's cool, thanks for sharing!
@ahupp shall I make that change and you set it up on PyPI side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like trusted publishing is the way to go. I recently got this email:
Hi ddelange!
Earlier this year, we announced that PyPI would require all users to enable a form of two-factor authentication on their accounts by the end of 2023.Keeping your PyPI account secure is important to all of us. We encourage you to enable two-factor authentication on your PyPI account as soon as possible.
What forms of 2FA can I use?
We currently offer two main forms of 2FA for your account:Security device including modern browsers (preferred) (e.g. Yubikey, Google Titan)
Authentication app (e.g. Google Authenticator)
Once one of these secure forms is enabled on your account, you will also need to use either Trusted Publishers (preferred) or API tokens to upload to PyPI.What do I do if I lose my 2FA device?
As part of 2FA enrollment, you will receive one-time use recovery codes. One of them must be used to confirm receipt before 2FA is fully active. Keep these recovery codes safe - they are equivalent to your 2FA device. Should you lose access > to your 2FA device, use a recovery code to log in and swap your 2FA to a new device.Read more aboutrecovery codes.
Why is PyPI requiring 2FA?
Keeping all users of PyPI is a shared responsibility we take seriously. Strong passwords combined with 2FA is a recognized secure practice for over a decade.We are requiring 2FA to protect your account and the packages you upload, and to protect PyPI itself from malicious actors. The most damaging attacks are account takeover and malicious package upload.
To see this and other security events for your account, visit your account security history.
Read more on this blog post.
If you run into problems, read the FAQ page. If the solutions there are unable to resolve the issue, contact us via support@pypi.org.
Thanks,
The PyPI Admins
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahupp so the last thing for you to do is adding this repo as trusted publisher to https://pypi.org/manage/project/python-magic/settings/publishing/
ahupp
commented
Sep 28, 2023
This is huge, thank you! Apology for the delay I thought I'd commented earlier but guess not. I'll look this over soon; I didn't quite understand how bad the binary dep situation was expecially on windows.
jean-humann
commented
Dec 3, 2023
@ahupp @stumpylog could we have this one merged (and released) by the end of the year please ?
DeflateAwning
commented
Aug 11, 2025
Can this please be merged? Is this library actively maintained? Seems like a serious improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to get this landed.
fpgmaas
commented
Sep 4, 2025
Any updates here @ahupp ? I think many users are eagerly waiting for this to be available on PyPI. Even having a prerelease available on PyPI would be great!
Since this PR has been open for quite a while and there are no indications of it being merged anytime soon, I took the liberty of uploading the wheels to PyPI under the name python-magic-standalone, see https://pypi.org/project/python-magic-standalone/. It's sole purpose is to make it possible for users to install @ddelange's work directly from PyPI. I don't intend to maintain this fork, and I added a clear disclaimer to the README. It can be installed with any of the following commands, depending on the tool you use;
# pip
pip install python-magic-standalone
# uv
uv add python-magic-standalone
# poetry
poetry add python-magic-standalone
cclauss
commented
Sep 24, 2025
@fpgmaas, please consider building wheels for Python 3.14, as it is less than two weeks away.
this branch / these wheels are forward compatible, no need for changes in the build 👍
ddelange
commented
Sep 24, 2025
Updated the PR description. Thanks @fpgmaas 🎉
@CodeXex123
CodeXex123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
49982d2 is a git cherry-pick from https://github.com/thc1102/python-magic to fix #287 / #335
This reverts commit b4c04a3.
cm253
commented
Nov 26, 2025
Is this PR still waiting for something? :)
fpgmaas
commented
Dec 7, 2025
Hi @ahupp, just checking in to see if there are any updates on this PR. It seems quite some users are waiting for this to be merged. Are you still trying to determine if this should be merged or not, or are you simply lacking the time to properly review? I am aware that maintaining a project can be a bit of a timesink.
If time is the constraint, is there anything the community can do to help out? Is it maybe worth looking for maintainers for this project to help you manage it?
Uh oh!
There was an error while loading. Please reload this page.
Hi @ahupp 👋
This PR builds self-contained wheels as discussed in #233. For Windows users, this renders
python-magic-binfrom @julian-r obsolete.pip install these wheels
python-magic-standalonePyPI package based on this branch.The wheels diff:
The wheels:
.dylibon mac,.soon nix,.ddlon win) - no additional user action needed(削除) Linux architectures limited by availability: https://pkgs.org/search/?q=file-libs (削除ここまで)now building from source on linuxwheels.ymlas trusted publisher hereCI/CD
dists build with official
cibuildwheelon GitHub Actions, and they build in parallel:image
fix #137, fix #288, fix #225, fix #276, fix #248, fix #87, fix #139, fix #233, fix #73, fix #60, fix #34, fix #293, fix #233, fix #278, fix #262, fix #248, fix #238, fix #145, fix #61, fix #12, fix #295, fix #311, fix #312, fix #313, fix #321, fix #332, fix #249, fix #333, fix #350, fix #351, fix #287, fix #335