I have discovered that PyPI is way more sensitive to RST warnings than
other platforms: warnings and errors will make the document not show
up correctly, which is currently the case here:
https://pypi.python.org/pypi/borgbackup/
the suggested changes remove Sphinx-specific markup from the output,
namely the badges and `|replacement|` patterns, but also the
`higlight` directive. this also requires adding tags to the README to
mark the badges to remove and removal of the `none` argument for the
`.. code-block::` element which was not having any significant in
Sphinx anyways.
literal blocks must be followed by an empty line
suppressed the non-local image uri warning via sphinx config
the links on the resources page must have different label texts
setup.py: do not generate pointless "::\n" - it does not create a literal block if the stuff below is not indented
this was making us require mock, which is really a test component and
shouldn't be part of the runtime dependencies. furthermore, it was
making the imports and the code more brittle: it may have been
possible that, through an environment variable, backups could be
corrupted because mock libraries would be configured instead of real
once, which is a risk we shouldn't be taking.
finally, this was used only to build docs, which we will build and
commit to git by hand with a fully working borg when relevant.
see #384.
This reverts commit 86487d192a.
We will instead commit the generated `.rst` usage and API files
directly into git. The setup commands remain to generate them when the
usage or API changes, but as things are the hoops required to generate
those RST files are way too complicated to justify simply build docs.
See #384.
Conflicts:
setup.py
it requires "mock" (and later also sphinx) and we do not (want to) have that in setup_requires.
I removed the build.sub_commands.append(...) because that made setup.py install run build_api
and build_usage automatically for production installs. the comment said it does not work on
readthedocs anyway.
build_api and build_usage can still be run manually.
it seems that what worked in the debug branch is not working in the
main branch, even though the commit IDs are exactly the same. the RTD environment doesn't seem really reliable...
besides, we want to build extensions before the rest, so should run it
first, in order to have msgpack loaded.
instead of applying this only to usage generation, use it as a generic
mechanism to disable loading of Cython code.
it may be incomplete: there may be other places where Cython code is
loaded that is not checked, but that is sufficient to build the usage
docs. the environment variable used is documented as such in the
docs/usage.rst.
we also move the check to a helper function and document it
better. this has the unfortunate side effect of moving includes
around, but I can't think of a better way.
this is such a crude hack it is totally embarrassing....
the proper solution would probably be to move the `build_parser()`
function out of `Archiver` completely, but this is such an undertaking
that i doubt it is worth doing since we're looking at switching to
click anyways.
the main problem in moving build_parser() out is that it references
`self` all the time, so it *needs* an archiver context that it can
reuse. we could make the function static and pass self in there by
hand, but it seems like almost a worse hack... and besides, we would
need to load the archiver in order to do that, which would break usage
all over again...
this is an unfortunate rewrite of the manpage creation code mentionned
in #208. ideally, this would be rewritten into a class that can
generate both man pages and .rst files.