Support 2023-07 config#300
Merged
Merged
Conversation
1410d42 to
18df5da
Compare
pehrsoderman
approved these changes
May 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements reading 2023-07-draft problem.yaml files.
The main implementation is in the new
problemtools.metadatamodule, where I created pydantic models and dataclasses to represent the config file format. For each supported version (2023-07 and legacy), there is a model which should precisely allow what the standard allows. We then convert to a model calledMetadata, which is a unified format, to allow code later to access metadata in a unified way, regardless of problem format version. The unified format is just a stricter version of 2023-07 with some legacy fields added.To get type safety in verifyproblem, I added
problem.getMetadata()to read the metadata, as opposed to re-using theget()function, which passes dicts.I think we should probably take another look at how
Problemis initialized and how ProblemAspects communicate information between each other. For instance, I would like to make it a fatal error when we fail to parse config.yaml (there really is not much point in proceeding), but I couldn't come up with a clean way to do that in the current structure (and I don't want to mix that refactor into this already large PR).This PR bumps the python version we require to 3.11, since I wanted to use
StrEnumto represent e.g. our various license options.