pkn 0.1.0__tar.gz → 0.1.2__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.
- {pkn-0.1.0 → pkn-0.1.2}/LICENSE +1 -1
- {pkn-0.1.0 → pkn-0.1.2}/PKG-INFO +9 -9
- pkn-0.1.2/README.md +14 -0
- pkn-0.1.2/pkn/__init__.py +3 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/common.py +1 -1
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/journalctl.py +1 -1
- pkn-0.1.2/pkn/pydantic/generic.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/pydantic/roots.py +4 -4
- {pkn-0.1.0 → pkn-0.1.2}/pkn/tests/pydantic/test_roots.py +8 -0
- {pkn-0.1.0 → pkn-0.1.2}/pyproject.toml +7 -7
- pkn-0.1.0/README.md +0 -15
- pkn-0.1.0/pkn/__init__.py +0 -1
- {pkn-0.1.0 → pkn-0.1.2}/.gitignore +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/__init__.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/at.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/launchctl.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/reboot.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/infra/systemctl.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/pydantic/__init__.py +0 -0
- {pkn-0.1.0 → pkn-0.1.2}/pkn/tests/test_all.py +0 -0
{pkn-0.1.0 → pkn-0.1.2}/LICENSE
RENAMED
@@ -186,7 +186,7 @@
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright 2024
|
189
|
+
Copyright 2024 the pkn authors
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
{pkn-0.1.0 → pkn-0.1.2}/PKG-INFO
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pkn
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: My Pocket Knife
|
5
|
-
Project-URL: Repository, https://github.com/
|
6
|
-
Project-URL: Homepage, https://github.com/
|
7
|
-
Author-email:
|
5
|
+
Project-URL: Repository, https://github.com/1kbgz/pkn
|
6
|
+
Project-URL: Homepage, https://github.com/1kbgz/pkn
|
7
|
+
Author-email: the pkn authors <t.paine154@gmail.com>
|
8
8
|
License: Apache-2.0
|
9
9
|
License-File: LICENSE
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
@@ -14,10 +14,10 @@ Classifier: Programming Language :: Python :: 3.9
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
17
18
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
18
19
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
19
20
|
Requires-Python: >=3.9
|
20
|
-
Requires-Dist: ccflow
|
21
21
|
Requires-Dist: pydantic
|
22
22
|
Provides-Extra: develop
|
23
23
|
Requires-Dist: build; extra == 'develop'
|
@@ -28,6 +28,7 @@ Requires-Dist: pytest; extra == 'develop'
|
|
28
28
|
Requires-Dist: pytest-cov; extra == 'develop'
|
29
29
|
Requires-Dist: ruff; extra == 'develop'
|
30
30
|
Requires-Dist: twine; extra == 'develop'
|
31
|
+
Requires-Dist: uv; extra == 'develop'
|
31
32
|
Requires-Dist: wheel; extra == 'develop'
|
32
33
|
Description-Content-Type: text/markdown
|
33
34
|
|
@@ -35,11 +36,10 @@ Description-Content-Type: text/markdown
|
|
35
36
|
|
36
37
|
My Pocket Knife
|
37
38
|
|
38
|
-
[](https://github.com/1kbgz/pkn/actions/workflows/build.yml)
|
40
|
+
[](https://codecov.io/gh/1kbgz/pkn)
|
41
|
+
[](https://github.com/1kbgz/pkn)
|
41
42
|
[](https://pypi.python.org/pypi/pkn)
|
42
|
-
[](https://mybinder.org/v2/gh/timkpaine/pkn/main?urlpath=lab)
|
43
43
|
|
44
44
|
## Overview
|
45
45
|
|
pkn-0.1.2/README.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# pkn
|
2
|
+
|
3
|
+
My Pocket Knife
|
4
|
+
|
5
|
+
[](https://github.com/1kbgz/pkn/actions/workflows/build.yml)
|
6
|
+
[](https://codecov.io/gh/1kbgz/pkn)
|
7
|
+
[](https://github.com/1kbgz/pkn)
|
8
|
+
[](https://pypi.python.org/pypi/pkn)
|
9
|
+
|
10
|
+
## Overview
|
11
|
+
|
12
|
+
|
13
|
+
> [!NOTE]
|
14
|
+
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
1
|
-
from typing import Dict as DictType, List as ListType
|
1
|
+
from typing import Dict as DictType, List as ListType, Optional, Union
|
2
2
|
|
3
|
-
from pydantic import BaseModel, RootModel
|
3
|
+
from pydantic import BaseModel, Field, RootModel
|
4
4
|
|
5
5
|
__all__ = ("Dict", "List")
|
6
6
|
|
7
7
|
|
8
8
|
class Dict(RootModel):
|
9
|
-
root: DictType[str, BaseModel]
|
9
|
+
root: Optional[DictType[str, Optional[Union[BaseModel, "Dict", "List", int, float, str]]]] = Field(default_factory=dict)
|
10
10
|
|
11
11
|
def __iter__(self):
|
12
12
|
return iter(self.root)
|
@@ -46,7 +46,7 @@ class Dict(RootModel):
|
|
46
46
|
|
47
47
|
|
48
48
|
class List(RootModel):
|
49
|
-
root: ListType[BaseModel]
|
49
|
+
root: Optional[ListType[Union[BaseModel, "Dict", "List", int, float, str]]] = Field(default_factory=list)
|
50
50
|
|
51
51
|
def __iter__(self):
|
52
52
|
return iter(self.root)
|
@@ -27,6 +27,10 @@ class TestPydanticRoots:
|
|
27
27
|
assert "a" not in d
|
28
28
|
assert "b" not in d
|
29
29
|
|
30
|
+
def test_dict_types(self):
|
31
|
+
d = Dict({"a": MyModel(a=1, b="b"), "b": "abc", "c": 1, "d": 1.2, "e": List(), "f": Dict(), "g": None})
|
32
|
+
assert len(d) == 7
|
33
|
+
|
30
34
|
def test_list(self):
|
31
35
|
lst = List([MyModel(a=1, b="b"), MyModel(a=2, b="c")])
|
32
36
|
assert len(lst) == 2
|
@@ -37,3 +41,7 @@ class TestPydanticRoots:
|
|
37
41
|
del lst[0]
|
38
42
|
assert len(lst) == 1
|
39
43
|
assert lst[0] == MyModel(a=2, b="c")
|
44
|
+
|
45
|
+
def test_list_types(self):
|
46
|
+
d = List([MyModel(a=1, b="b"), "abc", 1, 1.2, List(), Dict(), None])
|
47
|
+
assert len(d) == 7
|
@@ -4,11 +4,11 @@ build-backend="hatchling.build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "pkn"
|
7
|
-
authors = [{name = "
|
7
|
+
authors = [{name = "the pkn authors", email = "t.paine154@gmail.com"}]
|
8
8
|
description = "My Pocket Knife"
|
9
9
|
readme = "README.md"
|
10
10
|
license = { text = "Apache-2.0" }
|
11
|
-
version = "0.1.
|
11
|
+
version = "0.1.2"
|
12
12
|
requires-python = ">=3.9"
|
13
13
|
keywords = []
|
14
14
|
|
@@ -22,10 +22,10 @@ classifiers = [
|
|
22
22
|
"Programming Language :: Python :: 3.10",
|
23
23
|
"Programming Language :: Python :: 3.11",
|
24
24
|
"Programming Language :: Python :: 3.12",
|
25
|
+
"Programming Language :: Python :: 3.13",
|
25
26
|
]
|
26
27
|
|
27
28
|
dependencies = [
|
28
|
-
"ccflow",
|
29
29
|
"pydantic",
|
30
30
|
]
|
31
31
|
|
@@ -39,17 +39,18 @@ develop = [
|
|
39
39
|
"pytest-cov",
|
40
40
|
"ruff",
|
41
41
|
"twine",
|
42
|
+
"uv",
|
42
43
|
"wheel",
|
43
44
|
]
|
44
45
|
|
45
46
|
[project.scripts]
|
46
47
|
|
47
48
|
[project.urls]
|
48
|
-
Repository = "https://github.com/
|
49
|
-
Homepage = "https://github.com/
|
49
|
+
Repository = "https://github.com/1kbgz/pkn"
|
50
|
+
Homepage = "https://github.com/1kbgz/pkn"
|
50
51
|
|
51
52
|
[tool.bumpversion]
|
52
|
-
current_version = "0.1.
|
53
|
+
current_version = "0.1.2"
|
53
54
|
commit = true
|
54
55
|
tag = true
|
55
56
|
|
@@ -100,7 +101,6 @@ packages = ["pkn"]
|
|
100
101
|
|
101
102
|
[tool.pytest.ini_options]
|
102
103
|
addopts = ["-vvv", "--junitxml=junit.xml"]
|
103
|
-
asyncio_mode = "strict"
|
104
104
|
testpaths = "pkn/tests"
|
105
105
|
|
106
106
|
[tool.ruff]
|
pkn-0.1.0/README.md
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# pkn
|
2
|
-
|
3
|
-
My Pocket Knife
|
4
|
-
|
5
|
-
[](https://github.com/timkpaine/pkn/actions/workflows/build.yml)
|
6
|
-
[](https://codecov.io/gh/timkpaine/pkn)
|
7
|
-
[](https://github.com/timkpaine/pkn)
|
8
|
-
[](https://pypi.python.org/pypi/pkn)
|
9
|
-
[](https://mybinder.org/v2/gh/timkpaine/pkn/main?urlpath=lab)
|
10
|
-
|
11
|
-
## Overview
|
12
|
-
|
13
|
-
|
14
|
-
> [!NOTE]
|
15
|
-
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).
|
pkn-0.1.0/pkn/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.1.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|