Skip to content

More typing + enable strict mypy checking#40

Merged
mbercx merged 1 commit intoaiidateam:mainfrom
danielhollas:moar-types
Oct 1, 2025
Merged

More typing + enable strict mypy checking#40
mbercx merged 1 commit intoaiidateam:mainfrom
danielhollas:moar-types

Conversation

@danielhollas
Copy link
Collaborator

This ended up being surprisingly easy so I just went for it.

Without the strict mode mypy is actually very lenient and it's easy for it to miss bugs (e.g. through missing type annotations).

def set_key(self, key, value):
dotenv.set_key(self.model_config["env_file"], key, value)

def get_key(self, key):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

get_key has not been used anywhere so I just removed it for now.



def recursive_mkdir(project_path: Path, structure: dict | list | Path) -> None:
def recursive_mkdir(project_path: Path, structure: dict | list | Path) -> None: # type: ignore[type-arg]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The type ignores here are just for brevity of type annotations ---- otherwise I would have to spell out Any as generic type parameters everywhere...

@danielhollas danielhollas requested a review from mbercx October 1, 2025 01:07
Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks as always @danielhollas 🚀

@mbercx mbercx merged commit d59eed4 into aiidateam:main Oct 1, 2025
6 checks passed
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.

2 participants