I have managed to get it working. The problem was that the manual installation and the use of Jython meant that certain environment variables that were expected were not in place. Also, the use of Windows 7 (and I believe MS Windows in general) means that Python scripts without an extension cannot be run without calling them explicitly through Jython (Windows doesn't check for shebangs). Finally, file associations had not been set up (as happens automatically with CPython installation, but has not happened with Jython).
For anyone else with similar problems the following setup works for me:
Locations:
- Java Runtime: C:\Java\jre7
- Jython: C:\Jython\jython2.5.2
User Environment Variables:
- JRE_HOME: C:\Java\jre7
- JAVA_HOME: %JRE_HOME%
- CLASSPATH: .
- JYTHON_HOME: C:\Jython\jython2.5.2
- PATH: %JRE_HOME%\bin;%JYTHON_HOME%\bin
File Associations:
- At the command prompt type
assoc .py=Python.File
to associate 'Python.File' with the '.py' extension. - At the command prompt type
ftype Python.File=C:\Jython\jython2.5.2\jython.bat "%1" %*
to associate the Jython command with files of type 'Python.File'. - Append '.py' (
;.PY
) to the PATHEXT system environment variable. This will make it possible to execute Python files without having to provide their '.py' extension. (N.B. This does not make it possible to run Python files that do not have a '.py' extension.)
File Extensions:
- Rename the four Sphinx commands to include '.py' extensions. This is remarkably difficult with vanilla Windows 7 as it does everything it can to distance the user from such 'low level' details as file extensions, however the rename command at the command prompt does the job: type
ren sphinx* sphinx*.py
when in the Jython bin directory.
It should now be possible to call sphinx-apidoc
or similar from anywhere. Once this is complete the command make html
, when called from the documentation directory, should work as expected.