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

fix(injector): resolve issue with Injector requires all annotations #188

Closed
wants to merge 5 commits into from

Conversation

OlehChyhyryn
Copy link
Contributor

injector library requires all annotation of function available in the runtime, not only dependencies under "Inject" annotation.

injector library requires all annotation of function available in the runtime, not only dependencies under "Inject" annotation.
@OlehChyhyryn
Copy link
Contributor Author

Will fix tests and linting

@sondrelg
Copy link
Member

sondrelg commented Jun 4, 2024

The changes here look good at first glance, thoguh I'm not overly familiar with the injector library. Do you happen to have experience with it @Daverball?

I think I might be able to take a look at this tonight otherwise 👍

@Daverball
Copy link
Collaborator

@sondrelg I have never used it myself, so I can't really provide any useful input beyond a surface review.

@OlehChyhyryn
Copy link
Contributor Author

I would be glad if someone would check this rather than me.

I updated the pull request with a bug found by the college because **kwargs typing should also be available during runtime.

It feels like a general rule for injector is "any annotation in function should be available in runtime"

@OlehChyhyryn OlehChyhyryn requested a review from Daverball June 5, 2024 14:00
),
],
)
@pytest.mark.parametrize(('enabled', 'expected'), [(True, set())])
Copy link
Collaborator

@Daverball Daverball Jun 5, 2024

Choose a reason for hiding this comment

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

parametrize hardly makes sense if you only provide one parametrization, also the docstring and test name no longer make any sense. It might be better to refactor and merge some of these tests into more of a regression style test where you provide a list of source code samples and the expected output, similar to the TCXXX test cases. That way it will also be easier to cover all the different kinds of arguments (i.e. *args in addition to **kwargs, and signatures that use both * and / in them)

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.

3 participants