(name: str)
| 183 | |
| 184 | |
| 185 | def __getattr__(name: str) -> Any: |
| 186 | # PEP-562: deprecate module-level variable |
| 187 | |
| 188 | # {"deprecated key": (value, "new key")} |
| 189 | deprecated_vars = { |
| 190 | "bump_pattern": (BUMP_PATTERN, "BUMP_PATTERN"), |
| 191 | "bump_map": (BUMP_MAP, "BUMP_MAP"), |
| 192 | "bump_map_major_version_zero": ( |
| 193 | BUMP_MAP_MAJOR_VERSION_ZERO, |
| 194 | "BUMP_MAP_MAJOR_VERSION_ZERO", |
| 195 | ), |
| 196 | "bump_message": (BUMP_MESSAGE, "BUMP_MESSAGE"), |
| 197 | "change_type_order": (CHANGE_TYPE_ORDER, "CHANGE_TYPE_ORDER"), |
| 198 | "encoding": (ENCODING, "ENCODING"), |
| 199 | "name": (DEFAULT_SETTINGS["name"], "DEFAULT_SETTINGS['name']"), |
| 200 | "Questions": (Questions, "Iterable[CzQuestion]"), |
| 201 | } |
| 202 | if name in deprecated_vars: |
| 203 | value, replacement = deprecated_vars[name] |
| 204 | warnings.warn( |
| 205 | f"{name} is deprecated and will be removed in v5. " |
| 206 | f"Use {replacement} instead.", |
| 207 | DeprecationWarning, |
| 208 | stacklevel=2, |
| 209 | ) |
| 210 | return value |
| 211 | raise AttributeError(f"{name} is not an attribute of {__name__}") |
nothing calls this directly
no outgoing calls
no test coverage detected