From 8586a6f40864452978c891e7886be1ced1b0a2e7 Mon Sep 17 00:00:00 2001 From: Floris Lambrechts Date: Wed, 1 Aug 2018 13:46:38 +0200 Subject: [PATCH 1/2] Load the README file verbatim, as utf-8 encoded text --- setup.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 5fa8938..5486a61 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,14 @@ -import re +import io +import os from setuptools import setup description = 'Version-bump your software with a single command!' -long_description = re.sub( - "\`(.*)\<#.*\>\`\_", - r"\1", - str(open('README.md', 'rb').read()).replace(description, '') -) +# Import the README and use it as the long-description. +# This requires 'README.md' to be present in MANIFEST.in. +here = os.path.abspath(os.path.dirname(__file__)) +with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: + long_description = '\n' + f.read() setup( name='bump2version', From cc00ff288f2ccf21a896a00a576c8a5a7c94ab13 Mon Sep 17 00:00:00 2001 From: Floris Lambrechts Date: Wed, 1 Aug 2018 13:47:50 +0200 Subject: [PATCH 2/2] Set the content type for the long description to text/markdown This requires an up-to-date setuptools; older versions will complain about it (without crashing). --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 5486a61..ddf09bb 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ packages=['bumpversion'], description=description, long_description=long_description, + long_description_content_type='text/markdown', entry_points={ 'console_scripts': [ 'bumpversion = bumpversion:main',