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 generics & MROs for Python 3.9 and Kopf 0.28 #561

Merged
merged 3 commits into from
Oct 7, 2020
Merged

Fix generics & MROs for Python 3.9 and Kopf 0.28 #561

merged 3 commits into from
Oct 7, 2020

Conversation

nolar
Copy link
Owner

@nolar nolar commented Oct 7, 2020

What do these changes do?

Enable Kopf for Python 3.9 by fixing an issue when some of the classes were reporting TypeError: Cannot create a consistent method resolution order (MRO) for bases Generic, ... on their declaration (not at runtime).

Since nothing changes essentially in the codebase, I assume the change is safe enough. That was surprisingly easy (easier than I thought it will be).

Related: k8spin/k8spin-operator#24

The proper Python tag (3.9 instead of 3.9-dev) will be released later — it needs Travis & pyenv to support 3.9 first, but 3.9 was released only 2 days ago. See: https://travis-ci.community/t/python-3-9-0-build/10091

@nolar nolar changed the title Fix generics & MROs for Python 3.9 Fix generics & MROs for Python 3.9 and Kopf 0.28 Oct 7, 2020
Otherwise, it raises numerous errors in Python 3.9 (and 3.9 only):

```
$ mypy kopf --strict --pretty
kopf/clients/auth.py:18: error: syntax error in type comment
    vault_var: ContextVar[credentials.Vault] = ContextVar('vault_var')
               ^
kopf/clients/auth.py:108: error: syntax error in type comment
        default_namespace: Optional[str]
                           ^
```
@nolar nolar merged commit a6d302b into master Oct 7, 2020
@nolar nolar deleted the py39 branch October 7, 2020 14:58
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.

1 participant