Merge pull request #1877 from anarcat/pypi

display README correctly on PyPI
This commit is contained in:
TW 2016-11-24 16:50:00 +01:00 committed by GitHub
commit d56683f2b5
2 changed files with 11 additions and 1 deletions

View File

@ -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:
.. code-block:: none
.. code-block::
$ 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
see ``docs/suppport.rst`` in the source distribution).
.. start-badges
|doc| |build| |coverage| |bestpractices|
.. |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
:alt: Best Practices Score
:target: https://bestpractices.coreinfrastructure.org/projects/271
.. end-badges

View File

@ -138,6 +138,12 @@ elif not on_rtd:
with open('README.rst', 'r') as fd:
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):