Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a VersionMap type #489

Open
dhellmann opened this issue Oct 30, 2024 · 0 comments
Open

add a VersionMap type #489

dhellmann opened this issue Oct 30, 2024 · 0 comments

Comments

@dhellmann
Copy link
Member

Downstream we have a few places where we define a dictionary mapping versions to build settings (source URLs, flags, etc.). We've repeated the pattern enough that it makes sense to add it to fromager as a utility class.

The class should act like (subclass?) a dict. The keys should be Version objects. The values should be arbitrary types.

The instance should have a method named something like resolve() that takes a Requirement and constraint and returns the value associated with the version that matches. It should raise an appropriate exception if no version in the map meets the requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant