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

*WIP* Inline type hints #382

Closed
wants to merge 1 commit into from
Closed

Conversation

clemens-fricke
Copy link
Contributor

@clemens-fricke clemens-fricke commented Feb 29, 2024

!!! Currently no type hints !!!

I have started with the example overall similar to tataratat/gustaf#197 to enable type hint tracing also in the examples.
Example tracing with run_all_examples is not possible :(

Also, I wanted to enable us to run the examples in CI/CD to also check them.

Overview

Similar to #381 but not in stub-files but with inline type hinting.

Using https://github.com/dropbox/pyannotate to trace tests to automatically detect the types enables us to add type hints quicker.

Addressed issues

  • Type hints are available
  • Autocomplete in IDE is better
  • During further development adding type hints is easier than using stub-files
  • Secondary benefit, check which functions are called during tests and examples

Checklists

  • Documentations are up-to-date.
  • Added example(s)
  • Added test(s)

Dependencies

@clemens-fricke clemens-fricke requested a review from j042 February 29, 2024 17:16
@clemens-fricke clemens-fricke self-assigned this Feb 29, 2024
@clemens-fricke
Copy link
Contributor Author

I have now tried to add the inline annotations traced from just the tests (using pytest-annotate pytest plugin). This is not as trivial as I had hoped. Basically everything exploded and after fixing some format issues, I have a lot of circular dependency errors. I think it might be good if we look into this during the upcoming HackDayz.

@j042
Copy link
Member

j042 commented Mar 5, 2024

I have now tried to add the inline annotations traced from just the tests (using pytest-annotate pytest plugin). This is not as trivial as I had hoped. Basically everything exploded and after fixing some format issues, I have a lot of circular dependency errors. I think it might be good if we look into this during the upcoming HackDayz.

Can you post some circular dependency errors?

@j042
Copy link
Member

j042 commented Jun 29, 2024

Closing this for now. Feel free to reopen

@j042 j042 closed this Jun 29, 2024
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