Finish dropping PyPEG2

Closes #1161
This commit is contained in:
Florian Bruhin 2021-01-17 13:18:41 +01:00
parent 2ab4d8a021
commit 0d64ae3fe3
15 changed files with 6 additions and 30 deletions

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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]

View File

@ -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:
----

View File

@ -1,5 +1,4 @@
Jinja2
pyPEG2
PyYAML
attrs

View File

@ -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

View File

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""pyPEG parsing for the RFC 6266 (Content-Disposition) header."""
"""Parsing for the RFC 6266 (Content-Disposition) header."""
import email.headerregistry
import email.errors

View File

@ -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"),

View File

@ -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__']),

View File

@ -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

View File

@ -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',
}

View File

@ -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'

View File

@ -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',

View File

@ -709,7 +709,6 @@ class TestModuleVersions:
@pytest.mark.parametrize('name, has_version', [
('sip', False),
('colorama', True),
('pypeg2', True),
('jinja2', True),
('pygments', True),
('yaml', True),