papertrail 0.1.0__tar.gz → 0.1.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.
- {papertrail-0.1.0 → papertrail-0.1.1}/PKG-INFO +10 -5
- {papertrail-0.1.0 → papertrail-0.1.1}/README.md +9 -4
- {papertrail-0.1.0 → papertrail-0.1.1}/pyproject.toml +7 -1
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/collection/example.py +67 -1
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/__init__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/__main__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/adapters/__init__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/adapters/io_funcs.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/__init__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/collection/__init__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/collection/record.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/collection/recorder.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/logger.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/transformation/__init__.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/transformation/ast_editing.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/transformation/format_examples.py +0 -0
- {papertrail-0.1.0 → papertrail-0.1.1}/src/papertrail/core/transformation/transform.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: papertrail
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author: ed cuss
|
|
6
6
|
Author-email: ed cuss <edcussmusic@gmail.com>
|
|
@@ -13,6 +13,11 @@ Requires-Python: >=3.11
|
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
|
|
15
15
|
# papertrail
|
|
16
|
+
[](https://pepy.tech/projects/danom)
|
|
17
|
+
|
|
18
|
+
## API Reference
|
|
19
|
+
|
|
20
|
+
[papertrail API docs](https://second-ed.github.io/papertrail/)
|
|
16
21
|
|
|
17
22
|
### Motivation
|
|
18
23
|
- Documentation can get out of date quickly
|
|
@@ -86,7 +91,10 @@ def func_b(a: float, b: float) -> float:
|
|
|
86
91
|
|
|
87
92
|
Papertrail examples:
|
|
88
93
|
|
|
89
|
-
>>> func_b(
|
|
94
|
+
>>> func_b(2, 2) == 0
|
|
95
|
+
True
|
|
96
|
+
|
|
97
|
+
>>> func_b(2, b=3) == -1
|
|
90
98
|
True
|
|
91
99
|
::
|
|
92
100
|
"""
|
|
@@ -99,9 +107,6 @@ def func_b(a: float, b: float) -> float:
|
|
|
99
107
|
│ └── workflows
|
|
100
108
|
│ ├── ci_tests.yaml
|
|
101
109
|
│ └── publish.yaml
|
|
102
|
-
├── docs
|
|
103
|
-
│ └── source
|
|
104
|
-
│ └── conf.py
|
|
105
110
|
├── src
|
|
106
111
|
│ └── papertrail
|
|
107
112
|
│ ├── adapters
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# papertrail
|
|
2
|
+
[](https://pepy.tech/projects/danom)
|
|
3
|
+
|
|
4
|
+
## API Reference
|
|
5
|
+
|
|
6
|
+
[papertrail API docs](https://second-ed.github.io/papertrail/)
|
|
2
7
|
|
|
3
8
|
### Motivation
|
|
4
9
|
- Documentation can get out of date quickly
|
|
@@ -72,7 +77,10 @@ def func_b(a: float, b: float) -> float:
|
|
|
72
77
|
|
|
73
78
|
Papertrail examples:
|
|
74
79
|
|
|
75
|
-
>>> func_b(
|
|
80
|
+
>>> func_b(2, 2) == 0
|
|
81
|
+
True
|
|
82
|
+
|
|
83
|
+
>>> func_b(2, b=3) == -1
|
|
76
84
|
True
|
|
77
85
|
::
|
|
78
86
|
"""
|
|
@@ -85,9 +93,6 @@ def func_b(a: float, b: float) -> float:
|
|
|
85
93
|
│ └── workflows
|
|
86
94
|
│ ├── ci_tests.yaml
|
|
87
95
|
│ └── publish.yaml
|
|
88
|
-
├── docs
|
|
89
|
-
│ └── source
|
|
90
|
-
│ └── conf.py
|
|
91
96
|
├── src
|
|
92
97
|
│ └── papertrail
|
|
93
98
|
│ ├── adapters
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "papertrail"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.1"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -46,3 +46,9 @@ omit = [
|
|
|
46
46
|
show_missing = true
|
|
47
47
|
skip_covered = true
|
|
48
48
|
fail_under = 95
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
norecursedirs = [
|
|
52
|
+
"docs/docs-build",
|
|
53
|
+
"docs/_build",
|
|
54
|
+
]
|
|
@@ -111,11 +111,77 @@ def example(fn: Callable, *args: tuple[Any, ...], **kwargs: dict[str, Any]) -> E
|
|
|
111
111
|
|
|
112
112
|
Papertrail examples:
|
|
113
113
|
|
|
114
|
-
>>> func_b(
|
|
114
|
+
>>> func_b(2, 2) == 0
|
|
115
|
+
True
|
|
116
|
+
|
|
117
|
+
>>> func_b(2, b=3) == -1
|
|
115
118
|
True
|
|
116
119
|
::
|
|
117
120
|
\"\"\"
|
|
118
121
|
return a - b
|
|
122
|
+
|
|
123
|
+
For more exciting inputs and arguments the docstrings code will be formatted with black:
|
|
124
|
+
|
|
125
|
+
.. code-block:: python
|
|
126
|
+
|
|
127
|
+
def enum_keys(enum_dict: dict[int, str]) -> list[str]:
|
|
128
|
+
\"\"\"Multiply the values by the key amount.\"\"\"
|
|
129
|
+
return [i * a for i, a in enum_dict.items()]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
Imagine this test:
|
|
133
|
+
|
|
134
|
+
.. code-block:: python
|
|
135
|
+
|
|
136
|
+
import string
|
|
137
|
+
|
|
138
|
+
import pytest
|
|
139
|
+
from mock_src.mod_b import enum_keys
|
|
140
|
+
|
|
141
|
+
from papertrail import example
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@pytest.mark.parametrize(
|
|
145
|
+
("args", "kwargs", "expected_result"),
|
|
146
|
+
[
|
|
147
|
+
pytest.param(
|
|
148
|
+
(dict(enumerate(string.ascii_lowercase[:5])),),
|
|
149
|
+
{},
|
|
150
|
+
[
|
|
151
|
+
"",
|
|
152
|
+
"b",
|
|
153
|
+
"cc",
|
|
154
|
+
"ddd",
|
|
155
|
+
"eeee",
|
|
156
|
+
],
|
|
157
|
+
),
|
|
158
|
+
],
|
|
159
|
+
)
|
|
160
|
+
def test_enum_keys(args, kwargs, expected_result):
|
|
161
|
+
assert example(enum_keys, *args, **kwargs) == expected_result
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
This is the result (Hopefully it clearly suggests what the function should do):
|
|
165
|
+
|
|
166
|
+
.. code-block:: python
|
|
167
|
+
|
|
168
|
+
def enum_keys(enum_dict: dict[int, str]) -> list[str]:
|
|
169
|
+
\"\"\"Multiply the values by the key amount.
|
|
170
|
+
|
|
171
|
+
Papertrail examples:
|
|
172
|
+
|
|
173
|
+
>>> enum_keys({0: "a", 1: "b", 2: "c", 3: "d", 4: "e"}) == [
|
|
174
|
+
... "",
|
|
175
|
+
... "b",
|
|
176
|
+
... "cc",
|
|
177
|
+
... "ddd",
|
|
178
|
+
... "eeee",
|
|
179
|
+
... ]
|
|
180
|
+
True
|
|
181
|
+
::.
|
|
182
|
+
\"\"\"
|
|
183
|
+
return [i * a for i, a in enum_dict.items()]
|
|
184
|
+
|
|
119
185
|
"""
|
|
120
186
|
value = fn(*args, **kwargs)
|
|
121
187
|
return Example(fn, args, kwargs, value, recorder=_RECORDER)
|
|
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
|