classcore 1.5.2__tar.gz → 1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {classcore-1.5.2 → classcore-1.6}/.gitignore +3 -0
  2. {classcore-1.5.2 → classcore-1.6}/PKG-INFO +1 -1
  3. {classcore-1.5.2 → classcore-1.6}/pyproject.toml +1 -2
  4. {classcore-1.5.2 → classcore-1.6}/sources/classcore/__/imports.py +1 -1
  5. {classcore-1.5.2 → classcore-1.6}/sources/classcore/__init__.py +3 -3
  6. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/behaviors.py +1 -0
  7. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/decorators.py +6 -4
  8. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/modules.py +58 -0
  9. {classcore-1.5.2 → classcore-1.6}/sources/classcore/utilities.py +2 -2
  10. {classcore-1.5.2 → classcore-1.6}/LICENSE.txt +0 -0
  11. {classcore-1.5.2 → classcore-1.6}/README.rst +0 -0
  12. {classcore-1.5.2 → classcore-1.6}/sources/classcore/__/__init__.py +0 -0
  13. {classcore-1.5.2 → classcore-1.6}/sources/classcore/__/doctab.py +0 -0
  14. {classcore-1.5.2 → classcore-1.6}/sources/classcore/__/nomina.py +0 -0
  15. {classcore-1.5.2 → classcore-1.6}/sources/classcore/decorators.py +0 -0
  16. {classcore-1.5.2 → classcore-1.6}/sources/classcore/exceptions.py +0 -0
  17. {classcore-1.5.2 → classcore-1.6}/sources/classcore/factories.py +0 -0
  18. {classcore-1.5.2 → classcore-1.6}/sources/classcore/nomina.py +0 -0
  19. {classcore-1.5.2 → classcore-1.6}/sources/classcore/py.typed +0 -0
  20. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/__.py +0 -0
  21. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/__init__.py +0 -0
  22. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/classes.py +0 -0
  23. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/dynadoc.py +0 -0
  24. {classcore-1.5.2 → classcore-1.6}/sources/classcore/standard/nomina.py +0 -0
@@ -1,7 +1,10 @@
1
1
  .env
2
+ .gemini
3
+ .mcp.json
2
4
  .*.swp
3
5
  AGENTS.md
4
6
  CLAUDE.md
5
7
  CONVENTIONS.md
8
+ GEMINI.md
6
9
  __pycache__/
7
10
  bugs/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: classcore
3
- Version: 1.5.2
3
+ Version: 1.6
4
4
  Summary: Foundational class factories and decorators.
5
5
  Project-URL: Homepage, https://github.com/emcd/python-classcore
6
6
  Project-URL: Documentation, https://emcd.github.io/python-classcore
@@ -54,6 +54,7 @@ year-of-origin = 2025
54
54
  gha-runners = [
55
55
  '/home/runner/work/python-classcore/python-classcore/',
56
56
  '/Users/runner/work/python-classcore/python-classcore/',
57
+ 'C:\a\python-classcore\python-classcore\',
57
58
  'D:\a\python-classcore\python-classcore\',
58
59
  ]
59
60
  [tool.coverage.run]
