diff --git a/INSTALL.asciidoc b/INSTALL.asciidoc index 0cfc3d651..d53c33fa3 100644 --- a/INSTALL.asciidoc +++ b/INSTALL.asciidoc @@ -206,17 +206,7 @@ It's recommended to install `qt5.qtwebengine` and start with On openSUSE ----------- -There are prebuilt RPMs available for Tumbleweed and Leap 42.1: - -http://software.opensuse.org/download.html?project=home%3Aarpraher&package=qutebrowser[One Click Install] - -Or add the repo manually: - ----- -# zypper addrepo http://download.opensuse.org/repositories/home:arpraher/openSUSE_Tumbleweed/home:arpraher.repo -# zypper refresh -# zypper install qutebrowser ----- +There are prebuilt RPMs available at https://software.opensuse.org/download.html?project=network&package=qutebrowser[OBS]. On OpenBSD ---------- diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 9d6737a96..98979c4d8 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -4,6 +4,6 @@ certifi==2017.7.27.1 chardet==3.0.4 codecov==2.0.9 coverage==4.4.1 -idna==2.5 -requests==2.18.2 +idna==2.6 +requests==2.18.3 urllib3==1.22 diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index 5e5980525..517938526 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -18,6 +18,6 @@ packaging==16.8 pep8-naming==0.4.1 pycodestyle==2.3.1 pydocstyle==1.1.1 # rq.filter: < 2.0.0 -pyflakes==1.5.0 +pyflakes==1.6.0 pyparsing==2.2.0 six==1.10.0 diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 3b36a0e5c..c6894673f 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==16.8 pyparsing==2.2.0 -setuptools==36.2.5 +setuptools==36.2.7 six==1.10.0 wheel==0.29.0 diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index fc019e5a9..9b16d9413 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -1,3 +1,3 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py --e git+https://github.com/xoviat/pyinstaller.git@qtweb#egg=PyInstaller +-e git+https://github.com/pyinstaller/pyinstaller.git@develop#egg=PyInstaller diff --git a/misc/requirements/requirements-pyinstaller.txt-raw b/misc/requirements/requirements-pyinstaller.txt-raw index 522ef7df2..f6cb8ce72 100644 --- a/misc/requirements/requirements-pyinstaller.txt-raw +++ b/misc/requirements/requirements-pyinstaller.txt-raw @@ -1,4 +1,4 @@ --e git+https://github.com/xoviat/pyinstaller.git@qtweb#egg=PyInstaller +-e git+https://github.com/pyinstaller/pyinstaller.git@develop#egg=PyInstaller # remove @commit-id for scm installs -#@ replace: @.*# @qtweb# \ No newline at end of file +#@ replace: @.*# @develop# diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index d4058b1d0..ec4693abf 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -4,15 +4,15 @@ certifi==2017.7.27.1 chardet==3.0.4 github3.py==0.9.6 -idna==2.5 +idna==2.6 isort==4.2.15 lazy-object-proxy==1.3.1 mccabe==0.6.1 -e git+https://github.com/PyCQA/pylint.git#egg=pylint ./scripts/dev/pylint_checkers -requests==2.18.2 +requests==2.18.3 six==1.10.0 uritemplate==3.0.0 uritemplate.py==3.0.2 urllib3==1.22 -wrapt==1.10.10 +wrapt==1.10.11 diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index b5d44cb64..dde7a5ad1 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -4,15 +4,15 @@ astroid==1.5.3 certifi==2017.7.27.1 chardet==3.0.4 github3.py==0.9.6 -idna==2.5 +idna==2.6 isort==4.2.15 lazy-object-proxy==1.3.1 mccabe==0.6.1 pylint==1.7.2 ./scripts/dev/pylint_checkers -requests==2.18.2 +requests==2.18.3 six==1.10.0 uritemplate==3.0.0 uritemplate.py==3.0.2 urllib3==1.22 -wrapt==1.10.10 +wrapt==1.10.11 diff --git a/misc/requirements/requirements-pyroma.txt b/misc/requirements/requirements-pyroma.txt index 9febd961b..d6ed0c190 100644 --- a/misc/requirements/requirements-pyroma.txt +++ b/misc/requirements/requirements-pyroma.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -docutils==0.13.1 +docutils==0.14 pyroma==2.2 diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 171013afb..12a291c42 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py beautifulsoup4==4.6.0 -cheroot==5.7.0 +cheroot==5.8.3 click==6.7 # colorama==0.3.9 coverage==4.4.1 @@ -12,7 +12,7 @@ Flask==0.12.2 glob2==0.5 httpbin==0.5.0 hunter==1.4.1 -hypothesis==3.14.0 +hypothesis==3.18.0 itsdangerous==0.24 # Jinja2==2.9.6 Mako==1.0.7 @@ -20,7 +20,7 @@ Mako==1.0.7 parse==1.8.2 parse-type==0.3.4 py==1.4.34 -pytest==3.1.3 +pytest==3.2.1 pytest-bdd==2.18.2 pytest-benchmark==3.1.1 pytest-catchlog==1.2.2 @@ -35,5 +35,5 @@ pytest-travis-fold==1.2.0 pytest-xvfb==1.0.0 PyVirtualDisplay==0.2.1 six==1.10.0 -vulture==0.21 +vulture==0.24 Werkzeug==0.12.2 diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index d1c1bc41d..5c26fc57c 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,3 +1,3 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -vulture==0.21 +vulture==0.24 diff --git a/pytest.ini b/pytest.ini index 0062b26e2..05353f275 100644 --- a/pytest.ini +++ b/pytest.ini @@ -49,6 +49,7 @@ qt_log_ignore = ^Geoclue error: Process org\.freedesktop\.Geoclue\.Master exited with status 127 ^Failed to create Geoclue client interface. Geoclue error: org\.freedesktop\.DBus\.Error\.Disconnected ^QDBusConnection: name 'org.freedesktop.Geoclue.Master' had owner '' but we thought it was ':1.1' + ^Failed to create Geoclue client interface. Geoclue error: org\.freedesktop\.DBus\.Error\.Disconnected ^QObject::connect: Cannot connect \(null\)::stateChanged\(QNetworkSession::State\) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged\(QNetworkSession::State\) ^QXcbClipboard: Cannot transfer data, no data available ^load glyph failed diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index b11c2e277..79a8502cd 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -2036,8 +2036,9 @@ class CommandDispatcher: message.info(out) if file: + path = os.path.expanduser(js_code) try: - with open(js_code, 'r', encoding='utf-8') as f: + with open(path, 'r', encoding='utf-8') as f: js_code = f.read() except OSError as e: raise cmdexc.CommandError(str(e)) diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py index 48e649007..63f6abe09 100644 --- a/qutebrowser/completion/models/configmodel.py +++ b/qutebrowser/completion/models/configmodel.py @@ -29,7 +29,7 @@ def option(): model = completionmodel.CompletionModel(column_widths=(20, 70, 10)) options = ((x.name, x.description, config.instance.get_str(x.name)) for x in configdata.DATA.values()) - model.add_category(listcategory.ListCategory("Options", options)) + model.add_category(listcategory.ListCategory("Options", sorted(options))) return model @@ -55,7 +55,8 @@ def value(optname, *_values): vals = opt.typ.complete() if vals is not None: - model.add_category(listcategory.ListCategory("Completions", vals)) + model.add_category(listcategory.ListCategory("Completions", + sorted(vals))) return model diff --git a/qutebrowser/completion/models/listcategory.py b/qutebrowser/completion/models/listcategory.py index b1ad77bae..111cd8358 100644 --- a/qutebrowser/completion/models/listcategory.py +++ b/qutebrowser/completion/models/listcategory.py @@ -60,33 +60,19 @@ class ListCategory(QSortFilterProxyModel): sortcol = 0 self.sort(sortcol) - def lessThan(self, lindex, rindex): + def lessThan(self, _lindex, rindex): """Custom sorting implementation. - Prefers all items which start with self._pattern. Other than that, uses - normal Python string sorting. + Prefers all items which start with self._pattern. Other than that, keep + items in their original order. Args: - lindex: The QModelIndex of the left item (*left* < right) + _lindex: The QModelIndex of the left item (*left* < right) rindex: The QModelIndex of the right item (left < *right*) Return: True if left < right, else False """ - qtutils.ensure_valid(lindex) qtutils.ensure_valid(rindex) - - left = self.srcmodel.data(lindex) right = self.srcmodel.data(rindex) - - leftstart = left.startswith(self._pattern) - rightstart = right.startswith(self._pattern) - - if leftstart and rightstart: - return left < right - elif leftstart: - return True - elif rightstart: - return False - else: - return left < right + return not right.startswith(self._pattern) diff --git a/qutebrowser/completion/models/util.py b/qutebrowser/completion/models/util.py index 317414203..f0ec4ecd0 100644 --- a/qutebrowser/completion/models/util.py +++ b/qutebrowser/completion/models/util.py @@ -49,4 +49,4 @@ def get_cmd_completions(include_hidden, include_aliases, prefix=''): bindings = ', '.join(cmd_to_keys.get(name, [])) cmdlist.append((name, "Alias for '{}'".format(cmd), bindings)) - return cmdlist + return sorted(cmdlist) diff --git a/qutebrowser/misc/sessions.py b/qutebrowser/misc/sessions.py index 94e9fd8f9..4581af651 100644 --- a/qutebrowser/misc/sessions.py +++ b/qutebrowser/misc/sessions.py @@ -421,7 +421,7 @@ class SessionManager(QObject): base, ext = os.path.splitext(filename) if ext == '.yml': sessions.append(base) - return sessions + return sorted(sessions) @cmdutils.register(instance='session-manager') @cmdutils.argument('name', completion=miscmodels.session) diff --git a/qutebrowser/utils/version.py b/qutebrowser/utils/version.py index 0b650a97e..91f794c59 100644 --- a/qutebrowser/utils/version.py +++ b/qutebrowser/utils/version.py @@ -81,6 +81,8 @@ def distribution(): return None pretty = info.get('PRETTY_NAME', 'Unknown') + if pretty == 'Linux': # Thanks, Funtoo + pretty = info.get('NAME', pretty) if 'VERSION_ID' in info: dist_version = pkg_resources.parse_version(info['VERSION_ID']) @@ -88,8 +90,11 @@ def distribution(): dist_version = None dist_id = info.get('ID', None) + id_mappings = { + 'funtoo': 'gentoo', # does not have ID_LIKE=gentoo + } try: - parsed = Distribution[dist_id] + parsed = Distribution[id_mappings.get(dist_id, dist_id)] except KeyError: parsed = Distribution.unknown diff --git a/tests/unit/completion/test_listcategory.py b/tests/unit/completion/test_listcategory.py index 8d8936167..2ab7defbe 100644 --- a/tests/unit/completion/test_listcategory.py +++ b/tests/unit/completion/test_listcategory.py @@ -31,7 +31,7 @@ from qutebrowser.completion.models import listcategory ('foo', [('foob', ''), ('fooc', ''), ('fooa', '')], - [('fooa', ''), ('foob', ''), ('fooc', '')]), + [('foob', ''), ('fooc', ''), ('fooa', '')]), # prefer foobar as it starts with the pattern ('foo', diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index 1945f53ec..190565925 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -132,8 +132,8 @@ def quickmarks(quickmark_manager_stub): """Pre-populate the quickmark-manager stub with some quickmarks.""" quickmark_manager_stub.marks = collections.OrderedDict([ ('aw', 'https://wiki.archlinux.org'), - ('ddg', 'https://duckduckgo.com'), ('wiki', 'https://wikipedia.org'), + ('ddg', 'https://duckduckgo.com'), ]) return quickmark_manager_stub @@ -245,16 +245,16 @@ def test_quickmark_completion(qtmodeltester, quickmarks): _check_completions(model, { "Quickmarks": [ ('aw', 'https://wiki.archlinux.org', None), - ('ddg', 'https://duckduckgo.com', None), ('wiki', 'https://wikipedia.org', None), + ('ddg', 'https://duckduckgo.com', None), ] }) @pytest.mark.parametrize('row, removed', [ (0, 'aw'), - (1, 'ddg'), - (2, 'wiki'), + (1, 'wiki'), + (2, 'ddg'), ]) def test_quickmark_completion_delete(qtmodeltester, quickmarks, row, removed): """Test deleting a quickmark from the quickmark completion model.""" @@ -281,17 +281,17 @@ def test_bookmark_completion(qtmodeltester, bookmarks): _check_completions(model, { "Bookmarks": [ - ('http://qutebrowser.org', 'qutebrowser | qutebrowser', None), ('https://github.com', 'GitHub', None), ('https://python.org', 'Welcome to Python.org', None), + ('http://qutebrowser.org', 'qutebrowser | qutebrowser', None), ] }) @pytest.mark.parametrize('row, removed', [ - (0, 'http://qutebrowser.org'), - (1, 'https://github.com'), - (2, 'https://python.org'), + (0, 'https://github.com'), + (1, 'https://python.org'), + (2, 'http://qutebrowser.org'), ]) def test_bookmark_completion_delete(qtmodeltester, bookmarks, row, removed): """Test deleting a quickmark from the quickmark completion model.""" @@ -325,14 +325,14 @@ def test_url_completion(qtmodeltester, web_history_populated, _check_completions(model, { "Quickmarks": [ - ('https://duckduckgo.com', 'ddg', None), ('https://wiki.archlinux.org', 'aw', None), ('https://wikipedia.org', 'wiki', None), + ('https://duckduckgo.com', 'ddg', None), ], "Bookmarks": [ - ('http://qutebrowser.org', 'qutebrowser | qutebrowser', None), ('https://github.com', 'GitHub', None), ('https://python.org', 'Welcome to Python.org', None), + ('http://qutebrowser.org', 'qutebrowser | qutebrowser', None), ], "History": [ ('https://github.com', 'https://github.com', '2016-05-01'), @@ -384,12 +384,12 @@ def test_url_completion_delete_bookmark(qtmodeltester, bookmarks, # sanity checks assert model.data(parent) == "Bookmarks" - assert model.data(idx) == 'https://github.com' + assert model.data(idx) == 'https://python.org' assert 'https://github.com' in bookmarks.marks len_before = len(bookmarks.marks) model.delete_cur_item(idx) - assert 'https://github.com' not in bookmarks.marks + assert 'https://python.org' not in bookmarks.marks assert len_before == len(bookmarks.marks) + 1 @@ -407,12 +407,12 @@ def test_url_completion_delete_quickmark(qtmodeltester, # sanity checks assert model.data(parent) == "Quickmarks" - assert model.data(idx) == 'https://duckduckgo.com' + assert model.data(idx) == 'https://wiki.archlinux.org' assert 'ddg' in quickmarks.marks len_before = len(quickmarks.marks) model.delete_cur_item(idx) - assert 'ddg' not in quickmarks.marks + assert 'aw' not in quickmarks.marks assert len_before == len(quickmarks.marks) + 1 @@ -455,9 +455,9 @@ def test_session_completion(qtmodeltester, session_manager_stub): qtmodeltester.check(model) _check_completions(model, { - "Sessions": [('1', None, None), - ('2', None, None), - ('default', None, None)] + "Sessions": [('default', None, None), + ('1', None, None), + ('2', None, None)] }) diff --git a/tests/unit/misc/test_sessions.py b/tests/unit/misc/test_sessions.py index 231e7f997..db9bef949 100644 --- a/tests/unit/misc/test_sessions.py +++ b/tests/unit/misc/test_sessions.py @@ -372,7 +372,7 @@ class TestListSessions: (tmpdir / 'foo.yml').ensure() (tmpdir / 'bar.yml').ensure() sess_man = sessions.SessionManager(str(tmpdir)) - assert sorted(sess_man.list_sessions()) == ['bar', 'foo'] + assert sess_man.list_sessions() == ['bar', 'foo'] def test_with_other_files(self, tmpdir): (tmpdir / 'foo.yml').ensure() diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index f9da37841..46a1ba232 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -164,6 +164,15 @@ from qutebrowser.browser import pdfjs version.DistributionInfo( id='manjaro', parsed=version.Distribution.manjaro, version=None, pretty='Manjaro Linux')), + # Funtoo + (""" + ID="funtoo" + NAME="Funtoo GNU/Linux" + PRETTY_NAME="Linux" + """, + version.DistributionInfo( + id='funtoo', parsed=version.Distribution.gentoo, + version=None, pretty='Funtoo GNU/Linux')), ]) def test_distribution(tmpdir, monkeypatch, os_release, expected): os_release_file = tmpdir / 'os-release'