This is a living document that describes the status of typing in various Python packages in the OpenStack system. Currently this document focuses on libraries and clients. While many services have introduced some degree of typing, none are complete and they are not intended to be consumed by others, thus they are not documented here.
We determine whether a package is typed or not by looking for two things:
-
The
py.typedfile.This is what Python itself uses to determine whether to consume type hints from the library. If this file is present, the package is considered at least partially typed.
-
Use of mypy’s strict mode.
mypy is currently the only type checker in use across OpenStack projects. If
[tool.mypy] strictis set totruein a package’spyproject.tomland thepy.typedfile is present, then the library is considered fully typed.
Oslo libraries
| Package | Typed? |
|---|---|
| automaton | ❌ |
| castellan | ❌ |
| debtcollector | ❌ |
| etcd3gw | ❌ |
| futurist | ❌ |
| microversion-parse | ✅ (since 2.1.0) |
| openstackdocstheme | ❌ |
| os-api-ref | ❌ |
| oslo.cache | ✅ (unreleased) |
| oslo.concurrency | ✅ (unreleased) |
| oslo.config | ❌ |
| oslo.context | ✅ (unreleased) |
| oslo.db | ❌ |
| oslo.i18n | ✅ (since 6.7.0) |
| oslo.limit | ✅ (since 2.9.0) |
| oslo.log | ✅ (since 8.0.0) |
| oslo.messaging | ❌ |
| oslo.metrics | ✅ (unreleased) |
| oslo.middleware | ✅ (since 7.0.0) |
| oslo.policy | ❌ |
| oslo.privsep | ❌ |
| oslo.reports | ❌ |
| oslo.rootwrap | ❌ |
| oslo.serialization | ✅ (since 5.9.0) |
| oslo.service | ❌ |
| oslo.upgradecheck | ✅ (unreleased) |
| oslo.utils | ✅ (since 9.2.0) |
| oslo.versionedobjects | ❌ |
| oslo.vmware | ❌ |
| oslotest | ✅ (unreleased) |
| osprofiler | ❌ |
| sphinx-feature-classification | ❌ |
| stevedore | ✅ (since 5.6.0) |
| taskflow | ❌ |
| tooz | ❌ |
| whereto | ❌ |
SDKs and Clients
| Package | Typed? |
|---|---|
| cliff | ✅ (since 4.11.0) |
| openstacksdk | ⚠️ (partial, since 0.37.0) |
| os-service-types | ✅ (since 1.8.0) |
| osc-lib | ✅ (since 4.2.0) |
| python-openstackclient | ❌ |