classcore 1.5.3__tar.gz → 1.6.1__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.
- {classcore-1.5.3 → classcore-1.6.1}/.gitignore +3 -0
- {classcore-1.5.3 → classcore-1.6.1}/PKG-INFO +1 -1
- {classcore-1.5.3 → classcore-1.6.1}/pyproject.toml +1 -2
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/__/imports.py +1 -1
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/__init__.py +3 -3
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/modules.py +99 -2
- {classcore-1.5.3 → classcore-1.6.1}/LICENSE.txt +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/README.rst +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/__/__init__.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/__/doctab.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/__/nomina.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/decorators.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/exceptions.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/factories.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/nomina.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/py.typed +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/__.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/__init__.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/behaviors.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/classes.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/decorators.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/dynadoc.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/standard/nomina.py +0 -0
- {classcore-1.5.3 → classcore-1.6.1}/sources/classcore/utilities.py +0 -0
|
@@ -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',
|
|
@@ -62,8 +62,8 @@ from .factories import *
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
__version__: __.typx.Annotated[ str, __.ddoc.Visibilities.Reveal ]
|
|
65
|
-
__version__ = '1.
|
|
65
|
+
__version__ = '1.6.1'
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
standard.
|
|
69
|
-
|
|
68
|
+
standard.finalize_module(
|
|
69
|
+
__name__, dynadoc_table = __.fragments, recursive = True )
|
|
@@ -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_module(
|
|
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,
|
|
@@ -50,7 +108,6 @@ def reclassify_modules(
|
|
|
50
108
|
__.ddoc.Doc( ''' New class for module. ''' ),
|
|
51
109
|
] = Module,
|
|
52
110
|
) -> None:
|
|
53
|
-
# TODO? Ensure correct operation with namespace packages.
|
|
54
111
|
''' Reclassifies modules to have attributes concealment and immutability.
|
|
55
112
|
|
|
56
113
|
Can operate on individual modules or entire package hierarchies.
|
|
@@ -63,6 +120,46 @@ def reclassify_modules(
|
|
|
63
120
|
|
|
64
121
|
Has no effect on already-reclassified modules.
|
|
65
122
|
'''
|
|
123
|
+
_reclassify_module(
|
|
124
|
+
attributes,
|
|
125
|
+
attributes_namer = attributes_namer,
|
|
126
|
+
recursive = recursive,
|
|
127
|
+
replacement_class = replacement_class )
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _reclassify_module(
|
|
131
|
+
attributes: __.typx.Annotated[
|
|
132
|
+
__.cabc.Mapping[ str, __.typx.Any ] | __.types.ModuleType | str,
|
|
133
|
+
__.ddoc.Doc(
|
|
134
|
+
''' Module, module name, or dictionary of object attributes. ''' ),
|
|
135
|
+
], /, *,
|
|
136
|
+
attributes_namer: __.typx.Annotated[
|
|
137
|
+
_nomina.AttributesNamer,
|
|
138
|
+
__.ddoc.Doc(
|
|
139
|
+
''' Attributes namer function with which to seal class. ''' ),
|
|
140
|
+
] = __.calculate_attrname,
|
|
141
|
+
recursive: __.typx.Annotated[
|
|
142
|
+
bool, __.ddoc.Doc( ''' Recursively reclassify package modules? ''' )
|
|
143
|
+
] = False,
|
|
144
|
+
replacement_class: __.typx.Annotated[
|
|
145
|
+
type[ __.types.ModuleType ],
|
|
146
|
+
__.ddoc.Doc( ''' New class for module. ''' ),
|
|
147
|
+
] = Module,
|
|
148
|
+
) -> None:
|
|
149
|
+
# TODO? Ensure correct operation with namespace packages.
|
|
150
|
+
''' Core implementation for module reclassification.
|
|
151
|
+
|
|
152
|
+
Reclassifies modules to have attributes concealment and immutability.
|
|
153
|
+
Can operate on individual modules or entire package hierarchies.
|
|
154
|
+
|
|
155
|
+
Only converts modules within the same package to prevent unintended
|
|
156
|
+
modifications to external modules.
|
|
157
|
+
|
|
158
|
+
When used with a dictionary, converts any module objects found as
|
|
159
|
+
values if they belong to the same package.
|
|
160
|
+
|
|
161
|
+
Has no effect on already-reclassified modules.
|
|
162
|
+
'''
|
|
66
163
|
if isinstance( attributes, str ):
|
|
67
164
|
attributes = __.sys.modules[ attributes ]
|
|
68
165
|
if isinstance( attributes, __.types.ModuleType ):
|
|
@@ -76,7 +173,7 @@ def reclassify_modules(
|
|
|
76
173
|
if not __.inspect.ismodule( value ): continue
|
|
77
174
|
if not value.__name__.startswith( f"{package_name}." ): continue
|
|
78
175
|
if recursive:
|
|
79
|
-
|
|
176
|
+
_reclassify_module(
|
|
80
177
|
value,
|
|
81
178
|
attributes_namer = attributes_namer,
|
|
82
179
|
recursive = True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|