views:

254

answers:

4

I'm still looking for a usable documentation tool chain. Working in the Java environment but also a Python user, I wondered if Sphinx would run on Jython 2.5?

+1  A: 

I think the easiest thing to do is to try it ? I can't find anything that says it won't.

Brian Agnew
+1  A: 

There are many differences between CPython and Jython, so I'd recommend you to run Sphinx unit tests on Jython to see picture.

Good luck!

Sergiy
Not sure how those differences are relevant, but I agree with the second part.
musicfreak
+3  A: 

Running Jython 2.5.1 with Sphinx in an Ant-script shows an error:

     [exec] Making output directory...
     [exec] Running Sphinx v0.6.3
     [exec] Exception occurred:
     [exec]   File "C:\jython\jython2.5.1\Lib\site-packages\sphinx-0.6.3-py2.5.egg\sphinx\highlighting.py", line 15, in <module>
     [exec]     import parser
     [exec] ImportError: No module named parser
     [exec] The full traceback has been saved in ....\sphinx-err-o_qfvt.log, if you want to report the issue to the author.
     [exec] Please also report this if it was a user error, so that a better error message can be provided next time.
     [exec] Send reports to [email protected]. Thanks!
     [exec] Build finished. The HTML pages are in _build/html.
     [exec] Result: 1

uncommented the import parser in highlighting.py :

 [exec] Running Sphinx v0.6.3
 [exec] loading pickled environment... done
 [exec] building [html]: targets for 1 source files that are out of date
 [exec] updating environment: 0 added, 0 changed, 0 removed
 [exec] looking for now-outdated files... none found
 [exec] preparing documents... done
 [exec] writing output... [100%] index
 [exec] writing additional files... genindex search
 [exec] copying static files... done
 [exec] dumping search index... done
 [exec] dumping object inventory... done
 [exec] build succeeded.
 [exec] Build finished. The HTML pages are in _build/html.
 [exec] Result: 1
Blauohr
see my second answer
Blauohr
+2  A: 

to run sphinx on jython i had to do some changes:

  1. in the highlighting.py file:

    uncomment import parser [line 15?]

    uncomment the use of parser in PygmentsBridge.try_parse (whole try / except ) [line 159 - 164?]

    add an return True to PygmentsBridge.try_parse

    (try_parse is now useless ?!)

  2. in the util/__init__.py adding err.errno == 0 in ensuredir (win32 only)

    if not err.errno == 17 and not err.errno == 0:


opened an issue:

http://bitbucket.org/birkenfeld/sphinx/issue/265/sphinx-doesnt-run-with-jython251

Blauohr