Skip to content
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

refactor: Drop dependency on fact_helper_file #1140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maringuu
Copy link
Collaborator

@maringuu maringuu commented Oct 10, 2023

This uses https://github.com/maringuu/fact-mime-database which is imo the only relevant thing that fact_helper_file provides.

Before merging we should somehow incoperate that fact_helper_file/mime/custom_mime_internal is missing.
If would be great if we could add this somehow add to the FACT_core repo to make fact-mime-database not use its generality.

@maringuu
Copy link
Collaborator Author

While I don't really care note that the repo is in my namespace and not fkiecad's.

@maringuu maringuu marked this pull request as ready for review October 10, 2023 09:48
@maringuu maringuu requested a review from jstucke October 10, 2023 09:48
@maringuu maringuu marked this pull request as draft October 10, 2023 11:15
@maringuu
Copy link
Collaborator Author

maringuu commented Oct 12, 2023

This is blocked on ahupp/python-magic#304 which allows us to delete helperFunctions/magic.py completely.
Edit: To actually get rid of it we also need to solve ahupp/python-magic#305

@maringuu
Copy link
Collaborator Author

Seems that I and the python-magic developer disagree on what a good public API for the magic module would be.
I updated our magic wrapper to be what I wanted in pymagic's API.

Regarding the FACT extractor I don't think we need to copy this code since the only thing it ever needs is Magic.from_file(path, mime=true).
So it could just provide a global instance of magic.Magic and everything works as expected. If we even used the MAGIC environment variable to specify where the additonal magic database is, we can just use magic.from_file instead of creating an instance of Magic.

@maringuu
Copy link
Collaborator Author

maringuu commented Nov 7, 2023

Assuming that fkie-cad/fact_extractor#128 works and is merged this is ready for review.

@maringuu maringuu marked this pull request as ready for review November 7, 2023 09:06
@maringuu maringuu force-pushed the drop-fact-helper-file branch 3 times, most recently from c5b6ce0 to 236a975 Compare November 14, 2023 07:37
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

Successfully merging this pull request may close these issues.

None yet

1 participant