mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-03 13:45:31 +00:00
display README correctly on PyPI
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.
This commit is contained in:
parent
45c76c1dba
commit
fbada18b0d
2 changed files with 11 additions and 1 deletions
|
@ -91,7 +91,7 @@ Initialize a new backup repository and create a backup archive::
|
||||||
|
|
||||||
Now doing another backup, just to show off the great deduplication:
|
Now doing another backup, just to show off the great deduplication:
|
||||||
|
|
||||||
.. code-block:: none
|
.. code-block::
|
||||||
|
|
||||||
$ borg create -v --stats /path/to/repo::Saturday2 ~/Documents
|
$ borg create -v --stats /path/to/repo::Saturday2 ~/Documents
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
@ -141,6 +141,8 @@ THIS IS SOFTWARE IN DEVELOPMENT, DECIDE YOURSELF WHETHER IT FITS YOUR NEEDS.
|
||||||
Security issues should be reported to the `Security contact`_ (or
|
Security issues should be reported to the `Security contact`_ (or
|
||||||
see ``docs/suppport.rst`` in the source distribution).
|
see ``docs/suppport.rst`` in the source distribution).
|
||||||
|
|
||||||
|
.. start-badges
|
||||||
|
|
||||||
|doc| |build| |coverage| |bestpractices|
|
|doc| |build| |coverage| |bestpractices|
|
||||||
|
|
||||||
.. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=stable
|
.. |doc| image:: https://readthedocs.org/projects/borgbackup/badge/?version=stable
|
||||||
|
@ -162,3 +164,5 @@ see ``docs/suppport.rst`` in the source distribution).
|
||||||
.. |bestpractices| image:: https://bestpractices.coreinfrastructure.org/projects/271/badge
|
.. |bestpractices| image:: https://bestpractices.coreinfrastructure.org/projects/271/badge
|
||||||
:alt: Best Practices Score
|
:alt: Best Practices Score
|
||||||
:target: https://bestpractices.coreinfrastructure.org/projects/271
|
:target: https://bestpractices.coreinfrastructure.org/projects/271
|
||||||
|
|
||||||
|
.. end-badges
|
||||||
|
|
6
setup.py
6
setup.py
|
@ -138,6 +138,12 @@ def detect_lz4(prefixes):
|
||||||
|
|
||||||
with open('README.rst', 'r') as fd:
|
with open('README.rst', 'r') as fd:
|
||||||
long_description = fd.read()
|
long_description = fd.read()
|
||||||
|
# remove badges
|
||||||
|
long_description = re.compile(r'^\.\. start-badges.*^\.\. end-badges', re.M | re.S).sub('', long_description)
|
||||||
|
# remove |substitutions|
|
||||||
|
long_description = re.compile(r'\|screencast\|').sub('', long_description)
|
||||||
|
# remove unknown directives
|
||||||
|
long_description = re.compile(r'^\.\. highlight:: \w+$', re.M).sub('', long_description)
|
||||||
|
|
||||||
|
|
||||||
class build_usage(Command):
|
class build_usage(Command):
|
||||||
|
|
Loading…
Reference in a new issue