Skip to content

Commit 7de7b99

Browse files
committed
Template the next What's New version
1 parent 2de5787 commit 7de7b99

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

template.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,31 @@
9090
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-37">Guaranteed dict sort order</a></li>
9191
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-37"><pre>breakpoint()</pre></a></li>
9292
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-37">Data classes</a></li>
93-
<li><a href="https://docs.python.org/3/whatsnew/3.7.html">And more!</a></li>
93+
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
9494
""" # noqa: E501
9595
},
9696
"3.7": {
9797
"reasons": """
9898
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-38"><strike>Walrus operator</strike></a></li>
99-
<li><a href="https://docs.python.org/3/whatsnew/3.8.html">And more!</a></li>
99+
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
100100
""" # noqa: E501
101101
},
102102
"3.8": {
103103
"reasons": """
104104
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-39">use <code>list</code> and <code>dict</code> for type annotations</a></li>
105-
<li><a href="https://docs.python.org/3/whatsnew/3.9.html">And more!</a></li>
105+
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
106106
""" # noqa: E501
107107
},
108108
"3.9": {
109109
"reasons": """
110110
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-310">use <code>match</code> statement and write union types as <code>X | Y</code></a></li>
111-
<li><a href="https://docs.python.org/3/whatsnew/3.10.html">And more!</a></li>
111+
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
112112
""" # noqa: E501
113113
},
114114
"3.10": {
115115
"reasons": """
116116
<li><a href="https://github.com/jugmac00/python-version-cheat-sheet#python-311"><code>tomllib</code> in the stdlib, exception groups and except*</a></li>
117-
<li><a href="https://docs.python.org/3/whatsnew/3.11.html">And more!</a></li>
117+
<li><a href="https://docs.python.org/3/whatsnew/$template_next_version.html">And more!</a></li>
118118
""" # noqa: E501
119119
},
120120
}
@@ -187,12 +187,14 @@ def main() -> None:
187187
"template_minor": minor,
188188
"template_next_minor": next_minor,
189189
"template_next_version": next_version,
190-
"template_reasons": substitutions.get("reasons", REASONS),
191190
"template_remove_examples": substitutions.get("remove", ""),
192191
"template_new_features": substitutions.get("new_features", ""),
193192
}
194193

195-
# Do the substitution
194+
# Do the substitutions
195+
d["template_reasons"] = Template(
196+
substitutions.get("reasons", REASONS)
197+
).safe_substitute(d)
196198
result = src.safe_substitute(d)
197199

198200
# EOL in the future?

0 commit comments

Comments
 (0)