FS#54356 - [python-magic] Replace python-magic from darwinsys with ahupp implementation

Attached to Project: Community Packages
Opened by Oscar Garcia (ogarcia) - Thursday, 08 June 2017, 07:25 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 04 April 2023, 02:38 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi.

Current in pacman we have python-magic from http://darwinsys.com/file/
with an unknown custom license. We have other implementation with MIT
license made by ahupp [1]. The second one is available in pypi and is
more advanced that the first one.

I have been checking the code of dependencies of python-magic and I
can see that deepin-movie and diffoscope supports well ahupp version.

Why not replace python-magic with diffoscope version, as can see in
AUR [2] this version is used for much more packages.

Greetings.

[1]: https://github.com/ahupp/python-magic
[2]: https://aur.archlinux.org/packages/python-magic-ahupp/
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 04 April 2023, 02:38 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-magic 1:0.4.27-1
Comment by Oscar Garcia (ogarcia) - Monday, 07 September 2020, 11:31 GMT
Any news about this?
Comment by Eli Schwartz (eschwartz) - Monday, 07 September 2020, 12:22 GMT
It's not an unknown license, it's a BSD-2-Clause license with wording tweaks. Why is the precise variety of license an issue for you?
Comment by Oscar Garcia (ogarcia) - Monday, 07 September 2020, 13:05 GMT
Sorry Eli, I re-read the license and, true, is a BSD-2-Clause with some tweaks. But my suggestion is because ahupp version is more complete. Anyway is only a suggestion.
Comment by Eli Schwartz (eschwartz) - Monday, 07 September 2020, 13:13 GMT
Four out of 38 packages in the AUR explicitly depend on the nonstandard ahupp alternative with a different API.

There's no guarantee the other 34 actually work with it. Your initial report said that you tested 1 of the 5 packages currently in the repos which works with the ahupp alternative (plus a 6th one which is currently not written in python, I didn't check if it used to be).

> as can see in AUR [2] this version is used for much more packages.

This is a false statement, as I said I cannot see it. Please clarify *why* you think you can possibly see it, and how you obtained this hidden information.
Comment by Eli Schwartz (eschwartz) - Monday, 07 September 2020, 13:14 GMT
Have you considered asking upstream file to add the necessary improvements to their official python bindings?
Comment by Levente Polyak (anthraxx) - Monday, 07 September 2020, 13:28 GMT
Its not much about the license, but about the ahupp variant being the defacto widespread standard, including pypi which is the source of truth when other python software in the pypi ecosystem is referencing a 'python-magic' dependency.
I agree it should be done with lots of care and testing of our repo packages, but to be honest this is a sane request.
Comment by Eli Schwartz (eschwartz) - Monday, 07 September 2020, 13:44 GMT
Numbers on that would be interesting and I have no objection to seeing them.

However, the actual ticket which was opened is:
- confusingly mixing multiple issues (licensing, assertions of quality)
- asserting something, claiming it can be "proved" to be as asserted, then not actually providing the claimed data.

If you have additional information which was not yet provided in this ticket, which shows that the request is sane, I urge you to share it... the fact that no useful data or rationale was provided to date is the probable cause for this ticket languishing for over 3 years now.

It's unlikely any ticket is going to magically be answered by "you don't make a good point, but just for the record I thought the same thing and I actually have my own good reasons to do so, so I'll do it anyway". The purpose of this ticket is supposed to be to share knowledge and help the maintainer make a decision they wouldn't otherwise know to make.

That means not assuming the maintainer is secretly privy to the knowledge of why this ahupp implementation is so good.

(I cannot be of help here as I know nothing of either one. But I would like to encourage various potential ways of reaching a resolution. Whether that be switching implementations or consolidating them into a unified API.)
Comment by Oscar Garcia (ogarcia) - Monday, 07 September 2020, 14:24 GMT
When I opened this bug, I checked with both packages (deepin-movie and diffoscope) that they were officially compatible with Arch Linux. I honestly don't remember why I said the ahupp version was used more in AUR. Maybe I was mistaked, maybe not. Simply I saw that the ahupp version was more widespread and opened this bug as suggestion. I had a mistake with license, probably because at that moment I could not find it or identify it.

That is all, this was a suggestion for package maintairner, he could adopt it or close it.

For me the best solution (at least, at this moment) is that both projects merge in a well maintained one.
Comment by Eli Schwartz (eschwartz) - Monday, 07 September 2020, 14:35 GMT
Can you check if the 5 current packages in the official repos are compatible with it, and ideally if all the ones in the AUR which only depend on "(requires python-magic)" are compatible with it too?
Comment by Oscar Garcia (ogarcia) - Monday, 07 September 2020, 14:59 GMT
No problem, is a easy check (at least for 5 packages in oficial repos).

All have ahupp implementation ([python-magic in Pypi][1]) in requeriments (or similar file):
- [alot][2]
- [diffoscope][3]
- [python-mocket][4]
- [s3cmd][5]
- [weechat-matrix][6]

[1]: https://pypi.org/project/python-magic/
[2]: https://github.com/pazz/alot/blob/master/setup.py
[3]: https://salsa.debian.org/reproducible-builds/diffoscope/-/blob/master/setup.py
[4]: https://github.com/mindflayer/python-mocket/blob/master/Pipfile
[5]: https://github.com/s3tools/s3cmd/blob/master/setup.py
[6]: https://github.com/poljar/weechat-matrix/blob/master/requirements.txt
Comment by Mark Wagie (yochananmarqos) - Saturday, 21 November 2020, 16:56 GMT
Lutris also needs the ahupp version. When running 0.5.8, it says, "Your version of python-magic is too old". The requirements.txt state: python-magic==0.4.18
https://github.com/lutris/lutris/blob/master/requirements.txt#L30

Loading...