Commit Graph

7997 Commits

Author SHA1 Message Date
Florian Bruhin
4a551a6758 Show exception stack when handling cmdexc errors. 2016-05-13 07:43:44 +02:00
Florian Bruhin
b6abada50a Fix lint 2016-05-13 06:42:09 +02:00
Florian Bruhin
a7ece80d34 Merge branch 'pyinstaller' 2016-05-13 06:21:28 +02:00
Florian Bruhin
d507727bb3 tox: Update PyInstaller to 3.2
- Even the “main” script is now byte-compiled
- The manual is on readthedocs.io now
- On installation try to compile the bootloader if there is none for the
  current plattform
- (Unix) Use objcopy to create a valid ELF file
- (Linux): Compile with _FORTIFY_SOURCE
- New, updated and fixed hooks: CherryPy, Cryptography, enchant,
  gi.repository.GdkPixbuf, gst, Lib2to3, PyQt4, PyQt5, PySide, SciPy,
  sphinx, sqlalchemy, traitlets, wx.lib.pubsub
- For windowed mode add isatty() for our dummy NullWriter
- Suppress “Failed to execute script” in case of SystemExit
- Do not apply Upx compressor for bootloader files
- Fix absolute path for lib used via ctypes
- (OSX) Fix binary cache on NFS
- (Windows) Fix message in grab_version
- (Windows) Fix wrong icon paramter in Windows example
- (Windows) Fix win32 unicode handling
- (Windows) Fix unnecessary rebuilds caused by rebuilding winmanifest
- (Cygwin) Fix finding the Python library for Cygwin 64-bit
- (OSX) Fix compilation issue
- (Windows) No longer bundle pefile, use package from for windows
- (Windows) Provide a more robust means of executing a Python script
- AIX fixes.
- Update waf to version 1.8.20
- Fix excludedimports, more predictable order how hooks are applied
- Internal impovements and code clean-up
- Clean-ups fixes and improvements for the test suite
2016-05-13 05:23:19 +02:00
Florian Bruhin
b755d56c02 Rename setup.cfg to .flake8
We only use it to store flake8 config, and it turns out flake8 didn't
actually deprecate .flake8.
2016-05-12 22:58:12 +02:00
Florian Bruhin
aea30e810a Fix lint 2016-05-12 21:11:45 +02:00
Florian Bruhin
af1880fc1d tox: Update pyflakes to 1.2.3 2016-05-12 21:11:14 +02:00
Florian Bruhin
7901d2929a ci: Update pip to 8.1.2
Since virtualenv uses the built-in pip version with VIRTUALENV_DOWNLOAD=no we
need to make sure we keep virtualenv capped, but we can use a newer pip.
2016-05-12 20:32:03 +02:00
Florian Bruhin
b634b051c8 travis: Set VIRTUALENV_DOWNLOAD=no
Things broke because of the virtualenv upgrade in requirements-tox.txt.
virtualenv bundles a "good" pip version (good: doesn't suffer
from #1486). However the virtualenv upgrade caused us to get a new
version which downloads a new pip. Setting VIRTUALENV_DOWNLOAD=no
prevents that from happening.
2016-05-12 20:32:03 +02:00
Florian Bruhin
e70d6d49d9 travis: Separate requirement files
This way we can update pip independently before installing the rest, and
avoid installing codecov (and thus coverage which attempts to build C
extension) where it's not needed.
2016-05-12 20:32:03 +02:00
Florian Bruhin
d4e2b4ebb4 travis: Don't update Python for flake8 env
This was needed because of a bug for which the backfix seems to be
ported to Ubuntu now.
2016-05-12 20:32:03 +02:00
Florian Bruhin
56a2b6778c travis: Install libpython3.4-dev
This is now needed because we use "language: generic" which doesn't come
with that package.
2016-05-12 20:32:03 +02:00
Florian Bruhin
0086fc7851 travis: Use "language: generic"
This means we'll get the most minimal image and can install exactly what
we need.
2016-05-12 20:32:03 +02:00
Florian Bruhin
0632f6886e flake8: Adjust appveyor_install.py path
We have some ignores local to that file, and after renaming the file
they showed up again.

We also remove the C901 ignore (mccabe complexity check) as the script
got simpler.
2016-05-12 20:32:03 +02:00
Florian Bruhin
e13320b398 travis: Use python2 for pip
This means we won't need to install pip via apt-get, and using a
Python 2 tox/pip is fine.
2016-05-12 20:32:03 +02:00
Florian Bruhin
3033f77f99 travis: Use (( in travis_retry
If we use [, the script exits when a condition is false (as we use
set -e).
2016-05-12 20:32:03 +02:00
Florian Bruhin
cdc79339fb travis: Use requirement files for pip
This way we can pin tox/pip versions (which are used in the native
Travis environment) *and* get notified about updates by requires.io.
2016-05-12 20:32:03 +02:00
Florian Bruhin
6558e196b4 Simplify package installation on CI
Having a Python script was a good idea back when we could do almost the
same steps on every CI configuration.

This turned out to grow into a complicated script, so it's easier to
split off things for Linux/OS X into a small shell script (and keep
Python for Windows, as I really don't want to use .bat/.ps).
2016-05-12 20:32:03 +02:00
Florian Bruhin
768ff8b193 tox: update pyparsing to 2.1.3
- _trim_arity fix in 2.1.2 was very version-dependent on Py 3.5.0.
  Now works for Python 2.x, 3.3, 3.4, 3.5.0, and 3.5.1 (and hopefully
  beyond).

This fixes pyparsing/flake8-putyt/flake8 being broken with python 3.4:

    >>> import pyparsing
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File ".../pyparsing.py", line 3478, in <module>
        _escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
      File ".../pyparsing.py", line 948, in setParseAction
        self.parseAction = list(map(_trim_arity, list(fns)))
      File ".../pyparsing.py", line 808, in _trim_arity
        this_line = extract_stack()[-1]
      File ".../pyparsing.py", line 793, in extract_stack
        return [(frame_summary.filename, frame_summary.lineno)]
    AttributeError: 'tuple' object has no attribute 'filename'

See https://sourceforge.net/p/pyparsing/bugs/95/
2016-05-12 20:32:03 +02:00
Florian Bruhin
37a1d0cb6f Log stacktrace of error messages to debug log 2016-05-12 20:30:07 +02:00
Florian Bruhin
e095f9ded2 tox: Downgrade pyparsing to 2.1.1
It seems pyparsing 2.1.2 is broken with Python 3.4:

    >>> import pyparsing
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File ".../pyparsing.py", line 3478, in <module>
        _escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
      File ".../pyparsing.py", line 948, in setParseAction
        self.parseAction = list(map(_trim_arity, list(fns)))
      File ".../pyparsing.py", line 808, in _trim_arity
        this_line = extract_stack()[-1]
      File ".../pyparsing.py", line 793, in extract_stack
        return [(frame_summary.filename, frame_summary.lineno)]
    AttributeError: 'tuple' object has no attribute 'filename'

That breaks flake8-putty and thus flake8.
See https://sourceforge.net/p/pyparsing/bugs/95/
2016-05-11 08:15:12 +02:00
Florian Bruhin
3098d1fd8c tox: Hardcode more indirect deps for flake8 env
We added more flake8 checkers but never regenerated those, causing some
updates to happen silently and (probably?) breaking stuff.
2016-05-11 06:34:19 +02:00
Florian Bruhin
7a51387fb3 Move comment in tox.ini
On Travis CI, the flake8 env suddenly started to fail (pip upgrade?):

    Invalid requirement: 'pep257==0.7.0  # still needed by flake8-docstrings but ignored'
    Traceback (most recent call last):
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py", line 92, in __init__
        req = REQUIREMENT.parseString(requirement_string)
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1172, in parseString
        raise exc
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1162, in parseString
        loc, tokens = self._parse( instring, 0 )
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1028, in _parseNoCache
        loc,tokens = self.parseImpl( instring, preloc, doActions )
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 2462, in parseImpl
        loc, exprtokens = e._parse( instring, loc, doActions )
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1032, in _parseNoCache
        loc,tokens = self.parseImpl( instring, preloc, doActions )
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 2265, in parseImpl
        raise ParseException(instring, loc, self.errmsg, self)
    pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 15), (line:1, col:16)
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/req/req_install.py", line 78, in __init__
        req = Requirement(req)
      File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
        requirement_string[e.loc:e.loc + 8]))
    pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'# still '"

I can't reproduce this locally, but I hope this'll help.
2016-05-11 06:08:48 +02:00
Florian Bruhin
ac41c0ba18 tox: Update CherryPy to 5.4.0
* ``cherrypy.test.webtest.WebCase`` now honors a
  'WEBTEST_INTERACTIVE' environment variable to disable
  interactive tests (still enabled by default). Set to '0'
  or 'false' or 'False' to disable interactive tests.
* Fix AttributeError when listiterator was accessed
  using the ``next`` attribute.
* Removed ``cherrypy.lib.sessions.PostgresqlSession``.
* Fix errors with redirects to Unicode URLs.
2016-05-11 05:16:51 +02:00
Florian Bruhin
181a785ce6 Update changelog
[ci skip]
2016-05-10 23:49:10 +02:00
Florian Bruhin
62d35db16a Merge branch 'rcorre-show_binding2' 2016-05-10 23:48:30 +02:00
Florian Bruhin
cb27dbbfb5 Fix error message check for :bind test 2016-05-10 23:47:16 +02:00
Florian Bruhin
ea243ae022 Renumber keybindings in keyinput.feature
An unique keybinding for each test means we have some level of
isolation and can understand error messages more easily.

As we're >10 now, let's use a leading zero to avoid shadowed
keybindings.
2016-05-10 23:46:02 +02:00
Florian Bruhin
90c42ff2e2 Regenerate docs 2016-05-10 23:39:48 +02:00
Florian Bruhin
24d16dd0a7 Merge branch 'show_binding2' of https://github.com/rcorre/qutebrowser into rcorre-show_binding2 2016-05-10 23:39:32 +02:00
Florian Bruhin
36da07c73b Fix lint 2016-05-10 07:56:54 +02:00
Florian Bruhin
5eff35ba30 cmdutils.register: annotation -> arg for flags
Instead of using a 'flag' key in the annotation dict, we now use a flags
argument to @cmdutils.register which is a {argument: flag} dict.

See #637.
2016-05-10 07:35:41 +02:00
Florian Bruhin
49fb981e7f Add test for completion count in cmdutils.register 2016-05-10 07:12:50 +02:00
Florian Bruhin
9ca5acd546 Add tests for flags with @cmdutils.register 2016-05-10 07:00:10 +02:00
Florian Bruhin
b17ecd1376 Add tests for cmdutils.register/star_args_optional 2016-05-10 06:41:42 +02:00
Florian Bruhin
73fbfb9731 Replace 'nargs' annotation by star_args_optional
Before we used a {'nargs': '*'} annotation for the respective argument
to tell qutebrowser it's optional for the commandline. Now we instead
use a star_args_optional argument for @cmdutils.register as a first step
towards freeing up argument annotations for PEP 484.

See #637.
2016-05-09 22:49:24 +02:00
Florian Bruhin
e4e98c6c23 Delete QTextDocument properly in completion.
The CompletionItemDelegate gets reused by Qt for various items in the
completion. Every time _get_textdoc() was called we created a new
QTextDocument, but since it has a long-living parent set (the delegate)
the old one was never actually garbage collected.

We now explicitly delete the old QTextDocument as it's not needed
anymore by either Qt or Python.

See #1476.
2016-05-09 09:11:14 +02:00
Florian Bruhin
56f1d885f9 Use parens instead of \ to continue line 2016-05-09 07:18:12 +02:00
Florian Bruhin
2c6826f9e0 Merge branch 'phansch-bdd_test_insert_mode' 2016-05-09 07:15:48 +02:00
Florian Bruhin
8f3dda6709 Regenerate authors 2016-05-09 07:15:19 +02:00
Florian Bruhin
a8845be9e6 Merge branch 'bdd_test_insert_mode' of https://github.com/phansch/qutebrowser into phansch-bdd_test_insert_mode 2016-05-09 07:15:10 +02:00
Florian Bruhin
e132c1cc1e Merge branch 'Kingdread-confirm-quit-downloads' 2016-05-09 07:07:59 +02:00
Florian Bruhin
7f99c36ec5 Update changelog 2016-05-09 07:07:46 +02:00
Florian Bruhin
f7dc9b54bd Add a test for #846 2016-05-09 07:06:58 +02:00
Daniel Schadt
1fa50021c1 downloads: use right index for beginInsertRows
len(self.downloads) is already the index of the item in the download
list, this should be used for beginInsertRows(). The +1 is only for the
human readable part.
2016-05-08 23:36:31 +02:00
Daniel Schadt
99182e3e79 downloads: change len() to sum() 2016-05-08 23:36:31 +02:00
Daniel Schadt
643d2cc6dd fix confirm-quit=downloads with finished downloads
Issue #846

.rowCount() returns all downloads, even the finished ones that have not
yet been removed from the list. For confirming the quit event, we should
only consider downloads that are still running.
2016-05-08 23:36:31 +02:00
Florian Bruhin
a23aa1cc47 Fix broken supports_selection() test 2016-05-08 22:39:39 +02:00
Florian Bruhin
89c7b0e7f8 Simplify if-statement 2016-05-08 22:18:14 +02:00
Florian Bruhin
165504c1f2 bdd: Fix clipboard_contains_multiline 2016-05-08 22:09:19 +02:00