grind-t-toolkit 0.1.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.
- grind_t_toolkit-0.1.0/PKG-INFO +44 -0
- grind_t_toolkit-0.1.0/README.md +35 -0
- grind_t_toolkit-0.1.0/pyproject.toml +42 -0
- grind_t_toolkit-0.1.0/pyproject.toml.orig +35 -0
- grind_t_toolkit-0.1.0/src/toolkit/__init__.py +1 -0
- grind_t_toolkit-0.1.0/src/toolkit/boolean/__init__.py +3 -0
- grind_t_toolkit-0.1.0/src/toolkit/boolean/ensure.py +15 -0
- grind_t_toolkit-0.1.0/src/toolkit/py.typed +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: grind-t-toolkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Natural problem solver's toolkit
|
|
5
|
+
Author: grind-t
|
|
6
|
+
Author-email: grind-t <grindt.gd@gmail.com>
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# grind-t-toolkit
|
|
11
|
+
|
|
12
|
+
Natural problem solver's toolkit.
|
|
13
|
+
Python port of [`@grind-t/toolkit`](https://github.com/grind-t/toolkit).
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
uv add grind-t-toolkit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Structure
|
|
22
|
+
|
|
23
|
+
Utilities are grouped into category subpackages, mirroring the subpath exports
|
|
24
|
+
of the TypeScript package:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from toolkit.array import ...
|
|
28
|
+
from toolkit.string import ...
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Tests live in `tests/<category>/test_<name>.py`. Tests that hit external
|
|
32
|
+
services are marked with `@pytest.mark.e2e`.
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
| Task | Command |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| Format | `uv run ruff format` |
|
|
39
|
+
| Lint | `uv run ruff check --fix` |
|
|
40
|
+
| Type check | `uv run ty check` |
|
|
41
|
+
| Unit tests | `uv run pytest -m "not e2e"` |
|
|
42
|
+
| E2E tests | `uv run pytest -m e2e` |
|
|
43
|
+
| All tests | `uv run pytest` |
|
|
44
|
+
| Build | `uv build` |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# grind-t-toolkit
|
|
2
|
+
|
|
3
|
+
Natural problem solver's toolkit.
|
|
4
|
+
Python port of [`@grind-t/toolkit`](https://github.com/grind-t/toolkit).
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
uv add grind-t-toolkit
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Structure
|
|
13
|
+
|
|
14
|
+
Utilities are grouped into category subpackages, mirroring the subpath exports
|
|
15
|
+
of the TypeScript package:
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from toolkit.array import ...
|
|
19
|
+
from toolkit.string import ...
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Tests live in `tests/<category>/test_<name>.py`. Tests that hit external
|
|
23
|
+
services are marked with `@pytest.mark.e2e`.
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
| Task | Command |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Format | `uv run ruff format` |
|
|
30
|
+
| Lint | `uv run ruff check --fix` |
|
|
31
|
+
| Type check | `uv run ty check` |
|
|
32
|
+
| Unit tests | `uv run pytest -m "not e2e"` |
|
|
33
|
+
| E2E tests | `uv run pytest -m e2e` |
|
|
34
|
+
| All tests | `uv run pytest` |
|
|
35
|
+
| Build | `uv build` |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "grind-t-toolkit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Natural problem solver's toolkit"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = []
|
|
8
|
+
|
|
9
|
+
[[project.authors]]
|
|
10
|
+
name = "grind-t"
|
|
11
|
+
email = "grindt.gd@gmail.com"
|
|
12
|
+
|
|
13
|
+
[build-system]
|
|
14
|
+
requires = ["uv_build>=0.12.9,<0.13.0"]
|
|
15
|
+
build-backend = "uv_build"
|
|
16
|
+
|
|
17
|
+
[tool.uv.build-backend]
|
|
18
|
+
module-name = "toolkit"
|
|
19
|
+
|
|
20
|
+
[tool.pytest.ini_options]
|
|
21
|
+
testpaths = ["tests"]
|
|
22
|
+
addopts = ["--import-mode=importlib"]
|
|
23
|
+
markers = ["e2e: hits external services"]
|
|
24
|
+
|
|
25
|
+
[tool.ruff.lint]
|
|
26
|
+
select = [
|
|
27
|
+
"E",
|
|
28
|
+
"F",
|
|
29
|
+
"I",
|
|
30
|
+
"UP",
|
|
31
|
+
"B",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[tool.ty.environment]
|
|
35
|
+
python-version = "3.10"
|
|
36
|
+
|
|
37
|
+
[dependency-groups]
|
|
38
|
+
dev = [
|
|
39
|
+
"pytest>=9.1.1",
|
|
40
|
+
"ruff>=0.16.10",
|
|
41
|
+
"ty>=0.0.84",
|
|
42
|
+
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "grind-t-toolkit"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Natural problem solver's toolkit"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "grind-t", email = "grindt.gd@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["uv_build>=0.12.9,<0.13.0"]
|
|
14
|
+
build-backend = "uv_build"
|
|
15
|
+
|
|
16
|
+
[tool.uv.build-backend]
|
|
17
|
+
module-name = "toolkit"
|
|
18
|
+
|
|
19
|
+
[tool.pytest.ini_options]
|
|
20
|
+
testpaths = ["tests"]
|
|
21
|
+
addopts = ["--import-mode=importlib"]
|
|
22
|
+
markers = ["e2e: hits external services"]
|
|
23
|
+
|
|
24
|
+
[tool.ruff.lint]
|
|
25
|
+
select = ["E", "F", "I", "UP", "B"]
|
|
26
|
+
|
|
27
|
+
[tool.ty.environment]
|
|
28
|
+
python-version = "3.10"
|
|
29
|
+
|
|
30
|
+
[dependency-groups]
|
|
31
|
+
dev = [
|
|
32
|
+
"pytest>=9.1.1",
|
|
33
|
+
"ruff>=0.16.10",
|
|
34
|
+
"ty>=0.0.84",
|
|
35
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__all__: list[str] = []
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from typing import TypeVar
|
|
2
|
+
|
|
3
|
+
T = TypeVar("T")
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def ensure(value: T | None, message: str = "Expected value to be truthy") -> T:
|
|
7
|
+
"""Return ``value`` if it is truthy, otherwise raise ``ValueError``.
|
|
8
|
+
|
|
9
|
+
Unlike ``assert``, the check is not stripped when Python runs with ``-O``.
|
|
10
|
+
The return type drops ``None``, so the result can be used without extra
|
|
11
|
+
narrowing.
|
|
12
|
+
"""
|
|
13
|
+
if not value:
|
|
14
|
+
raise ValueError(message)
|
|
15
|
+
return value
|
|
File without changes
|