hunterMakesPy 0.10.1__tar.gz → 0.10.3__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.
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/PKG-INFO +9 -11
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/README.md +8 -4
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/coping.py +7 -2
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/kitFilesystem.py +7 -10
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/packages.py +8 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_coping.py +10 -7
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_kitFilesystem.py +20 -20
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy.egg-info/PKG-INFO +9 -11
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy.egg-info/requires.txt +0 -8
- huntermakespy-0.10.3/pyproject.toml +285 -0
- huntermakespy-0.10.1/pyproject.toml +0 -81
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/LICENSE +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/__init__.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/_theSSOT.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/dataStructures.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/parseParameters.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/py.typed +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/semiotics.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/__init__.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/conftest.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/conftestAnnex.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/__init__.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/arrays.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/arraysRLE.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/callables.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/classes.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/containers.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/messages.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/pyprojects.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/pythonSource.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/text.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_conftestAnnex.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_dataStructures.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_parseParameters.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/test_theTypes.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/theTypes.py +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy.egg-info/SOURCES.txt +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy.egg-info/dependency_links.txt +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy.egg-info/top_level.txt +0 -0
- {huntermakespy-0.10.1 → huntermakespy-0.10.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterMakesPy
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.3
|
|
4
4
|
Summary: Easy Python functions making making functional Python functions easier.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License-Expression: CC-BY-NC-4.0
|
|
@@ -32,14 +32,9 @@ Requires-Dist: isort
|
|
|
32
32
|
Requires-Dist: more_itertools
|
|
33
33
|
Requires-Dist: numpy>=2.0
|
|
34
34
|
Requires-Dist: typing_extensions>=4.10.0
|
|
35
|
-
Provides-Extra: development
|
|
36
|
-
Requires-Dist: pytest-cov; extra == "development"
|
|
37
|
-
Provides-Extra: testing
|
|
38
|
-
Requires-Dist: hypothesis; extra == "testing"
|
|
39
|
-
Requires-Dist: pytest>=9.0; extra == "testing"
|
|
40
|
-
Requires-Dist: pytest-xdist; extra == "testing"
|
|
41
35
|
Dynamic: license-file
|
|
42
36
|
|
|
37
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
43
38
|
# hunterMakesPy
|
|
44
39
|
|
|
45
40
|
Utilities for converting mixed input to integers, calculating CPU limits, handling None values, importing code dynamically, and manipulating nested data.
|
|
@@ -164,6 +159,8 @@ encoded = autoDecodingRLE(arrayTarget)
|
|
|
164
159
|
## Configure Package Metadata at Runtime
|
|
165
160
|
|
|
166
161
|
`PackageSettings` reads `pyproject.toml` automatically to resolve the package name and installation path.
|
|
162
|
+
For an installed package, `PackageSettings` reads the name that packaging copied from `pyproject.toml`
|
|
163
|
+
into the package's metadata, so the `pyproject.toml` in the current working directory cannot change it.
|
|
167
164
|
|
|
168
165
|
```python
|
|
169
166
|
from hunterMakesPy import PackageSettings
|
|
@@ -181,14 +178,15 @@ from hunterMakesPy.tests import assertEqualTo
|
|
|
181
178
|
assertEqualTo(intInnit(["8080", 443]), [8080, 443], intInnit.__name__, ["8080", 443])
|
|
182
179
|
```
|
|
183
180
|
|
|
181
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
184
182
|
## My recovery
|
|
185
183
|
|
|
186
|
-
[](https://HunterThinks.com/support)
|
|
185
|
+

|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/hunterMakesPy#License-1-ov-file) outlines how you may use this work.
|
|
187
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
191
188
|
|
|
192
189
|
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
193
190
|
|
|
194
191
|
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
192
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
1
2
|
# hunterMakesPy
|
|
2
3
|
|
|
3
4
|
Utilities for converting mixed input to integers, calculating CPU limits, handling None values, importing code dynamically, and manipulating nested data.
|
|
@@ -122,6 +123,8 @@ encoded = autoDecodingRLE(arrayTarget)
|
|
|
122
123
|
## Configure Package Metadata at Runtime
|
|
123
124
|
|
|
124
125
|
`PackageSettings` reads `pyproject.toml` automatically to resolve the package name and installation path.
|
|
126
|
+
For an installed package, `PackageSettings` reads the name that packaging copied from `pyproject.toml`
|
|
127
|
+
into the package's metadata, so the `pyproject.toml` in the current working directory cannot change it.
|
|
125
128
|
|
|
126
129
|
```python
|
|
127
130
|
from hunterMakesPy import PackageSettings
|
|
@@ -139,14 +142,15 @@ from hunterMakesPy.tests import assertEqualTo
|
|
|
139
142
|
assertEqualTo(intInnit(["8080", 443]), [8080, 443], intInnit.__name__, ["8080", 443])
|
|
140
143
|
```
|
|
141
144
|
|
|
145
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
142
146
|
## My recovery
|
|
143
147
|
|
|
144
|
-
[](https://HunterThinks.com/support)
|
|
149
|
+

|
|
145
150
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/hunterMakesPy#License-1-ov-file) outlines how you may use this work.
|
|
151
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
149
152
|
|
|
150
153
|
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
151
154
|
|
|
152
155
|
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
156
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Package configuration and defensive programming utilities for Python projects."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
from importlib.metadata import metadata, PackageNotFoundError
|
|
4
5
|
from importlib.util import find_spec
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from typing import TYPE_CHECKING
|
|
@@ -12,10 +13,12 @@ if TYPE_CHECKING:
|
|
|
12
13
|
from importlib.machinery import ModuleSpec
|
|
13
14
|
|
|
14
15
|
def _getIdentifierPackagePACKAGING(identifierPackageFALLBACK: str) -> str:
|
|
15
|
-
"""Get package name from pyproject.toml or fallback to provided value."""
|
|
16
|
+
"""Get package name from the metadata that packaging wrote, from pyproject.toml, or fallback to provided value."""
|
|
16
17
|
identifierPackage: str = identifierPackageFALLBACK
|
|
17
18
|
with contextlib.suppress(OSError, tomllib.TOMLDecodeError, KeyError):
|
|
18
19
|
identifierPackage = tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8'))['project']['name'] or identifierPackageFALLBACK
|
|
20
|
+
with contextlib.suppress(PackageNotFoundError, ValueError):
|
|
21
|
+
identifierPackage = metadata(identifierPackageFALLBACK)['Name']
|
|
19
22
|
return identifierPackage
|
|
20
23
|
|
|
21
24
|
def _getPathPackageINSTALLING(identifierPackage: str) -> Path:
|
|
@@ -45,7 +48,9 @@ class PackageSettings:
|
|
|
45
48
|
Fallback package identifier used only during initialization when automatic discovery fails.
|
|
46
49
|
identifierPackage : str = ''
|
|
47
50
|
Canonical name of the package. An explicit value takes precedence over `pyproject.toml`, then
|
|
48
|
-
`identifierPackageFALLBACK`.
|
|
51
|
+
`identifierPackageFALLBACK`. For `pyproject.toml`, the `Name` that packaging wrote to the metadata of
|
|
52
|
+
the installed distribution named `identifierPackageFALLBACK` takes precedence over `project.name` in
|
|
53
|
+
the `pyproject.toml` of the current working directory.
|
|
49
54
|
pathPackage : Path = _getPathPackageINSTALLING(identifierPackage)
|
|
50
55
|
Absolute path to the installed package directory. Automatically resolved from
|
|
51
56
|
`identifierPackage` if not provided.
|
|
@@ -279,9 +279,8 @@ def writePython(pythonSource: str, pathFilename: PathLike[Any] | PurePath | Text
|
|
|
279
279
|
|
|
280
280
|
You can use this function to normalize Python imports and then send the resulting source code to a
|
|
281
281
|
file path or open text stream. `autoflake` [1] removes unused imports, `isort` [2] sorts the
|
|
282
|
-
remaining imports, and `pathFilename` receives the formatted source code
|
|
283
|
-
|
|
284
|
-
line.
|
|
282
|
+
remaining imports, and `pathFilename` receives the formatted source code ending with exactly one
|
|
283
|
+
line feed: trailing line feeds are removed and one is added.
|
|
285
284
|
|
|
286
285
|
Parameters
|
|
287
286
|
----------
|
|
@@ -337,7 +336,7 @@ def writePython(pythonSource: str, pathFilename: PathLike[Any] | PurePath | Text
|
|
|
337
336
|
|
|
338
337
|
settings_isort: dict[str, Any] = settings.get('isort', settings_isortDEFAULT)
|
|
339
338
|
pythonSource = isort_code(pythonSource, **settings_isort)
|
|
340
|
-
return writeStringToHere(pythonSource + '\n', pathFilename)
|
|
339
|
+
return writeStringToHere(pythonSource.rstrip('\n') + '\n', pathFilename)
|
|
341
340
|
|
|
342
341
|
@overload
|
|
343
342
|
def writeStringToHere(this: str, pathFilename: PathLike[Any] | PurePath) -> Path: ...
|
|
@@ -374,11 +373,9 @@ def writeStringToHere(this: str, pathFilename: PathLike[Any] | PurePath | TextIO
|
|
|
374
373
|
|
|
375
374
|
File Replacement
|
|
376
375
|
----------------
|
|
377
|
-
A path destination replaces any existing file.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
function. A failure to create a parent
|
|
381
|
-
directory is silent, but a failure to write the file raises the corresponding `OSError`.
|
|
376
|
+
A path destination replaces any existing file. Newline characters in `this` are written without
|
|
377
|
+
translation, so a line feed remains a line feed on every operating system. A failure to create a
|
|
378
|
+
parent directory is silent, but a failure to write the file raises the corresponding `OSError`.
|
|
382
379
|
|
|
383
380
|
Examples
|
|
384
381
|
--------
|
|
@@ -398,5 +395,5 @@ def writeStringToHere(this: str, pathFilename: PathLike[Any] | PurePath | TextIO
|
|
|
398
395
|
pathFilename = Path(pathFilename)
|
|
399
396
|
makeDirectorySafely(pathFilename)
|
|
400
397
|
#pyrefly: ignore[unnecessary-type-conversion] #=SIN= Insurance.
|
|
401
|
-
pathFilename.write_text(str(this), encoding='utf-8')
|
|
398
|
+
pathFilename.write_text(str(this), encoding='utf-8', newline='')
|
|
402
399
|
return pathFilename
|
|
@@ -3,6 +3,14 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
boxOfIdentifiersPackageAbsent: tuple[str, ...] = ('astToolkit', 'mapFolding')
|
|
5
5
|
|
|
6
|
+
boxOfIdentifiersDistributionInstalled: tuple[str, ...] = ('hunterMakesPy', 'numpy', 'pytest')
|
|
7
|
+
"""Identifiers of importable packages whose installed distribution has the identifier as its metadata `Name`.
|
|
8
|
+
|
|
9
|
+
(AI generated docstring)
|
|
10
|
+
|
|
11
|
+
`hunterMakesPy` is an editable installation, and `numpy` and `pytest` are installations from a wheel.
|
|
12
|
+
"""
|
|
13
|
+
|
|
6
14
|
lookupIdentifiersPackageInstalled: dict[str, str] = {
|
|
7
15
|
'fractions': 'fractions',
|
|
8
16
|
'hunterMakesPy': 'hunterMakesPy',
|
|
@@ -6,22 +6,25 @@ from hunterMakesPy.coping import _getIdentifierPackagePACKAGING, _getPathPackage
|
|
|
6
6
|
from hunterMakesPy.tests import assertEqualTo
|
|
7
7
|
from hunterMakesPy.tests.dataSamples.arrays import arrayRange
|
|
8
8
|
from hunterMakesPy.tests.dataSamples.messages import messageHostMissing
|
|
9
|
-
from hunterMakesPy.tests.dataSamples.packages import
|
|
9
|
+
from hunterMakesPy.tests.dataSamples.packages import (
|
|
10
|
+
boxOfIdentifiersDistributionInstalled, boxOfIdentifiersPackageAbsent, lookupIdentifiersPackageInstalled)
|
|
10
11
|
from hunterMakesPy.tests.dataSamples.pyprojects import tomlProjectMalformed, tomlProjectNamed, tomlProjectNameEmpty, tomlProjectNameless
|
|
12
|
+
from itertools import repeat
|
|
11
13
|
from pathlib import Path
|
|
12
14
|
import importlib.resources
|
|
13
15
|
import pytest
|
|
14
16
|
import re as regex
|
|
15
17
|
|
|
16
|
-
@pytest.mark.parametrize('identifierPackageFALLBACK',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
18
|
+
@pytest.mark.parametrize('identifierPackageFALLBACK, expected', (
|
|
19
|
+
*zip(boxOfIdentifiersPackageAbsent, repeat('cobraPy')),
|
|
20
|
+
*zip(boxOfIdentifiersDistributionInstalled, boxOfIdentifiersDistributionInstalled, strict=True),
|
|
21
|
+
))
|
|
22
|
+
@pytest.mark.parametrize('pathWorkingDirectory', [tomlProjectNamed], indirect=True, ids=['tomlProjectNamed'])
|
|
20
23
|
def test_getIdentifierPackagePACKAGING(pathWorkingDirectory: Path, identifierPackageFALLBACK: str, expected: str) -> None:
|
|
21
|
-
"""Reference: the `project.name` that `tomlProjectNamed` states."""
|
|
24
|
+
"""Reference: the `project.name` that `tomlProjectNamed` states, or, for `boxOfIdentifiersDistributionInstalled`, the metadata `Name` that its docstring states."""
|
|
22
25
|
assertEqualTo(_getIdentifierPackagePACKAGING(identifierPackageFALLBACK), expected, _getIdentifierPackagePACKAGING.__name__, identifierPackageFALLBACK, pathWorkingDirectory=pathWorkingDirectory)
|
|
23
26
|
|
|
24
|
-
@pytest.mark.parametrize('identifierPackageFALLBACK', boxOfIdentifiersPackageAbsent)
|
|
27
|
+
@pytest.mark.parametrize('identifierPackageFALLBACK', (*boxOfIdentifiersPackageAbsent, *boxOfIdentifiersDistributionInstalled))
|
|
25
28
|
@pytest.mark.parametrize('pathWorkingDirectory', (
|
|
26
29
|
pytest.param(None, id='pyprojectAbsent'),
|
|
27
30
|
pytest.param(tomlProjectMalformed, id='tomlProjectMalformed'),
|
|
@@ -28,37 +28,37 @@ markParametrizeTexts: pytest.MarkDecorator = pytest.mark.parametrize('this', (
|
|
|
28
28
|
))
|
|
29
29
|
|
|
30
30
|
markParametrizeWritePython: pytest.MarkDecorator = pytest.mark.parametrize('pythonSource, settings, expected', (
|
|
31
|
-
pytest.param(sourceImportsUnused, None, '\nfibonacci = 13\n
|
|
32
|
-
pytest.param(sourceImportsUnused, {}, '\nfibonacci = 13\n
|
|
33
|
-
pytest.param(sourceImportsUnused, (settingsAutoflakeKeepImports := {'autoflake': {'remove_all_unused_imports': False}}), '\nfibonacci = 13\n
|
|
34
|
-
pytest.param(sourceImportsUnused, (settingsIsortDefaultProfile := {'isort': dict[str, Any]()}), '\nfibonacci = 13\n
|
|
35
|
-
pytest.param(sourceImportsUnused, (settingsFormatters := settingsAutoflakeKeepImports | settingsIsortDefaultProfile), '\nfibonacci = 13\n
|
|
36
|
-
pytest.param(sourceImportsUsed, None, sourceImportsUsed
|
|
37
|
-
pytest.param(sourceImportsUsed, {}, sourceImportsUsed
|
|
38
|
-
pytest.param(sourceImportsUsed, settingsAutoflakeKeepImports, sourceImportsUsed
|
|
39
|
-
pytest.param(sourceImportsUsed, settingsIsortDefaultProfile, sourceImportsUsed
|
|
40
|
-
pytest.param(sourceImportsUsed, settingsFormatters, sourceImportsUsed
|
|
41
|
-
pytest.param(sourceImportsUnusedThirdParty, None, '\nfibonacci = 21\n
|
|
42
|
-
pytest.param(sourceImportsUnusedThirdParty, {}, '\nfibonacci = 21\n
|
|
43
|
-
pytest.param(sourceImportsUnusedThirdParty, settingsAutoflakeKeepImports, 'import numpy\n\nfibonacci = 21\n
|
|
44
|
-
pytest.param(sourceImportsUnusedThirdParty, settingsIsortDefaultProfile, '\nfibonacci = 21\n
|
|
45
|
-
pytest.param(sourceImportsUnusedThirdParty, settingsFormatters, 'import numpy\n\nfibonacci = 21\n
|
|
31
|
+
pytest.param(sourceImportsUnused, None, '\nfibonacci = 13\n', id='sourceImportsUnused-None'),
|
|
32
|
+
pytest.param(sourceImportsUnused, {}, '\nfibonacci = 13\n', id='sourceImportsUnused-settingsEmpty'),
|
|
33
|
+
pytest.param(sourceImportsUnused, (settingsAutoflakeKeepImports := {'autoflake': {'remove_all_unused_imports': False}}), '\nfibonacci = 13\n', id='sourceImportsUnused-settingsAutoflakeKeepImports'),
|
|
34
|
+
pytest.param(sourceImportsUnused, (settingsIsortDefaultProfile := {'isort': dict[str, Any]()}), '\nfibonacci = 13\n', id='sourceImportsUnused-settingsIsortDefaultProfile'),
|
|
35
|
+
pytest.param(sourceImportsUnused, (settingsFormatters := settingsAutoflakeKeepImports | settingsIsortDefaultProfile), '\nfibonacci = 13\n', id='sourceImportsUnused-settingsFormatters'),
|
|
36
|
+
pytest.param(sourceImportsUsed, None, sourceImportsUsed, id='sourceImportsUsed-None'),
|
|
37
|
+
pytest.param(sourceImportsUsed, {}, sourceImportsUsed, id='sourceImportsUsed-settingsEmpty'),
|
|
38
|
+
pytest.param(sourceImportsUsed, settingsAutoflakeKeepImports, sourceImportsUsed, id='sourceImportsUsed-settingsAutoflakeKeepImports'),
|
|
39
|
+
pytest.param(sourceImportsUsed, settingsIsortDefaultProfile, sourceImportsUsed, id='sourceImportsUsed-settingsIsortDefaultProfile'),
|
|
40
|
+
pytest.param(sourceImportsUsed, settingsFormatters, sourceImportsUsed, id='sourceImportsUsed-settingsFormatters'),
|
|
41
|
+
pytest.param(sourceImportsUnusedThirdParty, None, '\nfibonacci = 21\n', id='sourceImportsUnusedThirdParty-None'),
|
|
42
|
+
pytest.param(sourceImportsUnusedThirdParty, {}, '\nfibonacci = 21\n', id='sourceImportsUnusedThirdParty-settingsEmpty'),
|
|
43
|
+
pytest.param(sourceImportsUnusedThirdParty, settingsAutoflakeKeepImports, 'import numpy\n\nfibonacci = 21\n', id='sourceImportsUnusedThirdParty-settingsAutoflakeKeepImports'),
|
|
44
|
+
pytest.param(sourceImportsUnusedThirdParty, settingsIsortDefaultProfile, '\nfibonacci = 21\n', id='sourceImportsUnusedThirdParty-settingsIsortDefaultProfile'),
|
|
45
|
+
pytest.param(sourceImportsUnusedThirdParty, settingsFormatters, 'import numpy\n\nfibonacci = 21\n', id='sourceImportsUnusedThirdParty-settingsFormatters'),
|
|
46
46
|
pytest.param(sourceImportsUnsorted, None, (sourceIsortProject := (
|
|
47
47
|
"from pathlib import PurePosixPath\nimport collections\nimport math\n\n"
|
|
48
|
-
"primes = collections.Counter([2, 3, 3, 5])\nnorth = PurePosixPath('north')\ntau = math.tau\n
|
|
48
|
+
"primes = collections.Counter([2, 3, 3, 5])\nnorth = PurePosixPath('north')\ntau = math.tau\n"
|
|
49
49
|
)), id='sourceImportsUnsorted-None'),
|
|
50
50
|
pytest.param(sourceImportsUnsorted, {}, sourceIsortProject, id='sourceImportsUnsorted-settingsEmpty'),
|
|
51
51
|
pytest.param(sourceImportsUnsorted, settingsAutoflakeKeepImports, sourceIsortProject, id='sourceImportsUnsorted-settingsAutoflakeKeepImports'),
|
|
52
52
|
pytest.param(sourceImportsUnsorted, settingsIsortDefaultProfile, (sourceIsortDefault := (
|
|
53
53
|
"import collections\nimport math\nfrom pathlib import PurePosixPath\n\n"
|
|
54
|
-
"primes = collections.Counter([2, 3, 3, 5])\nnorth = PurePosixPath('north')\ntau = math.tau\n
|
|
54
|
+
"primes = collections.Counter([2, 3, 3, 5])\nnorth = PurePosixPath('north')\ntau = math.tau\n"
|
|
55
55
|
)), id='sourceImportsUnsorted-settingsIsortDefaultProfile'),
|
|
56
56
|
pytest.param(sourceImportsUnsorted, settingsFormatters, sourceIsortDefault, id='sourceImportsUnsorted-settingsFormatters'),
|
|
57
57
|
))
|
|
58
58
|
"""Reference: the docstring of `writePython`, and the documentation of autoflake and isort.
|
|
59
59
|
|
|
60
60
|
autoflake removes an unused standard-library import even when `remove_all_unused_imports` is `False`. Each formatter reads
|
|
61
|
-
only its own settings, and `writePython`
|
|
61
|
+
only its own settings, and `writePython` ends the formatted source with exactly one line feed.
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
64
|
@markParametrizeTexts
|
|
@@ -146,7 +146,7 @@ def test_makeDirectorySafelyStream(pathFilename: io.BytesIO | io.StringIO, expec
|
|
|
146
146
|
def test_writePython(tmp_path: Path, pythonSource: str, settings: dict[str, dict[str, Any]] | None, expected: str) -> None:
|
|
147
147
|
pathFilename: Path = tmp_path / 'north' / 'moduleWritten.py'
|
|
148
148
|
assertEqualTo(writePython(pythonSource, pathFilename, settings), pathFilename, writePython.__name__, pythonSource, pathFilename, settings)
|
|
149
|
-
assertEqualTo(pathFilename.
|
|
149
|
+
assertEqualTo(pathFilename.read_bytes(), expected.encode('utf-8'), writePython.__name__, pythonSource, pathFilename, settings)
|
|
150
150
|
|
|
151
151
|
@markParametrizeWritePython
|
|
152
152
|
def test_writePythonStream(pythonSource: str, settings: dict[str, dict[str, Any]] | None, expected: str) -> None:
|
|
@@ -158,7 +158,7 @@ def test_writePythonStream(pythonSource: str, settings: dict[str, dict[str, Any]
|
|
|
158
158
|
def test_writeStringToHere(tmp_path: Path, this: str) -> None:
|
|
159
159
|
pathFilename: Path = tmp_path / 'north' / 'east' / 'written.txt'
|
|
160
160
|
assertEqualTo(writeStringToHere(this, pathFilename), pathFilename, writeStringToHere.__name__, this, pathFilename)
|
|
161
|
-
assertEqualTo(pathFilename.
|
|
161
|
+
assertEqualTo(pathFilename.read_bytes(), this.encode('utf-8'), writeStringToHere.__name__, this, pathFilename)
|
|
162
162
|
|
|
163
163
|
@markParametrizeTexts
|
|
164
164
|
def test_writeStringToHereStream(this: str) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterMakesPy
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.3
|
|
4
4
|
Summary: Easy Python functions making making functional Python functions easier.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
License-Expression: CC-BY-NC-4.0
|
|
@@ -32,14 +32,9 @@ Requires-Dist: isort
|
|
|
32
32
|
Requires-Dist: more_itertools
|
|
33
33
|
Requires-Dist: numpy>=2.0
|
|
34
34
|
Requires-Dist: typing_extensions>=4.10.0
|
|
35
|
-
Provides-Extra: development
|
|
36
|
-
Requires-Dist: pytest-cov; extra == "development"
|
|
37
|
-
Provides-Extra: testing
|
|
38
|
-
Requires-Dist: hypothesis; extra == "testing"
|
|
39
|
-
Requires-Dist: pytest>=9.0; extra == "testing"
|
|
40
|
-
Requires-Dist: pytest-xdist; extra == "testing"
|
|
41
35
|
Dynamic: license-file
|
|
42
36
|
|
|
37
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
43
38
|
# hunterMakesPy
|
|
44
39
|
|
|
45
40
|
Utilities for converting mixed input to integers, calculating CPU limits, handling None values, importing code dynamically, and manipulating nested data.
|
|
@@ -164,6 +159,8 @@ encoded = autoDecodingRLE(arrayTarget)
|
|
|
164
159
|
## Configure Package Metadata at Runtime
|
|
165
160
|
|
|
166
161
|
`PackageSettings` reads `pyproject.toml` automatically to resolve the package name and installation path.
|
|
162
|
+
For an installed package, `PackageSettings` reads the name that packaging copied from `pyproject.toml`
|
|
163
|
+
into the package's metadata, so the `pyproject.toml` in the current working directory cannot change it.
|
|
167
164
|
|
|
168
165
|
```python
|
|
169
166
|
from hunterMakesPy import PackageSettings
|
|
@@ -181,14 +178,15 @@ from hunterMakesPy.tests import assertEqualTo
|
|
|
181
178
|
assertEqualTo(intInnit(["8080", 443]), [8080, 443], intInnit.__name__, ["8080", 443])
|
|
182
179
|
```
|
|
183
180
|
|
|
181
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
184
182
|
## My recovery
|
|
185
183
|
|
|
186
|
-
[](https://HunterThinks.com/support)
|
|
185
|
+

|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
By law, authors retain their copyrights unless they grant exceptions. The [Attribution-NonCommercial 4.0 International Deed](https://github.com/hunterhogan/hunterMakesPy#License-1-ov-file) outlines how you may use this work.
|
|
187
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
191
188
|
|
|
192
189
|
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
193
190
|
|
|
194
191
|
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
192
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# path-sync copy -n hunterhogan
|
|
2
|
+
[project]
|
|
3
|
+
name = "hunterMakesPy"
|
|
4
|
+
version = "0.10.3"
|
|
5
|
+
description = "Easy Python functions making making functional Python functions easier."
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
requires-python = ">=3.12"
|
|
8
|
+
license = "CC-BY-NC-4.0"
|
|
9
|
+
authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
10
|
+
keywords = [
|
|
11
|
+
"input validation",
|
|
12
|
+
"module loading",
|
|
13
|
+
"package settings",
|
|
14
|
+
"parameter validation",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Framework :: Pytest",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"Natural Language :: English",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Programming Language :: Python",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.15",
|
|
26
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
27
|
+
"Topic :: Utilities",
|
|
28
|
+
"Typing :: Typed",
|
|
29
|
+
]
|
|
30
|
+
dependencies = ["Z0Z_tools>=4.1.1", "autoflake", "charset_normalizer", "isort", "more_itertools", "numpy>=2.0", "typing_extensions>=4.10.0"]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Documentation = "https://context7.com/hunterhogan/huntermakespy"
|
|
34
|
+
Donate = "https://www.patreon.com/integrated"
|
|
35
|
+
Homepage = "https://github.com/hunterhogan/hunterMakesPy"
|
|
36
|
+
Issues = "https://github.com/hunterhogan/hunterMakesPy/issues"
|
|
37
|
+
Repository = "https://github.com/hunterhogan/hunterMakesPy"
|
|
38
|
+
|
|
39
|
+
[dependency-groups]
|
|
40
|
+
development = ["pytest-cov", { include-group = "testing" }]
|
|
41
|
+
testing = ["hypothesis", "pytest>=9.0", "pytest-xdist"]
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["setuptools>=77.0.1"]
|
|
45
|
+
build-backend = "setuptools.build_meta"
|
|
46
|
+
|
|
47
|
+
[tool.coverage]
|
|
48
|
+
report = { exclude_also = [
|
|
49
|
+
"@overload",
|
|
50
|
+
"^\\s*\\.\\.\\.$",
|
|
51
|
+
"if __name__ == \"__main__\":",
|
|
52
|
+
"if TYPE_CHECKING:",
|
|
53
|
+
], ignore_errors = false }
|
|
54
|
+
run = { branch = true, data_file = "hunterMakesPy/tests/coverage/.coverage", omit = ["hunterMakesPy/tests/*"], source = ["."] }
|
|
55
|
+
|
|
56
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
57
|
+
[tool.isort]
|
|
58
|
+
add_imports = ["from __future__ import annotations"]
|
|
59
|
+
append_only = true
|
|
60
|
+
atomic = true
|
|
61
|
+
combine_as_imports = true
|
|
62
|
+
extend_skip_glob = ["*.pyi"]
|
|
63
|
+
filter_files = true
|
|
64
|
+
force_alphabetical_sort_within_sections = true
|
|
65
|
+
from_first = true
|
|
66
|
+
honor_noqa = true
|
|
67
|
+
indent = "\t"
|
|
68
|
+
line_length = 140
|
|
69
|
+
lines_after_imports = 1
|
|
70
|
+
lines_between_types = 0
|
|
71
|
+
multi_line_output = 4
|
|
72
|
+
no_sections = true
|
|
73
|
+
skip_gitignore = true
|
|
74
|
+
use_parentheses = true
|
|
75
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
76
|
+
|
|
77
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
78
|
+
[tool.pyrefly]
|
|
79
|
+
enabled-ignores = ["pyrefly"]
|
|
80
|
+
# ignore-errors-in-generated-code = true
|
|
81
|
+
infer-with-first-use = false
|
|
82
|
+
preset = "strict"
|
|
83
|
+
python-platform = "all"
|
|
84
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
85
|
+
|
|
86
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
87
|
+
[tool.pyrefly.errors]
|
|
88
|
+
bad-return = "warn"
|
|
89
|
+
invalid-yield = "warn"
|
|
90
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
91
|
+
|
|
92
|
+
[tool.pytest]
|
|
93
|
+
addopts = ["--color=yes"]
|
|
94
|
+
empty_parameter_set_mark = "fail_at_collect"
|
|
95
|
+
filterwarnings = ["error"]
|
|
96
|
+
log_auto_indent = "On"
|
|
97
|
+
minversion = "9.0"
|
|
98
|
+
strict = true
|
|
99
|
+
testpaths = ["hunterMakesPy/tests"]
|
|
100
|
+
|
|
101
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
102
|
+
[tool.ruff]
|
|
103
|
+
line-length = 140
|
|
104
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
105
|
+
|
|
106
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
107
|
+
[tool.ruff.lint]
|
|
108
|
+
allowed-confusables = ["–", "’", "′", "×", "−", "∖", "∗", "∣", "∨", "∪", "∼", "⊗", "ℂ", "ℋ", "ℒ", "ℓ", "ℕ", "ℙ", "ℚ", "ℝ", "ℤ", "ℰ", "ℱ", "𝒪", "𝒮", "𝔼", "𝕀", "𝟙", "α", "Β", "γ", "ι", "Κ", "ν", "ο", "ρ", "σ"]
|
|
109
|
+
future-annotations = true
|
|
110
|
+
ignore = [
|
|
111
|
+
# ====== Linters ===========
|
|
112
|
+
"FIX", # flake8-fixme
|
|
113
|
+
"I", # isort
|
|
114
|
+
"N", # pep8-naming
|
|
115
|
+
"TD", # flake8-todos
|
|
116
|
+
# ====== complexity ========
|
|
117
|
+
"dict-index-missing-items",
|
|
118
|
+
"explicit-f-string-type-conversion",
|
|
119
|
+
"non-pep695-type-alias",
|
|
120
|
+
"redundant-numeric-union",
|
|
121
|
+
"static-join-to-f-string",
|
|
122
|
+
"unnecessary-literal-dict",
|
|
123
|
+
"useless-import-alias",
|
|
124
|
+
# ====== correctness =======
|
|
125
|
+
"unused-variable",
|
|
126
|
+
# ====== formatting ========
|
|
127
|
+
"bad-quotes-inline-string",
|
|
128
|
+
"blank-lines-after-function-or-class",
|
|
129
|
+
"blank-lines-top-level",
|
|
130
|
+
"docstring-tab-indentation",
|
|
131
|
+
"incorrect-blank-line-after-class",
|
|
132
|
+
"line-too-long",
|
|
133
|
+
"missing-newline-at-end-of-file",
|
|
134
|
+
"missing-trailing-comma",
|
|
135
|
+
"no-space-after-block-comment",
|
|
136
|
+
"tab-indentation",
|
|
137
|
+
"too-many-blank-lines",
|
|
138
|
+
# ====== pedantic ==========
|
|
139
|
+
"any-type",
|
|
140
|
+
"blanket-noqa",
|
|
141
|
+
"docstring-in-stub",
|
|
142
|
+
"docstring-missing-exception",
|
|
143
|
+
"docstring-missing-returns",
|
|
144
|
+
"docstring-missing-yields",
|
|
145
|
+
"if-else-block-instead-of-if-exp",
|
|
146
|
+
"incorrect-section-order",
|
|
147
|
+
"magic-value-comparison",
|
|
148
|
+
"missing-copyright-notice",
|
|
149
|
+
"missing-trailing-period",
|
|
150
|
+
"non-ascii-import-name",
|
|
151
|
+
"non-ascii-name",
|
|
152
|
+
"non-imperative-mood",
|
|
153
|
+
"redefined-loop-name",
|
|
154
|
+
"superfluous-else-continue",
|
|
155
|
+
"superfluous-else-return",
|
|
156
|
+
"too-many-arguments",
|
|
157
|
+
"too-many-branches",
|
|
158
|
+
"too-many-locals",
|
|
159
|
+
"too-many-nested-blocks",
|
|
160
|
+
"too-many-positional-arguments",
|
|
161
|
+
"too-many-public-methods",
|
|
162
|
+
"too-many-statements",
|
|
163
|
+
"typed-argument-default-in-stub",
|
|
164
|
+
"yoda-conditions",
|
|
165
|
+
# ====== restriction =======
|
|
166
|
+
"complex-structure",
|
|
167
|
+
# ====== security ==========
|
|
168
|
+
"subprocess-without-shell-equals-true",
|
|
169
|
+
"suspicious-pickle-import",
|
|
170
|
+
# ====== style =============
|
|
171
|
+
"snake-case-type-alias",
|
|
172
|
+
"type-name-incorrect-variance",
|
|
173
|
+
# ====== suspicious ========
|
|
174
|
+
"self-or-cls-assignment",
|
|
175
|
+
"subclass-builtin",
|
|
176
|
+
"unused-import",
|
|
177
|
+
"useless-else-on-loop",
|
|
178
|
+
]
|
|
179
|
+
preview = true
|
|
180
|
+
select = ["ALL"]
|
|
181
|
+
extend-select = ["missing-terminal-punctuation", "undocumented-param", "undocumented-public-init"]
|
|
182
|
+
task-tags = ["DEVELOPMENT", "FailEarly", "NOTE", "SEMIOTICS", "TODO"]
|
|
183
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
184
|
+
|
|
185
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
186
|
+
[tool.ruff.lint.flake8-comprehensions]
|
|
187
|
+
allow-dict-calls-with-keyword-arguments = true
|
|
188
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
189
|
+
|
|
190
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
191
|
+
[tool.ruff.lint.flake8-import-conventions]
|
|
192
|
+
banned-aliases = { altair = ["alt"], datetime = ["dt"], holoviews = ["hv"], matplotlib = ["mpl"], "matplotlib.pyplot" = ["plt"], networkx = ["nx"], numpy = ["np"], "numpy.typing" = ["npt"], optype = ["op"], pandas = ["pd"], panel = ["pn"], "plotly.express" = ["px"], polars = ["pl"], pyarrow = ["pa"], regex = ["re"], seaborn = ["sns"], tensorflow = ["tf"], tkinter = ["tk"], "xml.etree.ElementTree" = ["ET"] }
|
|
193
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
194
|
+
|
|
195
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
196
|
+
[tool.ruff.lint.flake8-import-conventions.aliases]
|
|
197
|
+
"accelerate.utils.dataclasses" = "accelerate_dataclasses"
|
|
198
|
+
"fs.path" = "fs_path"
|
|
199
|
+
"gmpy2.bit_test" = "isBit1吗"
|
|
200
|
+
"gmpy2.is_even" = "isEven吗"
|
|
201
|
+
"gmpy2.is_odd" = "isOdd吗"
|
|
202
|
+
"humpy_cytoolz.assoc" = "associateKeyValue"
|
|
203
|
+
"humpy_cytoolz.curry" = "syntacticCurry"
|
|
204
|
+
"humpy_cytoolz.groupby" = "toolz_groupby"
|
|
205
|
+
"itertools.product" = "CartesianProduct"
|
|
206
|
+
"math.comb" = "nCr"
|
|
207
|
+
"more_itertools.all_unique" = "allUnique吗"
|
|
208
|
+
"regex" = "regex"
|
|
209
|
+
"scipy" = "scipy"
|
|
210
|
+
"sympy.binomial" = "sympy_binomial"
|
|
211
|
+
"sympy.catalan" = "sympy_catalan"
|
|
212
|
+
"sympy.functions.combinatorial.factorials.binomial" = "sympy_binomial"
|
|
213
|
+
"sympy.functions.combinatorial.numbers.catalan" = "sympy_catalan"
|
|
214
|
+
"sympy" = "sympy"
|
|
215
|
+
"torch.autograd.grad" = "torch_grad"
|
|
216
|
+
"torch.nn.functional" = "F"
|
|
217
|
+
"torch.nn.parallel.DistributedDataParallel" = "DDP"
|
|
218
|
+
numpy = "numpy"
|
|
219
|
+
pandas = "pandas"
|
|
220
|
+
polars = "polars"
|
|
221
|
+
re = "regex"
|
|
222
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
223
|
+
|
|
224
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
225
|
+
[tool.ruff.lint.flake8-quotes]
|
|
226
|
+
inline-quotes = "single"
|
|
227
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
228
|
+
|
|
229
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
230
|
+
[tool.ruff.lint.per-file-ignores]
|
|
231
|
+
"**/*_test.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
232
|
+
"**/conftest*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
233
|
+
"**/test_*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
234
|
+
"**/tests/**" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
235
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
236
|
+
|
|
237
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
238
|
+
[tool.ruff.lint.pydocstyle]
|
|
239
|
+
convention = "numpy"
|
|
240
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
241
|
+
|
|
242
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
243
|
+
[tool.ruff.format]
|
|
244
|
+
docstring-code-format = true
|
|
245
|
+
indent-style = "tab"
|
|
246
|
+
line-ending = "lf"
|
|
247
|
+
nested-string-quote-style = "preferred"
|
|
248
|
+
quote-style = "single"
|
|
249
|
+
skip-magic-trailing-comma = true
|
|
250
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
251
|
+
|
|
252
|
+
[tool.setuptools]
|
|
253
|
+
package-data = { "*" = ["py.typed"] }
|
|
254
|
+
packages = ["hunterMakesPy", "hunterMakesPy.tests", "hunterMakesPy.tests.dataSamples"]
|
|
255
|
+
|
|
256
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
257
|
+
[tool.tombi.format.rules]
|
|
258
|
+
line-ending = "lf"
|
|
259
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
260
|
+
|
|
261
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
262
|
+
[tool.ty.analysis]
|
|
263
|
+
respect-type-ignore-comments = false
|
|
264
|
+
return-type-inference = "always"
|
|
265
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
266
|
+
|
|
267
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
268
|
+
[tool.ty.environment]
|
|
269
|
+
extra-paths = ["./typings"]
|
|
270
|
+
python-platform = "all"
|
|
271
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
272
|
+
|
|
273
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
274
|
+
[tool.ty.rules]
|
|
275
|
+
blanket-ignore-comment = "error"
|
|
276
|
+
missing-override-decorator = "error"
|
|
277
|
+
missing-type-argument = "error"
|
|
278
|
+
possibly-missing-attribute = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
|
|
279
|
+
possibly-unresolved-reference = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
|
|
280
|
+
truthiness-test-of-none-union = "warn" # Might annoy you: flags `if value:` on `int | None` or `str | None` even when treating 0 or '' like None is deliberate.
|
|
281
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
282
|
+
|
|
283
|
+
[tool.updateCitation]
|
|
284
|
+
filenameCitationDOTcff = "CITATION.cff"
|
|
285
|
+
pathFilenameCitationSSOT = "citations/CITATION.cff"
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "hunterMakesPy"
|
|
3
|
-
version = "0.10.1"
|
|
4
|
-
description = "Easy Python functions making making functional Python functions easier."
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.12"
|
|
7
|
-
license = "CC-BY-NC-4.0"
|
|
8
|
-
authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
9
|
-
keywords = [
|
|
10
|
-
"input validation",
|
|
11
|
-
"module loading",
|
|
12
|
-
"package settings",
|
|
13
|
-
"parameter validation",
|
|
14
|
-
]
|
|
15
|
-
classifiers = [
|
|
16
|
-
"Development Status :: 5 - Production/Stable",
|
|
17
|
-
"Environment :: Console",
|
|
18
|
-
"Framework :: Pytest",
|
|
19
|
-
"Intended Audience :: Developers",
|
|
20
|
-
"Natural Language :: English",
|
|
21
|
-
"Operating System :: OS Independent",
|
|
22
|
-
"Programming Language :: Python",
|
|
23
|
-
"Programming Language :: Python :: 3.12",
|
|
24
|
-
"Programming Language :: Python :: 3.15",
|
|
25
|
-
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
-
"Topic :: Utilities",
|
|
27
|
-
"Typing :: Typed",
|
|
28
|
-
]
|
|
29
|
-
dependencies = [
|
|
30
|
-
"Z0Z_tools>=4.1.1",
|
|
31
|
-
"autoflake",
|
|
32
|
-
"charset_normalizer",
|
|
33
|
-
"isort",
|
|
34
|
-
"more_itertools",
|
|
35
|
-
"numpy>=2.0",
|
|
36
|
-
"typing_extensions>=4.10.0"
|
|
37
|
-
]
|
|
38
|
-
optional-dependencies = { development = ["pytest-cov"], testing = [
|
|
39
|
-
"hypothesis",
|
|
40
|
-
"pytest>=9.0",
|
|
41
|
-
"pytest-xdist"
|
|
42
|
-
] }
|
|
43
|
-
|
|
44
|
-
[project.urls]
|
|
45
|
-
Documentation = "https://context7.com/hunterhogan/huntermakespy"
|
|
46
|
-
Donate = "https://www.patreon.com/integrated"
|
|
47
|
-
Homepage = "https://github.com/hunterhogan/hunterMakesPy"
|
|
48
|
-
Issues = "https://github.com/hunterhogan/hunterMakesPy/issues"
|
|
49
|
-
Repository = "https://github.com/hunterhogan/hunterMakesPy"
|
|
50
|
-
|
|
51
|
-
[build-system]
|
|
52
|
-
requires = ["setuptools"]
|
|
53
|
-
build-backend = "setuptools.build_meta"
|
|
54
|
-
|
|
55
|
-
[tool.coverage]
|
|
56
|
-
report = { exclude_also = [
|
|
57
|
-
"@overload",
|
|
58
|
-
"^\\s*\\.\\.\\.$",
|
|
59
|
-
"if __name__ == \"__main__\":",
|
|
60
|
-
"if TYPE_CHECKING:",
|
|
61
|
-
], ignore_errors = false }
|
|
62
|
-
run = { branch = true, data_file = "hunterMakesPy/tests/coverage/.coverage", omit = [
|
|
63
|
-
"hunterMakesPy/tests/*"
|
|
64
|
-
], source = ["."] }
|
|
65
|
-
|
|
66
|
-
[tool.pytest]
|
|
67
|
-
addopts = ["--color=yes"]
|
|
68
|
-
empty_parameter_set_mark = "fail_at_collect"
|
|
69
|
-
filterwarnings = ["error"]
|
|
70
|
-
log_auto_indent = "On"
|
|
71
|
-
minversion = "9.0"
|
|
72
|
-
strict = true
|
|
73
|
-
testpaths = ["hunterMakesPy/tests"]
|
|
74
|
-
|
|
75
|
-
[tool.setuptools]
|
|
76
|
-
package-data = { "*" = ["py.typed"] }
|
|
77
|
-
packages = ["hunterMakesPy", "hunterMakesPy.tests", "hunterMakesPy.tests.dataSamples"]
|
|
78
|
-
|
|
79
|
-
[tool.updateCitation]
|
|
80
|
-
filenameCitationDOTcff = "CITATION.cff"
|
|
81
|
-
pathFilenameCitationSSOT = "citations/CITATION.cff"
|
|
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
|
{huntermakespy-0.10.1 → huntermakespy-0.10.3}/hunterMakesPy/tests/dataSamples/pythonSource.py
RENAMED
|
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
|