Coverage for target/native-coverage/profiles/ed7d3b207b2343278478d0be29776579/project/.venv/lib/python3.13/site-packages/owlrl_turbo/compat/_missing.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.17.2, created at 2026-12-01 11:12 +0000

1"""Typed refusal for owlrl names that owlrl-turbo does not provide (ADR 0014).""" 

2 

3# bounded: the closed set of owlrl 7.6.2 top-level names without a native implementation. 

4UNPROVIDED = frozenset({"OWLRL_Extension", "OWLRL_Extension_Trimming", "convert_graph"}) 

5"""owlrl 7.6.2 public names that the alias refuses explicitly instead of omitting silently.""" 

6 

7 

8class TurboAliasAttributeError(AttributeError): 

9 """An owlrl attribute that the owlrl-turbo compatibility package does not provide.""" 

10 

11 

12def missing_attribute(module: str, name: str) -> AttributeError: 

13 """The error for ``getattr(owlrl, name)``: typed for owlrl names, plain otherwise.""" 

14 if name in UNPROVIDED: 

15 return TurboAliasAttributeError( 

16 f"owlrl.{name} is not provided by owlrl-turbo, which aliases 'owlrl' to " 

17 f"'owlrl_turbo.compat'. Set OWLRL_TURBO_ALIAS=0 (or TURBO_ALIAS=0) to import " 

18 "the real owlrl distribution instead." 

19 ) 

20 return AttributeError(f"module {module!r} has no attribute {name!r}")