accretive 2.2a0__tar.gz → 3.0__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.
- {accretive-2.2a0 → accretive-3.0}/PKG-INFO +47 -20
- {accretive-2.2a0 → accretive-3.0}/README.rst +41 -16
- {accretive-2.2a0 → accretive-3.0}/pyproject.toml +200 -37
- accretive-2.2a0/sources/accretive/_annotations.py → accretive-3.0/sources/accretive/__/__init__.py +6 -17
- accretive-3.0/sources/accretive/__/dictionaries.py +106 -0
- accretive-3.0/sources/accretive/__/docstrings.py +49 -0
- accretive-2.2a0/sources/accretive/_docstrings.py → accretive-3.0/sources/accretive/__/doctab.py +8 -3
- accretive-3.0/sources/accretive/__/exceptions.py +53 -0
- accretive-3.0/sources/accretive/__/immutables.py +265 -0
- accretive-3.0/sources/accretive/__/imports.py +75 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/__init__.py +5 -23
- accretive-3.0/sources/accretive/classes.py +389 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/dictionaries.py +96 -95
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/exceptions.py +13 -61
- accretive-3.0/sources/accretive/modules.py +99 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/namespaces.py +22 -22
- accretive-3.0/sources/accretive/objects.py +193 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/qaliases.py +10 -9
- accretive-2.2a0/sources/accretive/__.py +0 -395
- accretive-2.2a0/sources/accretive/classes.py +0 -225
- accretive-2.2a0/sources/accretive/modules.py +0 -68
- accretive-2.2a0/sources/accretive/objects.py +0 -80
- {accretive-2.2a0 → accretive-3.0}/.gitignore +0 -0
- {accretive-2.2a0 → accretive-3.0}/LICENSE.txt +0 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/_typedecls/__builtins__.pyi +0 -0
- {accretive-2.2a0 → accretive-3.0}/sources/accretive/py.typed +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: accretive
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0
|
|
4
4
|
Summary: Accretive data structures.
|
|
5
5
|
Project-URL: Homepage, https://github.com/emcd/python-accretive
|
|
6
6
|
Project-URL: Documentation, https://emcd.github.io/python-accretive
|
|
7
|
-
Project-URL: Source Code, https://github.com/emcd/python-accretive
|
|
8
7
|
Project-URL: Download, https://pypi.org/project/accretive/#files
|
|
8
|
+
Project-URL: Source Code, https://github.com/emcd/python-accretive
|
|
9
9
|
Project-URL: Issue Tracker, https://github.com/emcd/python-accretive/issues
|
|
10
10
|
Author-email: Eric McDonald <emcd@users.noreply.github.com>
|
|
11
|
-
License: Apache-2.0
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE.txt
|
|
12
13
|
Keywords: accretion,api,dictionary,indelibility,namespace
|
|
13
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
15
|
Classifier: Intended Audience :: Developers
|
|
@@ -22,6 +23,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
22
23
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
23
24
|
Classifier: Topic :: Software Development
|
|
24
25
|
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: absence
|
|
25
27
|
Requires-Dist: typing-extensions
|
|
26
28
|
Description-Content-Type: text/x-rst
|
|
27
29
|
|
|
@@ -48,7 +50,7 @@ Description-Content-Type: text/x-rst
|
|
|
48
50
|
*******************************************************************************
|
|
49
51
|
|
|
50
52
|
.. image:: https://img.shields.io/pypi/v/accretive
|
|
51
|
-
:alt:
|
|
53
|
+
:alt: Package Version
|
|
52
54
|
:target: https://pypi.org/project/accretive/
|
|
53
55
|
|
|
54
56
|
.. image:: https://img.shields.io/pypi/status/accretive
|
|
@@ -63,16 +65,16 @@ Description-Content-Type: text/x-rst
|
|
|
63
65
|
:alt: Code Coverage Percentage
|
|
64
66
|
:target: https://github.com/emcd/python-accretive/actions/workflows/tester.yaml
|
|
65
67
|
|
|
68
|
+
.. image:: https://img.shields.io/github/license/emcd/python-accretive
|
|
69
|
+
:alt: Project License
|
|
70
|
+
:target: https://github.com/emcd/python-accretive/blob/master/LICENSE.txt
|
|
71
|
+
|
|
66
72
|
.. image:: https://img.shields.io/pypi/pyversions/accretive
|
|
67
73
|
:alt: Python Versions
|
|
68
74
|
:target: https://pypi.org/project/accretive/
|
|
69
75
|
|
|
70
|
-
.. image:: https://img.shields.io/pypi/l/accretive
|
|
71
|
-
:alt: Project License
|
|
72
|
-
:target: https://github.com/emcd/python-accretive/blob/master/LICENSE.txt
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
🔒 A Python library package which provides **accretive data structures** -
|
|
77
|
+
🌌 A Python library package which provides **accretive data structures** -
|
|
76
78
|
collections which can grow but never shrink.
|
|
77
79
|
|
|
78
80
|
|
|
@@ -93,7 +95,9 @@ Key Features ⭐
|
|
|
93
95
|
`dataclasses
|
|
94
96
|
<https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass>`_.
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
|
|
99
|
+
Note on Immutability 📢
|
|
100
|
+
===============================================================================
|
|
97
101
|
|
|
98
102
|
Enforcement of immutability is quite difficult in Python. While this library
|
|
99
103
|
encourages immutability by default, it can be circumvented by anyone who has
|
|
@@ -103,6 +107,14 @@ Key Features ⭐
|
|
|
103
107
|
tampering.
|
|
104
108
|
|
|
105
109
|
|
|
110
|
+
Installation 📦
|
|
111
|
+
===============================================================================
|
|
112
|
+
|
|
113
|
+
::
|
|
114
|
+
|
|
115
|
+
pip install accretive
|
|
116
|
+
|
|
117
|
+
|
|
106
118
|
Examples 💡
|
|
107
119
|
===============================================================================
|
|
108
120
|
|
|
@@ -155,6 +167,25 @@ accretive.exceptions.EntryImmutabilityError: Cannot alter or remove existing ent
|
|
|
155
167
|
accretive.dictionaries.Dictionary( {'apples': 12, 'bananas': 6, 'cherries': 42, 'blueberries': 96, 'strawberries': 24} )
|
|
156
168
|
|
|
157
169
|
|
|
170
|
+
Accretive Objects 🧱
|
|
171
|
+
-------------------------------------------------------------------------------
|
|
172
|
+
|
|
173
|
+
The ``accretive`` decorator can be applied to any class to make its instances enforce attribute immutability after assignment.
|
|
174
|
+
|
|
175
|
+
>>> from accretive import accretive
|
|
176
|
+
>>> @accretive
|
|
177
|
+
... class Config:
|
|
178
|
+
... def __init__( self, debug = False ):
|
|
179
|
+
... self.debug = debug
|
|
180
|
+
...
|
|
181
|
+
>>> config = Config( debug = True )
|
|
182
|
+
>>> config.verbose = True # ✅ Allows new attributes
|
|
183
|
+
>>> config.debug = False # ❌ Attempted reassignment raises error
|
|
184
|
+
Traceback (most recent call last):
|
|
185
|
+
...
|
|
186
|
+
accretive.exceptions.AttributeImmutabilityError: Cannot reassign or delete existing attribute 'debug'.
|
|
187
|
+
|
|
188
|
+
|
|
158
189
|
Use Cases 🎯
|
|
159
190
|
===============================================================================
|
|
160
191
|
|
|
@@ -166,14 +197,6 @@ Use Cases 🎯
|
|
|
166
197
|
with immutability guarantees.
|
|
167
198
|
|
|
168
199
|
|
|
169
|
-
Installation 📦
|
|
170
|
-
===============================================================================
|
|
171
|
-
|
|
172
|
-
::
|
|
173
|
-
|
|
174
|
-
pip install accretive
|
|
175
|
-
|
|
176
|
-
|
|
177
200
|
`More Flair <https://www.imdb.com/title/tt0151804/characters/nm0431918>`_
|
|
178
201
|
===============================================================================
|
|
179
202
|
|
|
@@ -181,6 +204,10 @@ Installation 📦
|
|
|
181
204
|
:alt: GitHub last commit
|
|
182
205
|
:target: https://github.com/emcd/python-accretive
|
|
183
206
|
|
|
207
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json
|
|
208
|
+
:alt: Copier
|
|
209
|
+
:target: https://github.com/copier-org/copier
|
|
210
|
+
|
|
184
211
|
.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
|
|
185
212
|
:alt: Hatch
|
|
186
213
|
:target: https://github.com/pypa/hatch
|
|
@@ -199,7 +226,7 @@ Installation 📦
|
|
|
199
226
|
|
|
200
227
|
.. image:: https://microsoft.github.io/pyright/img/pyright_badge.svg
|
|
201
228
|
:alt: Pyright
|
|
202
|
-
:target: https://microsoft.github.io/pyright
|
|
229
|
+
:target: https://microsoft.github.io/pyright
|
|
203
230
|
|
|
204
231
|
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
205
232
|
:alt: Ruff
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*******************************************************************************
|
|
22
22
|
|
|
23
23
|
.. image:: https://img.shields.io/pypi/v/accretive
|
|
24
|
-
:alt:
|
|
24
|
+
:alt: Package Version
|
|
25
25
|
:target: https://pypi.org/project/accretive/
|
|
26
26
|
|
|
27
27
|
.. image:: https://img.shields.io/pypi/status/accretive
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
:alt: Code Coverage Percentage
|
|
37
37
|
:target: https://github.com/emcd/python-accretive/actions/workflows/tester.yaml
|
|
38
38
|
|
|
39
|
+
.. image:: https://img.shields.io/github/license/emcd/python-accretive
|
|
40
|
+
:alt: Project License
|
|
41
|
+
:target: https://github.com/emcd/python-accretive/blob/master/LICENSE.txt
|
|
42
|
+
|
|
39
43
|
.. image:: https://img.shields.io/pypi/pyversions/accretive
|
|
40
44
|
:alt: Python Versions
|
|
41
45
|
:target: https://pypi.org/project/accretive/
|
|
42
46
|
|
|
43
|
-
.. image:: https://img.shields.io/pypi/l/accretive
|
|
44
|
-
:alt: Project License
|
|
45
|
-
:target: https://github.com/emcd/python-accretive/blob/master/LICENSE.txt
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
🔒 A Python library package which provides **accretive data structures** -
|
|
48
|
+
🌌 A Python library package which provides **accretive data structures** -
|
|
49
49
|
collections which can grow but never shrink.
|
|
50
50
|
|
|
51
51
|
|
|
@@ -66,7 +66,9 @@ Key Features ⭐
|
|
|
66
66
|
`dataclasses
|
|
67
67
|
<https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass>`_.
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
Note on Immutability 📢
|
|
71
|
+
===============================================================================
|
|
70
72
|
|
|
71
73
|
Enforcement of immutability is quite difficult in Python. While this library
|
|
72
74
|
encourages immutability by default, it can be circumvented by anyone who has
|
|
@@ -76,6 +78,14 @@ Key Features ⭐
|
|
|
76
78
|
tampering.
|
|
77
79
|
|
|
78
80
|
|
|
81
|
+
Installation 📦
|
|
82
|
+
===============================================================================
|
|
83
|
+
|
|
84
|
+
::
|
|
85
|
+
|
|
86
|
+
pip install accretive
|
|
87
|
+
|
|
88
|
+
|
|
79
89
|
Examples 💡
|
|
80
90
|
===============================================================================
|
|
81
91
|
|
|
@@ -128,6 +138,25 @@ accretive.exceptions.EntryImmutabilityError: Cannot alter or remove existing ent
|
|
|
128
138
|
accretive.dictionaries.Dictionary( {'apples': 12, 'bananas': 6, 'cherries': 42, 'blueberries': 96, 'strawberries': 24} )
|
|
129
139
|
|
|
130
140
|
|
|
141
|
+
Accretive Objects 🧱
|
|
142
|
+
-------------------------------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
The ``accretive`` decorator can be applied to any class to make its instances enforce attribute immutability after assignment.
|
|
145
|
+
|
|
146
|
+
>>> from accretive import accretive
|
|
147
|
+
>>> @accretive
|
|
148
|
+
... class Config:
|
|
149
|
+
... def __init__( self, debug = False ):
|
|
150
|
+
... self.debug = debug
|
|
151
|
+
...
|
|
152
|
+
>>> config = Config( debug = True )
|
|
153
|
+
>>> config.verbose = True # ✅ Allows new attributes
|
|
154
|
+
>>> config.debug = False # ❌ Attempted reassignment raises error
|
|
155
|
+
Traceback (most recent call last):
|
|
156
|
+
...
|
|
157
|
+
accretive.exceptions.AttributeImmutabilityError: Cannot reassign or delete existing attribute 'debug'.
|
|
158
|
+
|
|
159
|
+
|
|
131
160
|
Use Cases 🎯
|
|
132
161
|
===============================================================================
|
|
133
162
|
|
|
@@ -139,14 +168,6 @@ Use Cases 🎯
|
|
|
139
168
|
with immutability guarantees.
|
|
140
169
|
|
|
141
170
|
|
|
142
|
-
Installation 📦
|
|
143
|
-
===============================================================================
|
|
144
|
-
|
|
145
|
-
::
|
|
146
|
-
|
|
147
|
-
pip install accretive
|
|
148
|
-
|
|
149
|
-
|
|
150
171
|
`More Flair <https://www.imdb.com/title/tt0151804/characters/nm0431918>`_
|
|
151
172
|
===============================================================================
|
|
152
173
|
|
|
@@ -154,6 +175,10 @@ Installation 📦
|
|
|
154
175
|
:alt: GitHub last commit
|
|
155
176
|
:target: https://github.com/emcd/python-accretive
|
|
156
177
|
|
|
178
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json
|
|
179
|
+
:alt: Copier
|
|
180
|
+
:target: https://github.com/copier-org/copier
|
|
181
|
+
|
|
157
182
|
.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
|
|
158
183
|
:alt: Hatch
|
|
159
184
|
:target: https://github.com/pypa/hatch
|
|
@@ -172,7 +197,7 @@ Installation 📦
|
|
|
172
197
|
|
|
173
198
|
.. image:: https://microsoft.github.io/pyright/img/pyright_badge.svg
|
|
174
199
|
:alt: Pyright
|
|
175
|
-
:target: https://microsoft.github.io/pyright
|
|
200
|
+
:target: https://microsoft.github.io/pyright
|
|
176
201
|
|
|
177
202
|
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
178
203
|
:alt: Ruff
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
# vim: set filetype=toml fileencoding=utf-8:
|
|
2
|
+
# -*- mode: toml ; coding: utf-8 -*-
|
|
3
|
+
|
|
1
4
|
[build-system]
|
|
2
|
-
requires = [
|
|
5
|
+
requires = [
|
|
6
|
+
'hatchling',
|
|
7
|
+
]
|
|
3
8
|
build-backend = 'hatchling.build'
|
|
4
9
|
|
|
5
10
|
[project]
|
|
@@ -10,7 +15,11 @@ license = 'Apache-2.0'
|
|
|
10
15
|
readme = { 'file' = 'README.rst', 'content-type' = 'text/x-rst' }
|
|
11
16
|
requires-python = '>= 3.10'
|
|
12
17
|
dependencies = [
|
|
18
|
+
'absence',
|
|
13
19
|
'typing-extensions',
|
|
20
|
+
# --- BEGIN: Injected by Copier ---
|
|
21
|
+
|
|
22
|
+
# --- END: Injected by Copier ---
|
|
14
23
|
]
|
|
15
24
|
classifiers = [ # https://pypi.org/classifiers
|
|
16
25
|
'Development Status :: 5 - Production/Stable',
|
|
@@ -32,8 +41,8 @@ email = 'emcd@users.noreply.github.com'
|
|
|
32
41
|
[project.urls]
|
|
33
42
|
'Homepage' = 'https://github.com/emcd/python-accretive'
|
|
34
43
|
'Documentation' = 'https://emcd.github.io/python-accretive'
|
|
35
|
-
'Source Code' = 'https://github.com/emcd/python-accretive'
|
|
36
44
|
'Download' = 'https://pypi.org/project/accretive/#files'
|
|
45
|
+
'Source Code' = 'https://github.com/emcd/python-accretive'
|
|
37
46
|
'Issue Tracker' = 'https://github.com/emcd/python-accretive/issues'
|
|
38
47
|
|
|
39
48
|
[tool.SELF]
|
|
@@ -45,10 +54,10 @@ exclude_dirs = [ 'tests' ]
|
|
|
45
54
|
# https://coverage.readthedocs.io/en/latest/config.html
|
|
46
55
|
[tool.coverage.run]
|
|
47
56
|
branch = true
|
|
48
|
-
command_line = '-m pytest'
|
|
57
|
+
command_line = '-m pytest' # TODO? '--fail-under'
|
|
49
58
|
data_file = '.auxiliary/caches/pytest/coverage.sqlite3'
|
|
50
59
|
parallel = true
|
|
51
|
-
source = [ 'sources'
|
|
60
|
+
source = [ 'sources' ]
|
|
52
61
|
[tool.coverage.html]
|
|
53
62
|
directory = '.auxiliary/artifacts/coverage-pytest'
|
|
54
63
|
[tool.coverage.xml]
|
|
@@ -58,9 +67,21 @@ output = '.auxiliary/artifacts/coverage-pytest/coverage.xml'
|
|
|
58
67
|
[tool.hatch.build]
|
|
59
68
|
directory = '.auxiliary/artifacts/hatch-build'
|
|
60
69
|
[tool.hatch.build.targets.sdist]
|
|
61
|
-
only-include = [
|
|
70
|
+
only-include = [
|
|
71
|
+
'sources/accretive',
|
|
72
|
+
# --- BEGIN: Injected by Copier ---
|
|
73
|
+
|
|
74
|
+
# --- END: Injected by Copier ---
|
|
75
|
+
]
|
|
76
|
+
strict-naming = false
|
|
62
77
|
[tool.hatch.build.targets.wheel]
|
|
63
|
-
only-include = [
|
|
78
|
+
only-include = [
|
|
79
|
+
'sources/accretive',
|
|
80
|
+
# --- BEGIN: Injected by Copier ---
|
|
81
|
+
|
|
82
|
+
# --- END: Injected by Copier ---
|
|
83
|
+
]
|
|
84
|
+
strict-naming = false
|
|
64
85
|
[tool.hatch.build.targets.wheel.sources]
|
|
65
86
|
'sources/accretive' = 'accretive'
|
|
66
87
|
[tool.hatch.envs.default]
|
|
@@ -68,29 +89,38 @@ python = '3.10'
|
|
|
68
89
|
[tool.hatch.envs.develop]
|
|
69
90
|
description = ''' Development environment. '''
|
|
70
91
|
dependencies = [
|
|
71
|
-
'
|
|
92
|
+
'Jinja2',
|
|
72
93
|
'bandit',
|
|
73
94
|
'coverage[toml]',
|
|
74
95
|
'furo',
|
|
75
|
-
'hypothesis',
|
|
76
96
|
'icecream',
|
|
77
|
-
'
|
|
97
|
+
'isort',
|
|
78
98
|
'packaging',
|
|
79
99
|
'pre-commit',
|
|
80
100
|
'pylint',
|
|
101
|
+
'pylint-per-file-ignores',
|
|
81
102
|
'pyright',
|
|
82
103
|
'pytest',
|
|
83
104
|
'ruff',
|
|
84
|
-
'semgrep',
|
|
105
|
+
'semgrep;platform_system!="Windows"', # https://github.com/returntocorp/semgrep/issues/1330
|
|
85
106
|
'sphinx',
|
|
86
107
|
'sphinx-copybutton',
|
|
87
108
|
'sphinx-inline-tabs',
|
|
88
109
|
'towncrier',
|
|
89
110
|
'tryceratops',
|
|
90
|
-
'
|
|
111
|
+
'yapf',
|
|
112
|
+
# --- BEGIN: Injected by Copier ---
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# --- END: Injected by Copier ---
|
|
117
|
+
]
|
|
118
|
+
post-install-commands = [
|
|
119
|
+
# --- BEGIN: Injected by Copier ---
|
|
120
|
+
|
|
121
|
+
# --- END: Injected by Copier ---
|
|
91
122
|
]
|
|
92
123
|
[tool.hatch.envs.develop.env-vars]
|
|
93
|
-
HYPOTHESIS_STORAGE_DIRECTORY = '.auxiliary/caches/hypothesis'
|
|
94
124
|
PYTHONUNBUFFERED = 'TRUE' # TODO: Only for coverage/pytest.
|
|
95
125
|
[tool.hatch.envs.develop.scripts]
|
|
96
126
|
docsgen = [
|
|
@@ -102,16 +132,19 @@ docsgen = [
|
|
|
102
132
|
documentation/sphinx .auxiliary/artifacts/sphinx-html''',
|
|
103
133
|
]
|
|
104
134
|
linters = [
|
|
105
|
-
'ruff check --quiet sources documentation tests',
|
|
106
|
-
'bandit --configfile pyproject.toml --quiet --recursive sources',
|
|
107
|
-
'tryceratops sources',
|
|
108
|
-
'pyright sources',
|
|
109
|
-
'pylint sources documentation tests',
|
|
110
|
-
'semgrep --config p/python --error --quiet --skip-unknown-extensions
|
|
135
|
+
'''ruff check --quiet sources documentation tests''',
|
|
136
|
+
'''bandit --configfile pyproject.toml --quiet --recursive sources''',
|
|
137
|
+
'''tryceratops sources''',
|
|
138
|
+
'''pyright sources''',
|
|
139
|
+
'''pylint --recursive yes sources documentation tests''',
|
|
140
|
+
'''semgrep --config p/python --error --quiet --skip-unknown-extensions \
|
|
141
|
+
sources/accretive''',
|
|
111
142
|
]
|
|
112
143
|
packagers = [
|
|
113
|
-
'hatch build',
|
|
114
|
-
#
|
|
144
|
+
'''hatch build''',
|
|
145
|
+
# --- BEGIN: Injected by Copier ---
|
|
146
|
+
|
|
147
|
+
# --- END: Injected by Copier ---
|
|
115
148
|
]
|
|
116
149
|
testers = [
|
|
117
150
|
'coverage erase',
|
|
@@ -131,17 +164,58 @@ make-all = [
|
|
|
131
164
|
description = ''' Quality assurance environment. '''
|
|
132
165
|
template = 'develop'
|
|
133
166
|
[[tool.hatch.envs.qa.matrix]]
|
|
134
|
-
python = [
|
|
167
|
+
python = [
|
|
168
|
+
'3.10',
|
|
169
|
+
'3.11',
|
|
170
|
+
'3.12',
|
|
171
|
+
'3.13',
|
|
172
|
+
'pypy3.10',
|
|
173
|
+
]
|
|
135
174
|
[tool.hatch.version]
|
|
136
175
|
path = 'sources/accretive/__init__.py'
|
|
137
176
|
|
|
177
|
+
# https://pycqa.github.io/isort/docs/configuration/options.html
|
|
178
|
+
# https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html
|
|
179
|
+
[tool.isort]
|
|
180
|
+
atomic = true
|
|
181
|
+
#color = false
|
|
182
|
+
#combine_as = false
|
|
183
|
+
#combine_straight_imports = false
|
|
184
|
+
#extra_standard_library = [ ]
|
|
185
|
+
follow_links = false
|
|
186
|
+
#force_alphabetical_sort_within_sections = false
|
|
187
|
+
#float_to_top = false
|
|
188
|
+
honor_noqa = true
|
|
189
|
+
#ignore_whitespace = false
|
|
190
|
+
include_trailing_comma = true
|
|
191
|
+
# known_OTHER: substitute OTHER
|
|
192
|
+
known_first_party = [ 'accretive' ]
|
|
193
|
+
#known_third_party = [ ]
|
|
194
|
+
#line_length = 79
|
|
195
|
+
#lines_after_imports = -1 # automatic
|
|
196
|
+
#lines_before_imports = -1 # automatic
|
|
197
|
+
multi_line_output = 3 # vertical hanging indent
|
|
198
|
+
#quiet = false
|
|
199
|
+
#sections = [ 'FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER' ]
|
|
200
|
+
skip_gitignore = true
|
|
201
|
+
split_on_trailing_comma = true
|
|
202
|
+
#src_paths = [ ]
|
|
203
|
+
#star_first = false
|
|
204
|
+
#supported_extensions = [ 'pxd', 'py', 'pyi', 'pyx' ]
|
|
205
|
+
use_parentheses = true
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# https://mypy.readthedocs.io/en/stable/config_file.html
|
|
138
210
|
[tool.mypy]
|
|
211
|
+
# Note: Due to repeated painful experiences with Mypy, we use Pyright instead.
|
|
212
|
+
# Pyright properly handles TypeVars, etc...
|
|
139
213
|
cache_dir = '.auxiliary/caches/mypy'
|
|
140
|
-
|
|
141
|
-
|
|
214
|
+
exclude = [ '.*' ] # Ignore everything
|
|
215
|
+
ignore_errors = true
|
|
216
|
+
follow_imports = 'skip'
|
|
142
217
|
pretty = true
|
|
143
218
|
strict = false
|
|
144
|
-
# TODO: Completely disable.
|
|
145
219
|
|
|
146
220
|
# https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html
|
|
147
221
|
[tool.pylint.main]
|
|
@@ -168,6 +242,7 @@ load-plugins = [
|
|
|
168
242
|
'pylint.extensions.redefined_variable_type',
|
|
169
243
|
# 'pylint.extensions.set_membership',
|
|
170
244
|
# 'pylint.extensions.while_used',
|
|
245
|
+
'pylint_per_file_ignores',
|
|
171
246
|
]
|
|
172
247
|
recursive = false
|
|
173
248
|
suggestion-mode = true
|
|
@@ -175,18 +250,19 @@ suggestion-mode = true
|
|
|
175
250
|
const-rgx = '([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$'
|
|
176
251
|
good-names = [ '_', '__' ]
|
|
177
252
|
include-naming-hint = true
|
|
253
|
+
[tool.pylint.broad_try_clause]
|
|
254
|
+
max-try-statements = 2
|
|
178
255
|
[tool.pylint.classes]
|
|
179
256
|
defining-attr-methods = [ '__init__', '__new__', '__post_init__' ]
|
|
180
257
|
exclude-protected = [ ]
|
|
181
258
|
valid-classmethod-first-arg = [ 'selfclass' ]
|
|
182
|
-
valid-metaclass-classmethod-first-arg = [ '
|
|
259
|
+
valid-metaclass-classmethod-first-arg = [ 'clscls' ]
|
|
183
260
|
[tool.pylint.design]
|
|
184
261
|
# TODO: exclude-too-few-public-methods: Consider exception hierarchies.
|
|
185
262
|
ignored-parents = [
|
|
186
263
|
'abc.ABCMeta',
|
|
187
|
-
'accretive.__.
|
|
188
|
-
'accretive.exceptions.Omniexception',
|
|
189
|
-
'accretive.exceptions.Omnierror',
|
|
264
|
+
'accretive.__.exceptions.Omnierror',
|
|
265
|
+
'accretive.__.exceptions.Omniexception',
|
|
190
266
|
'accretive.objects.Class',
|
|
191
267
|
'accretive.objects.Object',
|
|
192
268
|
'builtins.AttributeError',
|
|
@@ -196,6 +272,12 @@ ignored-parents = [
|
|
|
196
272
|
'builtins.TypeError',
|
|
197
273
|
'builtins.ValueError',
|
|
198
274
|
'builtins.type',
|
|
275
|
+
'typing.Protocol',
|
|
276
|
+
'typing_extensions.Protocol',
|
|
277
|
+
# --- BEGIN: Injected by Copier ---
|
|
278
|
+
'accretive.exceptions.Omnierror',
|
|
279
|
+
'accretive.exceptions.Omniexception',
|
|
280
|
+
# --- END: Injected by Copier ---
|
|
199
281
|
]
|
|
200
282
|
max-args = 5
|
|
201
283
|
max-attributes = 7
|
|
@@ -209,10 +291,12 @@ max-statements = 30
|
|
|
209
291
|
min-public-methods = 1
|
|
210
292
|
[tool.pylint.exceptions]
|
|
211
293
|
overgeneral-exceptions = [
|
|
294
|
+
'builtins.BaseException',
|
|
295
|
+
'builtins.Exception',
|
|
296
|
+
# --- BEGIN: Injected by Copier ---
|
|
212
297
|
'accretive.exceptions.Omnierror',
|
|
213
298
|
'accretive.exceptions.Omniexception',
|
|
214
|
-
|
|
215
|
-
'builtins.Exception'
|
|
299
|
+
# --- END: Injected by Copier ---
|
|
216
300
|
]
|
|
217
301
|
[tool.pylint.format]
|
|
218
302
|
ignore-long-lines = '''^(\s*<?https?://\S+>?|([^'"]*\s+)?#.*)$'''
|
|
@@ -235,14 +319,25 @@ disable = [
|
|
|
235
319
|
'fixme',
|
|
236
320
|
'f-string-without-interpolation',
|
|
237
321
|
'import-outside-toplevel',
|
|
322
|
+
'invalid-name',
|
|
323
|
+
'logging-format-interpolation',
|
|
324
|
+
'logging-fstring-interpolation',
|
|
238
325
|
'multiple-statements',
|
|
239
326
|
'reimported',
|
|
240
327
|
'too-few-public-methods',
|
|
328
|
+
'too-many-positional-arguments', # 'too-many-arguments' is good enough
|
|
241
329
|
'ungrouped-imports',
|
|
330
|
+
'unused-wildcard-import',
|
|
242
331
|
'use-dict-literal',
|
|
332
|
+
'using-exception-groups-in-unsupported-version',
|
|
243
333
|
'wrong-import-order',
|
|
244
334
|
'wrong-import-position',
|
|
245
335
|
]
|
|
336
|
+
# TODO: Latest 'per-file-ignores' code may supports dicts and lists in addition to strings.
|
|
337
|
+
per-file-ignores = '''
|
|
338
|
+
/tests/:attribute-defined-outside-init,comparison-with-itself,magic-value-comparison,missing-class-docstring,missing-function-docstring,protected-access,singleton-comparison,superfluous-parens,too-many-try-statements,unexpected-keyword-arg
|
|
339
|
+
__init__\.py:unused-import
|
|
340
|
+
''' # Note: Paths are regexes.
|
|
246
341
|
[tool.pylint.refactoring]
|
|
247
342
|
max-nested-blocks = 3
|
|
248
343
|
never-returning-functions = [ 'sys.exit', 'argparse.parse_error' ]
|
|
@@ -273,8 +368,8 @@ ignore-mixin-members = false
|
|
|
273
368
|
missing-member-hint = true
|
|
274
369
|
missing-member-hint-distance = 1
|
|
275
370
|
missing-member-max-choices = 2
|
|
276
|
-
#
|
|
277
|
-
#
|
|
371
|
+
#mixin-class-rgx = '.*[Mm]ixin'
|
|
372
|
+
#signature-mutators = [ ]
|
|
278
373
|
[tool.pylint.variables]
|
|
279
374
|
additional-builtins = [ 'ic' ]
|
|
280
375
|
callbacks = [ ]
|
|
@@ -282,6 +377,7 @@ dummy-variables-rgx = '''_$'''
|
|
|
282
377
|
ignored-argument-names = '''_.*'''
|
|
283
378
|
redefining-builtins-modules = [ 'builtins', 'io' ]
|
|
284
379
|
|
|
380
|
+
# https://microsoft.github.io/pyright/#/configuration
|
|
285
381
|
[tool.pyright]
|
|
286
382
|
include = [ 'sources' ]
|
|
287
383
|
reportConstantRedefinition = true
|
|
@@ -290,8 +386,10 @@ reportMatchNotExhaustive = true
|
|
|
290
386
|
reportMissingImports = true
|
|
291
387
|
reportMissingTypeStubs = true
|
|
292
388
|
reportMissingTypeArgument = true
|
|
293
|
-
|
|
294
|
-
|
|
389
|
+
reportPossiblyUnboundVariable = false # Covered by other linters.
|
|
390
|
+
reportPrivateImportUsage = false # Covered by other linters.
|
|
391
|
+
reportPrivateUsage = false # Covered by other linters.
|
|
392
|
+
reportSelfClsParameterName = false # Too opinionated.
|
|
295
393
|
reportUnknownArgumentType = true
|
|
296
394
|
reportUnknownLambdaType = true
|
|
297
395
|
reportUnknownMemberType = true
|
|
@@ -304,6 +402,8 @@ reportUntypedClassDecorator = true
|
|
|
304
402
|
reportUntypedFunctionDecorator = true
|
|
305
403
|
reportUntypedNamedTuple = true
|
|
306
404
|
reportUnusedExpression = true
|
|
405
|
+
reportUnusedImport = false # Covered by other linters.
|
|
406
|
+
reportUnusedVariable = false # Covered by other linters.
|
|
307
407
|
#strict = [ 'sources' ]
|
|
308
408
|
stubPath = 'sources/accretive/_typedecls'
|
|
309
409
|
|
|
@@ -312,8 +412,8 @@ stubPath = 'sources/accretive/_typedecls'
|
|
|
312
412
|
# attribute on protected modules. Instead, we use Sphinx to run doctests.
|
|
313
413
|
minversion = '8.1'
|
|
314
414
|
addopts = '--capture=no --exitfirst -rfE'
|
|
315
|
-
testpaths = [ 'tests'
|
|
316
|
-
python_files = [ '*.py' ]
|
|
415
|
+
testpaths = [ 'tests' ]
|
|
416
|
+
python_files = [ 'test_*.py' ]
|
|
317
417
|
python_functions = [ 'test_[0-9][0-9][0-9]_*' ]
|
|
318
418
|
cache_dir = '.auxiliary/caches/pytest'
|
|
319
419
|
|
|
@@ -322,7 +422,13 @@ builtins = [ 'ic' ]
|
|
|
322
422
|
cache-dir = '.auxiliary/caches/ruff'
|
|
323
423
|
[tool.ruff.lint]
|
|
324
424
|
ignore = [
|
|
325
|
-
'E701', #
|
|
425
|
+
'E701', # multiple-statements-on-one-line-colon
|
|
426
|
+
]
|
|
427
|
+
[tool.ruff.lint.per-file-ignores]
|
|
428
|
+
'__init__.py' = [
|
|
429
|
+
'F401', # unused-import
|
|
430
|
+
'F403', # undefined-local-with-import-star
|
|
431
|
+
'F405', # undefined-local-with-import-star-usage
|
|
326
432
|
]
|
|
327
433
|
|
|
328
434
|
[tool.towncrier]
|
|
@@ -350,3 +456,60 @@ showcontent = true
|
|
|
350
456
|
directory = 'removal'
|
|
351
457
|
name = 'Deprecations and Removals'
|
|
352
458
|
showcontent = true
|
|
459
|
+
|
|
460
|
+
# https://github.com/google/yapf?tab=readme-ov-file#knobs
|
|
461
|
+
# yapf --style-help
|
|
462
|
+
[tool.yapf]
|
|
463
|
+
align_closing_bracket_with_visual_indent = false
|
|
464
|
+
allow_multiline_dictionary_keys = true
|
|
465
|
+
allow_multiline_lambdas = true
|
|
466
|
+
#allow_split_before_default_or_named_assigns = true
|
|
467
|
+
#allow_split_before_dict_value = true
|
|
468
|
+
blank_line_before_module_docstring = true
|
|
469
|
+
#blank_line_before_nested_class_or_def = true
|
|
470
|
+
#blank_lines_around_top_level_definition = 2
|
|
471
|
+
blank_lines_between_top_level_imports_and_variables = 2
|
|
472
|
+
#coalesce_brackets = false
|
|
473
|
+
#column_limit = 79
|
|
474
|
+
#continuation_align_style = 'SPACE'
|
|
475
|
+
#continuation_indent_width = 4
|
|
476
|
+
dedent_closing_brackets = true
|
|
477
|
+
#disable_ending_comma_heuristic = false
|
|
478
|
+
#disable_split_list_with_comment = false
|
|
479
|
+
#each_dict_entry_on_separate_line = true
|
|
480
|
+
#force_multiline_dict = false
|
|
481
|
+
indent_dictionary_value = true
|
|
482
|
+
#indent_width = 4
|
|
483
|
+
join_multiple_lines = true
|
|
484
|
+
#space_between_ending_comma_and_closing_bracket = true
|
|
485
|
+
space_inside_brackets = true
|
|
486
|
+
spaces_around_default_or_named_assign = true
|
|
487
|
+
spaces_around_dict_delimiters = true
|
|
488
|
+
spaces_around_list_delimiters = true
|
|
489
|
+
spaces_around_power_operator = true
|
|
490
|
+
spaces_around_subscript_colon = true
|
|
491
|
+
spaces_around_tuple_delimiters = true
|
|
492
|
+
#spaces_before_comment = 2
|
|
493
|
+
#split_all_comma_separated_values = false
|
|
494
|
+
#split_all_top_level_comma_separated_values = false
|
|
495
|
+
split_arguments_when_comma_terminated = true
|
|
496
|
+
split_before_arithmetic_operator = true
|
|
497
|
+
split_before_bitwise_operator = true
|
|
498
|
+
split_before_closing_bracket = false
|
|
499
|
+
#split_before_dict_set_generator = true
|
|
500
|
+
split_before_dot = true
|
|
501
|
+
split_before_expression_after_opening_paren = true
|
|
502
|
+
split_before_first_argument = true
|
|
503
|
+
split_before_logical_operator = true
|
|
504
|
+
#split_before_named_assigns = true
|
|
505
|
+
split_complex_comprehension = true
|
|
506
|
+
split_penalty_after_opening_bracket = 100 # default: 300
|
|
507
|
+
#split_penalty_after_unary_operator = 10000
|
|
508
|
+
#split_penalty_arithmetic_operator = 300
|
|
509
|
+
#split_penalty_before_if_expr = 0
|
|
510
|
+
#split_penalty_bitwise_operator = 300
|
|
511
|
+
#split_penalty_comprehension = 80
|
|
512
|
+
#split_penalty_excess_character = 7000
|
|
513
|
+
#split_penalty_for_added_line_split = 30
|
|
514
|
+
#split_penalty_import_names = 0
|
|
515
|
+
#split_penalty_logical_operator = 300
|