vladris / tinkerer

Python blogging engine
https://vladris.com/tinkerer
Other
305 stars 81 forks source link

support for buildout environments #81

Closed chaudum closed 9 years ago

chaudum commented 9 years ago

fixed build command so tinkerer --build can also be used when using tinkerer in buildout environment, e.g.:

[buildout]
parts = eggs

[eggs]
recipe = zc.recipe.egg
dependent-scripts = true
eggs = tinkerer

this requires that sphinx's build_main command is called directly instead of spawing new subprocess (which would require to have sphinx installed globally).

coveralls commented 9 years ago

Coverage Status

Coverage remained the same when pulling 0087bdf2bcfe625aec992dc28e08fd048a25b8b8 on chaudum:master into 0215fbe9c813add41a736eb023cbfd2e25dbb61c on vladris:master.

vladris commented 9 years ago

The reason I moved sphinx-build to external process is that in newer versions, Sphinx calls sys.exit on failure, which also terminates Tinkerer when running in-proc, and we don't always want that.

chaudum commented 9 years ago

I see. I've been looking at the Sphinx source code and the only place where they exit on error is https://bitbucket.org/birkenfeld/sphinx/src/71b0148df7589e7fe34fb081ad7f3da4b9ca22b2/sphinx/cmdline.py?at=default#cl-202 Did you mean that? However, that looks more like a bug to me, because everywhere else in the cmdline.main function they return the status code.

vladris commented 9 years ago

This was recently introduced in the latest Sphinx version so I have no idea whether it is a bug or the way going forward for Sphinx to respond to issues. Anyway, running sphinx-build in-proc now can prematurely terminate tinkerer and in general it should be safer to call it as a separate process. I understand there are some limitations but as long as Sphinx is shipped as a tool not a library, I'd say it's better to do it this way.