-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
Replace pillow
with filetype
#1867
Conversation
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.
To be honest, I am not sure if filetype is much better and here is why:
- hosted under personal github account instead of using an umbrella organization, https://github.com/h2non/filetype.py
- not much recent activity https://github.com/h2non/filetype.py/graphs/contributors
- not using pep-517 for packaging
- CI currently broken and had only one PR merged in 2024: https://github.com/h2non/filetype.py/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Aclosed
Apparently pillow had releases https://pypi.org/project/pillow/#files
Still, a pure python library would have lots of advantages. I would support migration to a pure python alternative.
Hi @ssbarnea, Thank you for reviewing my PR and providing feedback. I appreciate your feedback and remarks, but I believe they should not deter us from considering As noted in #1801, this issue is not only for me, but for other consumers as well. For our Regarding the points raised:
The hosting under a personal GitHub account shouldn't be a deterrent. Popular packages like fastapi and six are similarly hosted and widely used.
The CI breakage seems recent due to an update in their test infrastructure. This appears to be a temporary issue and doesn't reflect the library's overall stability.
While PEP 517 provides a way toward simpler packaging, the absence of it in Additionally, This situation is similar to an existing dependency |
I added my comments, a slight -1 but I will not block them this change. Maybe that is a good opportunity to review library dependencies and plan to remove or replace some of them (other ticket). I want to make jira library slim and pure python too! We can also raise our concerns upstream and see how current maintainers are willing to address them (could help us make a more informed decision). |
Yes, that would be ideal! This package should be slim and ideally pure python. I don't think this needs anything computationally expensive (at least right now). So, @ssbarnea , what would be the necessary action items to get this PR through the door and merged? We can raise some issues upstream and coordinate with their maintainers, but ideally want this PR merged sooner rather than later, since it affects my workflow and a couple others. |
+1 to removing dependency on
which is gross and I'l like to avoid. |
Is removing the auto-detection functionality entirely an option here? I'm aware that probably a lot of projects out there rely on it to automatically populate the The benefit would be reducing the dependencies required by the package and allowing the users to pick their own flavour of a library, the downside is that everyone who wants to upgrade will have to handle this on their own. |
Removing the functionality would work and simplify the dependencies. As for a transition how requiring |
When this PR was merged, #1680, we replaced
imghdr
withPillow
.Albeit Pillow is a great library, it has many conflicts with different platform architectures, and too much overhead for the use we have for it (We just use it to determine a MIME type for an image)
Looking at PEP 594,
filetype
is a reccommended replacement forimghdr
and it is cross platform compatible.This PR is replacing
Pillow
withfiletype