Finish dropping pkg_resources

Closes #4467
This commit is contained in:
Florian Bruhin 2021-01-26 17:08:06 +01:00
parent 579585d554
commit 5593c8f411
4 changed files with 4 additions and 8 deletions

View File

@ -91,8 +91,6 @@ unpatched vulnerabilities. Please use it carefully and avoid visiting untrusted
websites and using it for transmission of sensitive data._
* https://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.12.0 or newer
for Python 3
* https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools] (being
phased out for qutebrowser v2.0.0)
* https://palletsprojects.com/p/jinja/[jinja2]
* https://pygments.org/[pygments]
* https://github.com/yaml/pyyaml[PyYAML]

View File

@ -32,7 +32,7 @@ Major changes
if not used elsewhere - it's https://fdik.org/pyPEG2/[inactive upstream]
and the repository was removed by Bitbucket).
* Move the `pygments` dependency from required to optional.
* TODO: Move the `setuptools` dependency from runtime (for `pkg_resources`) to
* Move the `setuptools` dependency from runtime (for `pkg_resources`) to
build-time.
* For Python 3.6, 3.7 or 3.8, add a dependency on the `importlib_resources`
backport.
@ -66,8 +66,7 @@ Major changes
used when using `:view-source` with QtWebKit, or when forcing it via
`:view-source --pygments` on QtWebEngine. If it is unavailable, an
unhighlighted fallback version of the page's source is shown.
- TODO: The former dependency on the `pkg_resources` module (part of the
`setuptools` project) got dropped.
- The former dependency on the `pkg_resources` module (part of the `setuptools`project) got dropped.
- A new dependency on the `importlib_resources` module got introduced for
Python versions up to and including 3.8. Note that the stdlib
`importlib.resources` module for Python 3.7 and 3.8 is missing the needed APIs,

View File

@ -224,7 +224,6 @@ def _check_modules(modules):
def check_libraries():
"""Check if all needed Python libraries are installed."""
modules = {
'pkg_resources': _missing_str("pkg_resources/setuptools"),
'jinja2': _missing_str("jinja2"),
'yaml': _missing_str("PyYAML"),
'dataclasses': _missing_str("dataclasses"),

View File

@ -208,8 +208,8 @@ def read_file(filename: str, binary: bool = False) -> Any:
return _resource_cache[filename]
if hasattr(sys, 'frozen'):
# PyInstaller doesn't support pkg_resources :(
# https://github.com/pyinstaller/pyinstaller/wiki/FAQ#misc
# For PyInstaller, where we can't store resource files in a qutebrowser/ folder
# because the executable is already named "qutebrowser" (at least on macOS).
fn = os.path.join(os.path.dirname(sys.executable), filename)
if binary:
f: IO