Skip to content

Commit

Permalink
Always require Pygments
Browse files Browse the repository at this point in the history
This used to be an optional dependency, but recent changes made it so
you cannot even import restview.restviewhttp if you don't have pygments:
#9
  • Loading branch information
mgedmin committed May 1, 2013
1 parent 98d79fd commit 6cae728
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
- 3.3
- pypy
install:
- pip install pygments mock coverage coveralls --use-mirrors
- pip install mock coverage coveralls --use-mirrors
- pip install . --use-mirrors
script:
- coverage run --source=src/restview setup.py test -q
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ all:
test:
$(PYTHON) setup.py test

.PHONY: check
.PHONY: check
check:
detox

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def get_version(filename='src/restview/restviewhttp.py'):
packages=['restview'],
package_dir={'': 'src'},
include_package_data=True,
install_requires=['docutils'],
extras_require={'syntax': ['pygments']},
install_requires=['docutils', 'pygments'],
extras_require={'syntax': []},
test_suite='restview.tests.test_suite',
tests_require=['mock'],
zip_safe=False,
Expand Down
10 changes: 3 additions & 7 deletions src/restview/restviewhttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
restviewhttp --help
Needs docutils and a web browser. Will syntax-highlight code or doctest blocks
if you have pygments installed.
(needs pygments).
"""
from __future__ import print_function

Expand Down Expand Up @@ -55,12 +55,8 @@

import docutils.core
import docutils.writers.html4css1

try:
import pygments
from pygments import lexers, formatters
except ImportError:
pygments = None
import pygments
from pygments import lexers, formatters


try:
Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ envlist =

[testenv]
deps =
docutils
pygments
mock
commands =
python -Wall setup.py test -q
Expand All @@ -16,5 +14,5 @@ deps =
{[testenv]deps}
coverage
commands =
coverage run setup.py test -q
coverage report --include='src/restview/*'
coverage run --source=src/restview setup.py test -q
coverage report

0 comments on commit 6cae728

Please sign in to comment.