jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/880881 )
Change subject: [bugfix] Fix setup.read_desc() regex ......................................................................
[bugfix] Fix setup.read_desc() regex
If a space was behind a sphinx link and the link was different from the label, the link was removed but the alignment does not match the previous line. Modify the regex pattern to remove a following space in such case.
Also test the long_description created by setup.py in make_dist.py script
Bug: T327056 Change-Id: Ie71c4f9feb38e4ba822330b6978d19f506304c95 --- M setup.py M make_dist.py 2 files changed, 25 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/make_dist.py b/make_dist.py index 4c75e43..d58c8f5 100755 --- a/make_dist.py +++ b/make_dist.py @@ -45,7 +45,7 @@ import shutil import sys from pathlib import Path -from subprocess import check_call +from subprocess import check_call, run
import setup from pywikibot import __version__, error, info, input_yn, warning @@ -109,6 +109,10 @@ finally: self.cleanup()
+ # check description + if run('twine check dist/*', shell=True).returncode: + return + if self.local: check_call('pip uninstall pywikibot -y', shell=True) check_call( diff --git a/setup.py b/setup.py index 961cec2..081dbab 100755 --- a/setup.py +++ b/setup.py @@ -184,7 +184,7 @@ Combine included restructured text files which must be done before uploading because the source isn't available after creating the package. """ - pattern = r':\w+:`([^`]+?)(?:<.+>)?`', r'\1' + pattern = r'(?::\w+:`([^`]+?)(?:<.+>)?` *)', r'\1' desc = [] with open(filename) as f: for line in f: @@ -219,7 +219,7 @@ version=version, description=metadata.__description__, long_description=read_desc('README.rst'), - # long_description_content_type + long_description_content_type='text/x-rst', # author # author_email maintainer=metadata.__maintainer__,
pywikibot-commits@lists.wikimedia.org