Skip to content

Commit 566d026

Browse files
committed
Rework compat features into breaking changes
This reverses polarity and makes things easier to explain
1 parent 6b71e20 commit 566d026

File tree

10 files changed

+880
-352
lines changed

10 files changed

+880
-352
lines changed

deprecations_to_md.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,33 @@
66
[path_to_dml, header, outfile] = sys.argv[1:]
77
sys.path.append(path_to_dml)
88

9-
from dml import breaking_changes as compat
9+
from dml import breaking_changes
1010
from dml.env import api_versions, default_api_version
1111

1212
by_version = {}
13-
for feature in compat.features.values():
14-
if (feature.last_api_version.str in api_versions()
15-
# don't document features that are unconditionally disabled in
13+
for bc in breaking_changes.changes.values():
14+
if (bc.required_after.str in api_versions()
15+
# don't document breaking changes that are unconditionally disabled in
1616
# this Simics version
17-
or feature.last_api_version > compat.apis[default_api_version()]):
18-
by_version.setdefault(feature.last_api_version, []).append(feature)
17+
or bc.required_after > breaking_changes.apis[default_api_version()]):
18+
by_version.setdefault(bc.required_after, []).append(bc)
1919

2020
with open(outfile, 'w') as f:
2121
f.write(Path(header).read_text())
22-
for (ver, features) in sorted(by_version.items()):
22+
for (ver, bcs) in sorted(by_version.items()):
2323
f.write(fr"""
24-
### Features available up to and including -\-simics-api={ver.str}
25-
These features correspond to functionality removed when compiling using
24+
### Changes for migrating from -\-simics-api={ver.str}
25+
These changes are enabled automatically when compiling using
2626
Simics API {ver.ordinal + 1} or newer. With older Simics API versions, these
27-
features can be disabled individually by passing <tt>-\-no-compat=<em>TAG</em></tt>
27+
features can be disabled individually by passing
28+
<code>-\-breaking-change=<em>TAG</em></code>
2829
to the `dmlc` compiler.
2930
""")
3031
f.write("<dl>\n")
31-
for feature in sorted(features, key=lambda f: f.tag()):
32-
assert feature.__doc__
33-
f.write(f" <dt>{feature.tag()}</dt>\n")
32+
for bc in sorted(bcs, key=lambda f: f.tag()):
33+
assert bc.__doc__
34+
f.write(f" <dt>{bc.tag()}</dt>\n")
3435
doc = '\n'.join(line[4:] if line.startswith(' ') else line
35-
for line in feature.__doc__.strip().splitlines())
36+
for line in bc.__doc__.strip().splitlines())
3637
f.write(f" <dd>\n\n{doc}\n</dd>\n")
3738
f.write("</dl>\n")

0 commit comments

Comments
 (0)