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 type annotations for prefill (plugin) signatures #4470

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

sergei-maertens
Copy link
Member

No issue, but came across it as part of #4246 and decided to open a separate PR.

No typing errors anymore with Pyright in Sublime - though I suspect some call-sites may now be messed up. Those should probably be updated rather than messing with the base classes again.

I'm not particularly pleased yet with the type annotation for attributes - I think it'd be nice if we could dump in a constant/models.TextChoices, but first let's see how #4266 develops first, as that one has dynamic attributes that are not known upfront.

@sergei-maertens sergei-maertens requested a review from Viicos July 1, 2024 21:03
@sergei-maertens sergei-maertens force-pushed the chore/prefill-plugin-signature branch from 8638b32 to 860ff09 Compare July 1, 2024 21:03
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.51%. Comparing base (146b7d0) to head (ee9d63b).
Report is 595 commits behind head on master.

Files with missing lines Patch % Lines
src/openforms/prefill/contrib/demo/plugin.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4470      +/-   ##
==========================================
- Coverage   96.51%   96.51%   -0.01%     
==========================================
  Files         720      720              
  Lines       23883    23899      +16     
  Branches     2817     2817              
==========================================
+ Hits        23050    23065      +15     
- Misses        565      566       +1     
  Partials      268      268              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/openforms/config/data.py Outdated Show resolved Hide resolved
src/openforms/plugins/plugin.py Show resolved Hide resolved
The Sequence is covariant (which the list isn't), which helps in
inferring in concrete classes without getting errors about mismatching
signatures between parent and subclass.
@sergei-maertens sergei-maertens force-pushed the chore/prefill-plugin-signature branch from 860ff09 to ee9d63b Compare July 1, 2024 21:47
@sergei-maertens sergei-maertens merged commit f96a10c into master Jul 1, 2024
30 checks passed
@sergei-maertens sergei-maertens deleted the chore/prefill-plugin-signature branch July 1, 2024 22:30
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