@@ -95,9 +96,7 @@ description = ''' Development environment. '''
95
96
  dependencies = [
96
97
  'Jinja2',
97
98
  'coverage[toml]',
98
- 'emcd-projects',
99
99
  'furo',
100
- 'icecream-truck',
101
100
  'packaging',
102
101
  'pre-commit',
103
102
  'pyright',
@@ -18,7 +18,7 @@
18
18
  #============================================================================#
19
19
 
20
20
 
21
- ''' Common imports and type aliases used throughout the package. '''
21
+ ''' Common imports used throughout the package. '''
22
22
 
23
23
  # ruff: noqa: F401
24
24
 
@@ -62,8 +62,8 @@ from .factories import *
62
62
 
63
63
 
64
64
  __version__: __.typx.Annotated[ str, __.ddoc.Visibilities.Reveal ]
65
- __version__ = '1.5.2'
65
+ __version__ = '1.6'
66
66
 
67
67
 
68
- standard.dynadoc.assign_module_docstring( __name__, table = __.fragments )
69
- standard.reclassify_modules( __name__, recursive = True )
68
+ standard.finalize_module(
69
+ __name__, dynadoc_table = __.fragments, recursive = True )
@@ -182,6 +182,7 @@ def augment_class_attributes_allocations(
182
182
  __.cabc.Sequence[ str ],
183
183
  None
184
184
  ] = namespace.get( '__slots__' )
185
+ if slots and behaviors_name in slots: return
185
186
  if isinstance( slots, __.cabc.Mapping ):
186
187
  slots_ = dict( slots )
187
188
  slots_[ behaviors_name ] = 'Active behaviors.'
@@ -47,11 +47,13 @@ def prepare_dataclass_for_instances(
47
47
  ''' Annotates dataclass in support of instantiation machinery. '''
48
48
  annotations = __.inspect.get_annotations( cls )
49
49
  behaviors_name = attributes_namer( 'instance', 'behaviors' )
50
- # TODO? Only use mangling if not slotted.
51
- behaviors_name_m = _utilities.mangle_name( cls, behaviors_name )
52
- annotations[ behaviors_name_m ] = set[ str ]
50
+ # TODO: Only use mangling if not slotted.
51
+ # behaviors_name_ = _utilities.mangle_name( cls, behaviors_name )
52
+ behaviors_name_ = behaviors_name
53
+ annotations[ behaviors_name_ ] = set[ str ]
53
54
  setattr( cls, '__annotations__', annotations ) # in case of absence
54
- setattr( cls, behaviors_name_m, __.dcls.field( init = False ) )
55
+ setattr( cls, behaviors_name_, __.dcls.field(
56
+ compare = False, hash = False, init = False, repr = False ) )
55
57
 
56
58
 
57
59
  def apply_cfc_core_functions(
@@ -24,6 +24,7 @@
24
24
  from .. import utilities as _utilities
25
25
  from . import __
26
26
  from . import classes as _classes
27
+ from . import dynadoc as _dynadoc
27
28
  from . import nomina as _nomina
28
29
 
29
30
 
@@ -31,6 +32,63 @@ class Module( _classes.Object, __.types.ModuleType ):
31
32
  ''' Modules with attributes immutability and concealment. '''
32
33
 
33
34
 
35
+ def finalize_module( # noqa: PLR0913
36
+ module: __.typx.Annotated[
37
+ str | __.types.ModuleType,
38
+ __.ddoc.Doc( ''' Module or module name to finalize. ''' ),
39
+ ], /,
40
+ *fragments: __.ddoc.interfaces.Fragment,
41
+ attributes_namer: _nomina.AttributesNamer = __.calculate_attrname,
42
+ dynadoc_introspection: _nomina.DynadocIntrospectionArgument = (
43
+ _dynadoc.dynadoc_introspection_on_package ),
44
+ dynadoc_table: _nomina.DynadocTableArgument = __.dictproxy_empty,
45
+ recursive: __.typx.Annotated[
46
+ bool, __.ddoc.Doc( ''' Recursively reclassify package modules? ''' )
47
+ ] = False,
48
+ replacement_class: __.typx.Annotated[
49
+ type[ __.types.ModuleType ],
50
+ __.ddoc.Doc( ''' New class for module. ''' ),
51
+ ] = Module,
52
+ ) -> None:
53
+ ''' Combines Dynadoc docstring assignment and module reclassification.
54
+
55
+ Applies module docstring generation via Dynadoc introspection,
56
+ then reclassifies modules for immutability and concealment.
57
+
58
+ When recursive is False, automatically excludes module targets from
59
+ dynadoc introspection to document only the provided module. When
60
+ recursive is True, automatically includes module targets so Dynadoc
61
+ can recursively document all modules.
62
+ '''
63
+ module_target = __.ddoc.IntrospectionTargets.Module
64
+ if recursive:
65
+ if not ( dynadoc_introspection.targets & module_target ):
66
+ targets = dynadoc_introspection.targets | module_target
67
+ introspection = __.ddoc.IntrospectionControl(
68
+ enable = dynadoc_introspection.enable,
69
+ class_control = dynadoc_introspection.class_control,
70
+ module_control = dynadoc_introspection.module_control,
71
+ limiters = dynadoc_introspection.limiters,
72
+ targets = targets )
73
+ else: introspection = dynadoc_introspection
74
+ elif dynadoc_introspection.targets & module_target:
75
+ limit = __.ddoc.IntrospectionLimit(
76
+ targets_exclusions = module_target )
77
+ introspection = dynadoc_introspection.with_limit( limit )
78
+ else: introspection = dynadoc_introspection
79
+ _dynadoc.assign_module_docstring(
80
+ module,
81
+ *fragments,
82
+ introspection = introspection,
83
+ table = dynadoc_table )
84
+ reclassify_modules(
85
+ module,
86
+ attributes_namer = attributes_namer,
87
+ recursive = recursive,
88
+ replacement_class = replacement_class )
89
+
90
+
91
+ @__.typx.deprecated( "Use 'finalize_module' instead." )
34
92
  def reclassify_modules(
35
93
  attributes: __.typx.Annotated[
36
94
  __.cabc.Mapping[ str, __.typx.Any ] | __.types.ModuleType | str,
@@ -99,11 +99,11 @@ def mangle_name( objct: object, /, name: str ) -> str:
99
99
  # Need to debug weird issue with using 'id' early on dataclasses.
100
100
  if not __.inspect.isclass( objct ):
101
101
  return mangle_name( type( objct ), name )
102
- # return "{name}_{uid}".format( name = name, uid = id( objct ) )
102
+ # return "{name}{uid}".format( name = name, uid = id( objct ) )
103
103
  namehash = __.hashlib.sha256( )
104
104
  namehash.update( qualify_class_name( objct ).encode( ) )
105
105
  namehash_hex = namehash.hexdigest( )
106
- return f"{name}_{namehash_hex}"
106
+ return f"{name}{namehash_hex}"
107
107
 
108
108
 
109
109
  def qualify_class_name( cls: type ) -> str:
File without changes
File without changes