Skip to content

Conversation

vincentsarago
Copy link
Member

@vincentsarago vincentsarago commented May 19, 2025

Related Issue(s):

#828

Description:

This PR does:

  • update pyproject/pre-commit configuration to run type checking
  • update/fix type informations
  • switch from attr.s to attrs.define for data class definition

⚠️ attrs.define adds slots to each class but in stac-fastapi we use attrs.make_class to combine multiple base classes (APIRequest + extensions). Because of slots the process will fail with TypeError: multiple bases have instance lay-out conflict in https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/api/stac_fastapi/api/models.py#L50-L52 . The solution to avoid this is to add slots=False for each classes 😓

FYI: switching to attrs.define made type checking happy

PR Checklist:

  • pre-commit hooks pass locally
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

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