summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBazaah2024-03-16 17:27:47 +0000
committerBazaah2024-03-23 10:32:35 +0000
commita75f61e6d066a6f01466814bc3cc837ee94f2d98 (patch)
tree3e7f872de25d2a88b864ec4cda4d2b7fe64b1fc9
parent93719e4e78ae18d6887d0f68bd4609d30f0d82fb (diff)
downloadaur-a75f61e6d066a6f01466814bc3cc837ee94f2d98.tar.gz
repo: add ceph-18.2.2-mgr-ceph-module-stub.patch
This mocks out a module for mgr_module.py to 'import' during mypy type analysis. Previously the ceph_module.pyi was enough for this to work, but I guess something in the tooling changed. I cannot figure out why this ever worked before, and why it doesn't now. Maybe related to https://github.com/python/mypy/issues/16987 ?
-rw-r--r--ceph-18.2.2-mgr-ceph-module-stub.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/ceph-18.2.2-mgr-ceph-module-stub.patch b/ceph-18.2.2-mgr-ceph-module-stub.patch
new file mode 100644
index 000000000000..151c81313f93
--- /dev/null
+++ b/ceph-18.2.2-mgr-ceph-module-stub.patch
@@ -0,0 +1,34 @@
+diff --git a/src/pybind/mgr/ceph_module.py b/src/pybind/mgr/ceph_module.py
+new file mode 100644
+index 00000000000..bfa21a853f4
+--- /dev/null
++++ b/src/pybind/mgr/ceph_module.py
+@@ -0,0 +1,28 @@
++# This is an interface definition of classes that are generated within C++.
++# Used by mypy to do proper type checking of mgr modules.
++# Without this file, all classes have undefined base classes.
++
++from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union
++try:
++ from typing import Protocol # Protocol was added in Python 3.8
++except ImportError:
++ class Protocol: # type: ignore
++ pass
++
++class BasePyOSDMap(object):
++ pass
++
++class BasePyOSDMapIncremental(object):
++ pass
++
++class BasePyCRUSH(object):
++ pass
++
++class BaseMgrStandbyModule(object):
++ pass
++
++class CompletionT(Protocol):
++ pass
++
++class BaseMgrModule(object):
++ pass