From 0d64ae3fe33663d5ee536a53d15b21763b73e488 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 17 Jan 2021 13:18:41 +0100 Subject: Finish dropping PyPEG2 Closes #1161 --- .mypy.ini | 8 -------- README.asciidoc | 1 - doc/changelog.asciidoc | 4 ++++ doc/contributing.asciidoc | 1 - doc/install.asciidoc | 2 -- misc/requirements/requirements-qutebrowser.txt-raw | 1 - misc/requirements/requirements-tests-git.txt | 1 - qutebrowser/browser/webkit/rfc6266.py | 2 +- qutebrowser/misc/earlyinit.py | 2 -- qutebrowser/utils/version.py | 1 - requirements.txt | 1 - scripts/dev/recompile_requirements.py | 1 - scripts/dev/run_vulture.py | 8 -------- setup.py | 2 +- tests/unit/utils/test_version.py | 1 - 15 files changed, 6 insertions(+), 30 deletions(-) diff --git a/.mypy.ini b/.mypy.ini index d629f012c..00b470d7b 100644 --- a/.mypy.ini +++ b/.mypy.ini @@ -36,10 +36,6 @@ ignore_missing_imports = True # https://bitbucket.org/birkenfeld/pygments-main/issues/1485/type-hints ignore_missing_imports = True -[mypy-pypeg2] -# Pretty much inactive currently -ignore_missing_imports = True - [mypy-bdb] # stdlib, missing in typeshed # https://github.com/python/typeshed/issues/1019 @@ -53,10 +49,6 @@ ignore_missing_imports = True # https://github.com/pytest-dev/pytest/issues/3342 ignore_missing_imports = True -[mypy-qutebrowser.browser.webkit.rfc6266] -# subclasses dynamic PyPEG2 classes -disallow_subclassing_any = False - [mypy-qutebrowser.browser.browsertab] disallow_untyped_defs = True diff --git a/README.asciidoc b/README.asciidoc index a4fc38e7d..787ee049a 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -92,7 +92,6 @@ The following software and libraries are required to run qutebrowser: for Python 3 * https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools] (being phased out for qutebrowser v2.0.0) -* https://fdik.org/pyPEG/[pyPEG2] * http://jinja.pocoo.org/[jinja2] * http://pygments.org/[pygments] * https://github.com/yaml/pyyaml[PyYAML] diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 02ac2aad2..a88ece965 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -28,6 +28,7 @@ Major changes if not, consider packaging it, albeit optional it's very useful for users) * Remove the `cssutils` optional dependency (if present) * Remove the `attrs` (`attr`) dependency + * Remove the `pypeg2` dependency * Move the `pygments` dependency from required to optional * TODO: Move the `setuptools` dependency from runtime (for `pkg_resources`) to build-time. @@ -71,6 +72,9 @@ Major changes 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. +- The former dependency on the `pypeg2` package is now dropped. This might cause + some changes for certain corner-cases for suggested filenames when downloading + files with the QtWebKit backend. - Windows 7 is not supported anymore by the Windows binaries. Removed diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index 3960dec27..f50067571 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -228,7 +228,6 @@ Documentation of used Python libraries: * http://jinja.pocoo.org/docs/dev/[jinja2] * http://pygments.org/docs/[pygments] -* http://fdik.org/pyPEG/index.html[pyPEG2] * http://pythonhosted.org/setuptools/[setuptools] * http://www.pyinstaller.org/[PyInstaller] * https://pypi.python.org/pypi/colorama[colorama] diff --git a/doc/install.asciidoc b/doc/install.asciidoc index 03f079cad..954c7da41 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -218,8 +218,6 @@ sbopkg -V 14.2 sbopkg -r ---- -The pyPEG2 and MarkupSafe dependencies both need building for python3. You can either set PYTHON3=yes in the shell or set those as options in the dialog menu for each. - Generate a queue file for qutebrowser and dependencies: ---- diff --git a/misc/requirements/requirements-qutebrowser.txt-raw b/misc/requirements/requirements-qutebrowser.txt-raw index 1781775f4..6439331f0 100644 --- a/misc/requirements/requirements-qutebrowser.txt-raw +++ b/misc/requirements/requirements-qutebrowser.txt-raw @@ -1,5 +1,4 @@ Jinja2 -pyPEG2 PyYAML attrs diff --git a/misc/requirements/requirements-tests-git.txt b/misc/requirements/requirements-tests-git.txt index 9efbeca40..83da60c59 100644 --- a/misc/requirements/requirements-tests-git.txt +++ b/misc/requirements/requirements-tests-git.txt @@ -30,6 +30,5 @@ git+https://github.com/tartley/colorama.git git+https://github.com/pallets/jinja.git git+https://github.com/pallets/markupsafe.git hg+http://bitbucket.org/birkenfeld/pygments-main -hg+https://bitbucket.org/fdik/pypeg git+https://github.com/python-attrs/attrs.git git+https://github.com/yaml/pyyaml.git diff --git a/qutebrowser/browser/webkit/rfc6266.py b/qutebrowser/browser/webkit/rfc6266.py index b20529849..82ab29c7f 100644 --- a/qutebrowser/browser/webkit/rfc6266.py +++ b/qutebrowser/browser/webkit/rfc6266.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see . -"""pyPEG parsing for the RFC 6266 (Content-Disposition) header.""" +"""Parsing for the RFC 6266 (Content-Disposition) header.""" import email.headerregistry import email.errors diff --git a/qutebrowser/misc/earlyinit.py b/qutebrowser/misc/earlyinit.py index f1afedca7..77ede4cca 100644 --- a/qutebrowser/misc/earlyinit.py +++ b/qutebrowser/misc/earlyinit.py @@ -200,7 +200,6 @@ def _check_modules(modules): for name, text in modules.items(): try: - # https://bitbucket.org/fdik/pypeg/commits/dd15ca462b532019c0a3be1d39b8ee2f3fa32f4e # pylint: disable=bad-continuation with log.py_warning_filter( category=DeprecationWarning, @@ -226,7 +225,6 @@ def check_libraries(): """Check if all needed Python libraries are installed.""" modules = { 'pkg_resources': _missing_str("pkg_resources/setuptools"), - 'pypeg2': _missing_str("pypeg2"), 'jinja2': _missing_str("jinja2"), 'yaml': _missing_str("PyYAML"), 'dataclasses': _missing_str("dataclasses"), diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 94c835357..237edcdfe 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -360,7 +360,6 @@ MODULE_INFO: Mapping[str, ModuleInfo] = collections.OrderedDict([ [ ('sip', ['SIP_VERSION_STR']), ('colorama', ['VERSION', '__version__']), - ('pypeg2', ['__version__']), ('jinja2', ['__version__']), ('pygments', ['__version__']), ('yaml', ['__version__']), diff --git a/requirements.txt b/requirements.txt index b8fab9abf..6d2f8b49f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,4 @@ importlib-resources==5.0.0 ; python_version<"3.9" Jinja2==2.11.2 MarkupSafe==1.1.1 Pygments==2.7.3 -pyPEG2==2.15.2 PyYAML==5.3.1 diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index 52ecf61f2..8da640408 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -174,7 +174,6 @@ CHANGELOG_URLS = { 'mypy-extensions': 'https://github.com/python/mypy_extensions/commits/master', 'pyroma': 'https://github.com/regebro/pyroma/blob/master/HISTORY.txt', 'adblock': 'https://github.com/ArniDagur/python-adblock/blob/master/CHANGELOG.md', - 'pyPEG2': None, 'importlib-resources': 'https://importlib-resources.readthedocs.io/en/latest/history.html', 'dataclasses': 'https://github.com/ericvsmith/dataclasses#release-history', } diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py index 05fcc9134..ce7956d29 100755 --- a/scripts/dev/run_vulture.py +++ b/scripts/dev/run_vulture.py @@ -33,7 +33,6 @@ import qutebrowser.app # pylint: disable=unused-import from qutebrowser.extensions import loader from qutebrowser.misc import objects from qutebrowser.utils import utils, version -from qutebrowser.browser.webkit import rfc6266 # To run the decorators from there # pylint: disable=unused-import from qutebrowser.browser.webkit.network import webkitqutescheme @@ -50,13 +49,6 @@ def whitelist_generator(): # noqa: C901 for cmd in objects.commands.values(): yield utils.qualname(cmd.handler) - # pyPEG2 classes - for name, member in inspect.getmembers(rfc6266, inspect.isclass): - for attr in ['grammar', 'regex']: - if hasattr(member, attr): - yield 'qutebrowser.browser.webkit.rfc6266.{}.{}'.format(name, - attr) - # PyQt properties yield 'qutebrowser.mainwindow.statusbar.bar.StatusBar.color_flags' yield 'qutebrowser.mainwindow.statusbar.url.UrlText.urltype' diff --git a/setup.py b/setup.py index 825daf64d..9b9057201 100755 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ try: entry_points={'gui_scripts': ['qutebrowser = qutebrowser.qutebrowser:main']}, zip_safe=True, - install_requires=['pypeg2', 'jinja2', 'PyYAML', + install_requires=['jinja2', 'PyYAML', 'dataclasses; python_version < "3.7"', 'importlib_resources>=1.1.0; python_version < "3.9"'], python_requires='>=3.6', diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 6d94fc72c..2b989c740 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -709,7 +709,6 @@ class TestModuleVersions: @pytest.mark.parametrize('name, has_version', [ ('sip', False), ('colorama', True), - ('pypeg2', True), ('jinja2', True), ('pygments', True), ('yaml', True), -- cgit v1.2.3-54-g00ecf