-
Notifications
You must be signed in to change notification settings - Fork 42
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
Stop using pkg_resources #1851
Stop using pkg_resources #1851
Conversation
86418bd
to
37eed03
Compare
37eed03
to
31477a4
Compare
(will need a rebase and unfortuantely there are a couple more places that introduced pkg_resources in the Veracrypt work, in export_wizard.py and export_wizard_page.py, didn't know this was on deck sorry) |
31477a4
to
90d20a9
Compare
(Rebased + removed pkg_resources in export_wizard and export_wizard_page) |
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.
Your changes LGTM!
oh there's now an isort conflict, one minute... |
90d20a9
to
3a48e18
Compare
pkg_resources is deprecated and we're supposed to use importlib.resources instead. Unfortunately it's very awkward to use because it wants to support being able to read from possibly compressed archives or other Python package distribution formats. Since our distribution mechanism is Debian packages, we can avoid all of this entirely and just read the files off disk like any other file. A new `load_relative_css` helper finds CSS files next to the file invoking the function. Take the opportunity to simplify font loading: instead of hardcoding each font, just load every TTF in the fonts/ directory by using a recursive glob. And then drop some tests that don't test anything useful Fixes #1672. Fixes #1836.
3a48e18
to
0659565
Compare
Status
Ready for review
Description
pkg_resources is deprecated and we're supposed to use
importlib.resources instead. Unfortunately it's very awkward
to use because it wants to support being able to read from
possibly compressed archives or other Python package distribution
formats.
Since our distribution mechanism is Debian packages, we can avoid
all of this entirely and just read the files off disk like any
other file.
Take the opportunity to simplify font loading: instead of hardcoding
each font, just load every TTF in the fonts/ directory by using a
recursive glob.
And then drop some tests that don't test anything useful
Fixes #1672.
Fixes #1836.
Test Plan
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
If these changes add or remove files other than client code, the AppArmor profile may need to be updated. Please check as applicable: