Skip to content

Commit

Permalink
hyperlink replacements in history
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Nov 24, 2022
1 parent 19055ef commit 7a58fcb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import os
import re
import sys

from packaging import version
Expand Down Expand Up @@ -55,6 +56,14 @@
The full documentation is at https://miranda.readthedocs.io/en/latest."""
history = open("HISTORY.rst").read().replace(".. :changelog:", "")

hyperlink_replacements = {
r":issue:`([0-9]+)`": r"`GH/\1 <https://github.com/Ouranosinc/miranda/issues/\1>`_",
r":pull:`([0-9]+)`": r"`PR/\1 <https://github.com/Ouranosinc/miranda/pull/\1>`_",
r":user:`([a-zA-Z0-9_.-]+)`": r"`@\1 <https://github.com/\1>`_",
}
for search, replacement in hyperlink_replacements.items():
history = re.sub(search, replacement, history)

setup(
name=NAME,
version=VERSION,
Expand Down

0 comments on commit 7a58fcb

Please sign in to comment.