mirror of
https://github.com/NaN-tic/trydoc.git
synced 2023-12-14 02:03:42 +01:00
Make optional tryton dependency. Add required/supported versions in setup and documentation
This commit is contained in:
parent
582b596e29
commit
8464400bcc
|
@ -11,10 +11,10 @@ Installation
|
|||
|
||||
This extension requires the following packages:
|
||||
|
||||
- Sphinx 1.2
|
||||
- proteus
|
||||
- Sphinx >= 1.2
|
||||
- proteus 3.2.x
|
||||
- path.py
|
||||
- tryton
|
||||
- tryton 3.2.x (optional if you don't need ``view`` directive)
|
||||
|
||||
Use ``pip`` to install this extension straight from the Python Package Index::
|
||||
|
||||
|
|
8
setup.py
8
setup.py
|
@ -8,14 +8,17 @@ with open('README') as stream:
|
|||
|
||||
requires = [
|
||||
'path.py',
|
||||
'proteus',
|
||||
'proteus>=3.2, <3.4',
|
||||
'simplejson',
|
||||
'Sphinx>=1.0b2',
|
||||
]
|
||||
extra_require = {
|
||||
'view directive': 'tryton>=3.2, <3.4',
|
||||
}
|
||||
|
||||
setup(
|
||||
name='trydoc',
|
||||
version='0.6',
|
||||
version='0.7',
|
||||
url='https://bitbucket.org/nantic/trydoc',
|
||||
download_url='http://pypi.python.org/pypi/trydoc',
|
||||
license='BSD',
|
||||
|
@ -46,5 +49,6 @@ setup(
|
|||
],
|
||||
},
|
||||
install_requires=requires,
|
||||
extras_require=extra_require,
|
||||
namespace_packages=['sphinxcontrib'],
|
||||
)
|
||||
|
|
|
@ -22,16 +22,17 @@ from docutils.transforms import Transform
|
|||
from sphinx.util.compat import Directive
|
||||
|
||||
import proteus
|
||||
import tryton
|
||||
try:
|
||||
import gtk
|
||||
import gobject
|
||||
import signal
|
||||
import tryton
|
||||
except ImportError, e:
|
||||
print >> sys.stderr, ("gtk importation error (%s). Screenshots feature "
|
||||
"will not be available.") % e
|
||||
gtk = None
|
||||
gobject = None
|
||||
tryton = None
|
||||
|
||||
|
||||
screenshot_files = []
|
||||
|
@ -222,6 +223,7 @@ class ViewDirective(Image):
|
|||
def run(self):
|
||||
assert gtk is not None, "gtk not imported"
|
||||
assert gobject is not None, "gobject not imported"
|
||||
assert tryton is not None, "tryton not imported"
|
||||
|
||||
env = self.state.document.settings.env
|
||||
if 'class' in self.options:
|
||||
|
|
Loading…
Reference in a new issue