Skip to content

Commit

Permalink
Fixed minor issue with PyPI README fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
runfalk committed Jun 8, 2017
1 parent 827b352 commit 6a392a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@ def role_simplifier(processor, role, argument, content):
return format.get(role, "``{}``").format(content + extra.get(role, ""))


@rst_pre_processor.add_role("pep8")
@rst_pre_processor.add_role("pep")
def pep_simplifier(processor, role, argument, content):
matches = re.match(r"(?P<pep>\d+)(?P<anchor>#[^$]+)?", content)

if matches is None:
return "``PEP{}``".format(content)

fmt = "`PEP{pep} <https://www.python.org/dev/peps/pep-{pep:>04}/{anchor}>`_"
print(matches.groupdict())
return fmt.format(**matches.groupdict())


Expand Down

0 comments on commit 6a392a2

Please sign in to comment.