File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -105,21 +105,19 @@ def test(**kwargs: Any) -> int:
105105test .__test__ = False # type: ignore[attr-defined] # Don't try to run this method as a test
106106
107107
108+ __version__ : str
109+
108110def __getattr__ (name : str ) -> Any :
109111 """
110112 Getting __version__ is slow in an editable install since we have shell out to run git describe.
111113 Here we only do it lazily if required.
112114
113- TODO this means that the type of __version__ is Any, which is not ideal.
114- __version__ is also not listed by dir(qcodes) that could be fixed by overwrting __dir__.
115- see https://peps.python.org/pep-0562/
115+ TODO this means that unknown attributes are typed as Any rather than an error
116+ Using Literal["__version__"] as the input type does not seem to result in other attributes being rejected
116117 """
117118 if name == "__version__" :
118119 import qcodes ._version
119120
120121 __version__ = qcodes ._version .__version__
121122 return __version__
122123 raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
123-
124-
125- __all__ = ["__version___" , "config" ]
You can’t perform that action at this time.
0 commit comments