canonical / charmcraft

Collaborate, build and publish charmed operators for Kubernetes, Linux and Windows.
Apache License 2.0
66 stars 69 forks source link

feat: use ops.main() type hints #1911

Closed dimaqq closed 1 week ago

dimaqq commented 2 weeks ago

The ops.main entry point will be properly typed starting with the upcoming release, ops==2.17.0

This PR updates the templates so that new charms use the fixed type hints.

It is paired with #1883 where charmcraft analyse validates that ops.main is called.

We'll be relying on charm repo static type checker to validate that ops.main is called with correct arguments.

https://warthogs.atlassian.net/browse/CHARMTECH-276 parent: https://warthogs.atlassian.net/browse/CHARMTECH-219

dimaqq commented 2 weeks ago

In draft, as the new ops version has not been released yet, that's slated to end of the month. @lengau I'd appreciate an early review, esp. if I missed something major.

dimaqq commented 1 week ago

@lengau ops 2.17.0 has been released and I've updated the ops dep specs

lengau commented 1 week ago

Thanks @dimaqq ! Looks good from my end. I'm merging another PR that adjusts the paas-app-charmer requirements (it's on the merge queue so it should merge in about an hour) - when that happens I'm guessing you'll have merge conflicts in those requirements templates, but they should be pretty obvious. Just a heads up so you're not surprised.

I've requested our mandatory second review from my team in case I've missed anything, so presumably we can merge this today.