From 739ebd5e3e01319810cbdfce68ff9d56d2cdff77 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 13 Jan 2021 20:25:49 +0100 Subject: dataclasses: Remaining dependency changes See #6023 --- README.asciidoc | 8 +++++--- doc/changelog.asciidoc | 2 ++ qutebrowser/misc/earlyinit.py | 2 +- qutebrowser/utils/version.py | 2 +- setup.py | 3 ++- tests/unit/utils/test_version.py | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index d90466469..a4fc38e7d 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -96,9 +96,11 @@ The following software and libraries are required to run qutebrowser: * http://jinja.pocoo.org/[jinja2] * http://pygments.org/[pygments] * https://github.com/yaml/pyyaml[PyYAML] -* https://www.attrs.org/[attrs] -* https://importlib-resources.readthedocs.io/[importlib_resources] (on Python - 3.8 or older) + +On older Python versions (3.6/3.7/3.8), the following backports are also required: + +* https://importlib-resources.readthedocs.io/[importlib_resources] (Python 3.8 or older) +* https://github.com/ericvsmith/dataclasses[dataclasses] (Python 3.6 only) The following libraries are optional: diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index c338d1545..58fbecb6f 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -54,6 +54,8 @@ Major changes 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, thus requiring the backports for those versions as well. +- The former dependency on the `attrs`/`attr` package is now dropped. +- On Python 3.6, a new dependency on the `dataclasses` backport is now required. Removed ~~~~~~~ diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index 936716078..f1afedca7 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -229,7 +229,7 @@ def check_libraries(): 'pypeg2': _missing_str("pypeg2"), 'jinja2': _missing_str("jinja2"), 'yaml': _missing_str("PyYAML"), - 'attr': _missing_str("attrs"), + 'dataclasses': _missing_str("dataclasses"), 'PyQt5.QtQml': _missing_str("PyQt5.QtQml"), 'PyQt5.QtSql': _missing_str("PyQt5.QtSql"), 'PyQt5.QtOpenGL': _missing_str("PyQt5.QtOpenGL"), diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index cb3f96346..74ad73833 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -365,7 +365,7 @@ MODULE_INFO: Mapping[str, ModuleInfo] = collections.OrderedDict([ ('pygments', ['__version__']), ('yaml', ['__version__']), ('adblock', ['__version__'], "0.3.2"), - ('attr', ['__version__']), + ('dataclasses', []), ('importlib_resources', []), ('PyQt5.QtWebEngineWidgets', []), ('PyQt5.QtWebEngine', ['PYQT_WEBENGINE_VERSION_STR']), diff --git a/setup.py b/setup.py index fbbc37153..825daf64d 100755 --- a/setup.py +++ b/setup.py @@ -71,7 +71,8 @@ try: entry_points={'gui_scripts': ['qutebrowser = qutebrowser.qutebrowser:main']}, zip_safe=True, - install_requires=['pypeg2', 'jinja2', 'PyYAML', 'attrs', + install_requires=['pypeg2', 'jinja2', 'PyYAML', + 'dataclasses; python_version < "3.7"', 'importlib_resources>=1.1.0; python_version < "3.9"'], python_requires='>=3.6', name='qutebrowser', diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index f182f4675..912be3bec 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -714,7 +714,7 @@ class TestModuleVersions: ('pygments', True), ('yaml', True), ('adblock', True), - ('attr', True), + ('dataclasses', False), ]) def test_existing_attributes(self, name, has_version): """Check if all dependencies have an expected __version__ attribute. -- cgit v1.2.3-54-g00ecf