Add pygments as dependency.

This commit is contained in:
Florian Bruhin 2014-09-15 17:59:33 +02:00
parent 052fa8e277
commit 14cc77ff42
7 changed files with 29 additions and 4 deletions

View File

@ -75,6 +75,7 @@ The following software and libraries are required to run qutebrowser:
* https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools]
* http://fdik.org/pyPEG/[pyPEG2]
* http://jinja.pocoo.org/[jinja2]
* http://pygments.org/[pygments]
The following libraries are optional and provide colored logging in the
console:
@ -87,7 +88,7 @@ On Debian
----
# apt-get install python3-pyqt5 python3-pyqt5.qtwebkit python3-pkg-resources
python3-pip python3-jinja2
python3-pip python3-jinja2 python3-pygments
# pip3 install pypeg2 --allow-external pypeg2 --allow-unverified pypeg2
----
@ -132,6 +133,7 @@ to get Qt and PyQt5.
* Run +pip install --allow-external pypeg2 --allow-unverified pypeg2 pypeg2+ to
install pypeg2.
* Run +pip install jinja2+ to install jinja2.
* Run +pip install pygments+ to install pygments.
As soon as v0.1 is out, a standalone .exe (built with
http://cx-freeze.sourceforge.net/[cx_Freeze]) will be provided. In the

View File

@ -9,7 +9,8 @@ arch=(any)
url="http://www.qutebrowser.org/"
license=('GPL')
depends=('python>=3.4' 'python-setuptools' 'python-pyqt5>=5.2' 'qt5-base>=5.2'
'qt5-webkit>=5.2' 'libxkbcommon-x11' 'python-pypeg2' 'python-jinja')
'qt5-webkit>=5.2' 'libxkbcommon-x11' 'python-pypeg2' 'python-jinja'
'python-pygments')
makedepends=('python' 'python-setuptools')
optdepends=('python-colorlog: colored logging output')
options=(!emptydirs)

View File

@ -113,6 +113,7 @@ def main():
earlyinit.check_pkg_resources()
earlyinit.check_pypeg2()
earlyinit.check_jinja2()
earlyinit.check_pygments()
# We do this import late as we need to fix harfbuzz first.
from qutebrowser import app
from qutebrowser.utils import debug

View File

@ -264,3 +264,17 @@ def check_jinja2():
"~gohlke/pythonlibs/#jinja2 or via pip.",
pip="jinja2")
_die(text)
def check_pygments():
"""Check if pygments is installed."""
try:
import pygments # pylint: disable=unused-variable
except ImportError:
text = _missing_str("pygments",
debian="apt-get install python3-pygments",
arch="Install python-jinja from the AUR",
windows="Install from http://www.lfd.uci.edu/"
"~gohlke/pythonlibs/#pygments or via pip.",
pip="pygments")
_die(text)

View File

@ -167,6 +167,13 @@ def _module_versions():
else:
ver = getattr(jinja2, '__version__', 'yes')
lines.append('jinja2: {}'.format(ver))
try:
import pygments
except ImportError:
pass
else:
ver = getattr(pygments, '__version__', 'yes')
lines.append('pygments: {}'.format(ver))
return lines

View File

@ -98,7 +98,7 @@ setupdata = {
'description': _get_constant('description'),
'long_description': read_file('README.asciidoc'),
'url': 'http://www.qutebrowser.org/',
'requires': ['pypeg2', 'jinja2'],
'requires': ['pypeg2', 'jinja2', 'pygments'],
'author': _get_constant('author'),
'author_email': _get_constant('email'),
'license': _get_constant('license'),

View File

@ -47,7 +47,7 @@ try:
['qutebrowser = qutebrowser.qutebrowser:main']},
test_suite='qutebrowser.test',
zip_safe=True,
install_requires=['pypeg2', 'jinja2'],
install_requires=['pypeg2', 'jinja2', 'pygments'],
extras_require={'nice-debugging': ['colorlog', 'colorama'],
'checks': ['flake8', 'pylint', 'check-manifest',
'pyroma']},