Coverage for sources/mimeogram/__/imports.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-07 04:07 +0000

1# vim: set filetype=python fileencoding=utf-8: 

2# -*- coding: utf-8 -*- 

3 

4#============================================================================# 

5# # 

6# Licensed under the Apache License, Version 2.0 (the "License"); # 

7# you may not use this file except in compliance with the License. # 

8# You may obtain a copy of the License at # 

9# # 

10# http://www.apache.org/licenses/LICENSE-2.0 # 

11# # 

12# Unless required by applicable law or agreed to in writing, software # 

13# distributed under the License is distributed on an "AS IS" BASIS, # 

14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

15# See the License for the specific language governing permissions and # 

16# limitations under the License. # 

17# # 

18#============================================================================# 

19 

20 

21''' Common imports used throughout the package. ''' 

22 

23# ruff: noqa: F401 

24 

25 

26import abc 

27import asyncio 

28import collections.abc as cabc 

29import enum 

30import os 

31import re 

32import sys 

33import types 

34 

35from contextlib import AsyncExitStack as ExitsAsync 

36from dataclasses import ( 

37 dataclass, 

38 field as dataclass_declare, 

39) 

40from logging import getLogger as produce_scribe 

41from pathlib import Path 

42from uuid import uuid4 

43 

44import typing_extensions as typx 

45# --- BEGIN: Injected by Copier --- 

46import tyro 

47# --- END: Injected by Copier --- 

48 

49from absence import Absential, absent, is_absent 

50from accretive.qaliases import AccretiveDictionary 

51from frigid.qaliases import ( 

52 ImmutableClass, 

53 ImmutableDictionary, 

54 ImmutableObject, 

55 ImmutableProtocolClass, 

56 reclassify_modules_as_immutable, 

57) 

58from platformdirs import PlatformDirs 

59 

60 

61@typx.dataclass_transform( frozen_default = True, kw_only_default = True ) 

62class ImmutableStandardDataclass( ImmutableClass ): 

63 ''' Metaclass for immutable standard dataclasses. (Typechecker hack.) ''' 

64 

65 

66@typx.dataclass_transform( frozen_default = True, kw_only_default = True ) 

67class ImmutableStandardProtocolDataclass( ImmutableProtocolClass ): 

68 ''' Metaclass for immutable standard dataclasses. (Typechecker hack.) ''' 

69 

70 

71simple_tyro_class = tyro.conf.configure( ) 

72standard_dataclass = dataclass( frozen = True, kw_only = True, slots = True ) 

73standard_tyro_class = tyro.conf.configure( tyro.conf.OmitArgPrefixes )