Skip to content

chore(commons): tiny fixes of step type checking #846

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

Merged
merged 2 commits into from
Mar 27, 2025
Merged

Conversation

delatrie
Copy link
Contributor

Context

#830 introduces proper typing annotations for allure.step via @typing.overload.

This PR removes the annotations from the implementation as per the Python docs:

The @overload-decorated definitions are for the benefit of the type checker only, since they will be overwritten by the non-@overload-decorated definition, while the latter is used at runtime but should be ignored by a type checker.

It also disables type checking of the wrapper function returned by StepContext.__call__ (it can't be typechecked without ParamSpec, which is only available in Python 3.10+).

@delatrie delatrie added the type:internal Change that isn't visible or obvious for end users label Mar 27, 2025
@delatrie delatrie force-pushed the step-typing-fixes branch from 668a490 to 51cf7ce Compare March 27, 2025 09:09
@delatrie delatrie merged commit e9003d0 into master Mar 27, 2025
48 checks passed
@delatrie delatrie deleted the step-typing-fixes branch March 27, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:core type:internal Change that isn't visible or obvious for end users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants