Skip to content

bug: Properly handle Union in file-api#1272

Open
LecrisUT wants to merge 2 commits intoscikit-build:mainfrom
LecrisUT:refactor/file-api-union
Open

bug: Properly handle Union in file-api#1272
LecrisUT wants to merge 2 commits intoscikit-build:mainfrom
LecrisUT:refactor/file-api-union

Conversation

@LecrisUT
Copy link
Copy Markdown
Collaborator

Previously only the first type was considered, but evidently that can potentially fail. Seems like this would only happen in one case

paths: List[Union[str, Paths]] = dataclasses.field(default_factory=list)

Signed-off-by: Cristian Le <git@lecris.dev>
Signed-off-by: Cristian Le <git@lecris.dev>
Comment on lines -60 to +63
codemodel_v2: Optional[CodeModel]
cache_v2: Optional[Cache]
cmakefiles_v1: Optional[CMakeFiles]
toolchains_v1: Optional[Toolchains]
codemodel_v2: Optional[CodeModel] = None
cache_v2: Optional[Cache] = None
cmakefiles_v1: Optional[CMakeFiles] = None
toolchains_v1: Optional[Toolchains] = None
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this part is also touching the logic of Optional I think we should check what exactly should be done here?

These very much depend on the query used. Any suggestion on how these should be handled ideally?

One thing I would want is to drop the _v suffix there and make it completely version independent, but technically I think they are allowed to have multiple such fields. I think we could fix a specific query format that is allowed and that we parse

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

Successfully merging this pull request may close these issues.

1 participant