Add dml-breaking-changes file to be used by cmake#407
Add dml-breaking-changes file to be used by cmake#407mandolaerik wants to merge 1 commit intointel:mainfrom
Conversation
810f1b3 to
c4dd60b
Compare
c4dd60b to
843ab45
Compare
4d93f3c to
99b8d3f
Compare
| vect-needs-provisional: | ||
| opt-in: [4, 5, 6, 7] | ||
| forbid-warning-statement: | ||
| opt-in: [4, 5, 6, 7] |
There was a problem hiding this comment.
Feels like we'd wanna autogen this based on the classes of breaking-change.py.
test/tests.py
Outdated
| set(changes_in_cmake) - set(changes_in_dmlc))) | ||
| self.pr(f"changes only in breaking_changes.py: " + str( | ||
| set(changes_in_dmlc) - set(changes_in_cmake))) | ||
| raise TestFail(f'mismatch') |
There was a problem hiding this comment.
... Especially since then that'd make this test redundant. My gut feeling is that the complexity cost of autogenning the file would be comparable to the complexity cost of this test.
There was a problem hiding this comment.
The reason for explicit yaml is that cmake needs the file, before dmlc has been built.
I realized that a better approach is to instead move all info to yaml, and let breaking_changes.py read the file as a module resource. Done now.
99b8d3f to
737a22a
Compare
|
PR Verification: ❌ failure |
|
PR Verification: ❌ failure |
| from dataclasses import dataclass | ||
|
|
||
| from importlib import resources | ||
| import yaml |
There was a problem hiding this comment.
Hm, this is an added dependency: in order to run dmlc, you now need a yaml-enabled python. If we think this is a problem, then one option is to compile it into json, and distribute both (so that cmake can use the yaml).
OTOH, yaml is not a very controversal dependency, you can't build simics without a yaml enabled python.
|
PR Verification: ❌ failure |
737a22a to
54986cd
Compare
| apis_by_ordinal = {api.ordinal: api for api in apis.values()} | ||
|
|
||
| class BreakingChange(abc.ABC): | ||
| class BreakingChange: |
There was a problem hiding this comment.
This class strikes me as over-abstracted in some ways, now that the authoritative data is available elsewhere. E.g., the __doc__/short attributes are only used once (md generation), so it would be more direct to read it directly from the data source instead.
There is however a minor value in siphoning all data through __init__; it provides a basic validation that the data only contains familiar keys.
This allows the file to be consumed by cmake
54986cd to
2330673
Compare
No description provided.