apexcodexpy 0.2.2__tar.gz → 0.2.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.
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/PKG-INFO +1 -1
- apexcodexpy-0.2.3/codex/runner.py +7 -0
- apexcodexpy-0.2.3/codex/typer/__init__.py +7 -0
- apexcodexpy-0.2.2/codex/cli.py → apexcodexpy-0.2.3/codex/typer/root.py +192 -255
- apexcodexpy-0.2.3/codex/typer/testing.py +94 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/pyproject.toml +2 -2
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/LICENSE +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/README.md +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/__init__.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/reporters.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/service.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/tasks/__init__.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/tasks/dependabot.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/tasks/result.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/tasks/update.py +0 -0
- {apexcodexpy-0.2.2 → apexcodexpy-0.2.3}/codex/tools.py +0 -0
|
@@ -1,255 +1,192 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
"--
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
)
|
|
166
|
-
(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
@
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
@test_cli.command(
|
|
196
|
-
name="unit",
|
|
197
|
-
help="Run programmer tests.",
|
|
198
|
-
)
|
|
199
|
-
def run_unit_tests(
|
|
200
|
-
path: str = typer.Option(
|
|
201
|
-
".",
|
|
202
|
-
"--path",
|
|
203
|
-
"-p",
|
|
204
|
-
help="Target directory.",
|
|
205
|
-
),
|
|
206
|
-
ci: bool = typer.Option(
|
|
207
|
-
False,
|
|
208
|
-
"--ci",
|
|
209
|
-
help="Run in CI mode.",
|
|
210
|
-
),
|
|
211
|
-
) -> None:
|
|
212
|
-
(
|
|
213
|
-
Codex(target=Path(path))
|
|
214
|
-
.ci(on=ci)
|
|
215
|
-
.test()
|
|
216
|
-
.report(using=DefaultReporter())
|
|
217
|
-
.exit(using=typer.Exit)
|
|
218
|
-
)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
@test_cli.command(
|
|
222
|
-
name="integration",
|
|
223
|
-
help="Run integration tests.",
|
|
224
|
-
)
|
|
225
|
-
def _(
|
|
226
|
-
ci: bool = typer.Option(
|
|
227
|
-
False,
|
|
228
|
-
"--ci",
|
|
229
|
-
help="Run in CI mode.",
|
|
230
|
-
),
|
|
231
|
-
) -> None:
|
|
232
|
-
(
|
|
233
|
-
Codex(target=Path("."))
|
|
234
|
-
.ci(on=ci)
|
|
235
|
-
.test_integration()
|
|
236
|
-
.report(using=DefaultReporter())
|
|
237
|
-
.exit(using=typer.Exit)
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
@test_cli.command(
|
|
242
|
-
name="behaviour",
|
|
243
|
-
help="Run behaviour tests.",
|
|
244
|
-
)
|
|
245
|
-
def _() -> None:
|
|
246
|
-
(
|
|
247
|
-
Codex(target=Path("."))
|
|
248
|
-
.test_behaviour()
|
|
249
|
-
.report(using=DefaultReporter())
|
|
250
|
-
.exit(using=typer.Exit)
|
|
251
|
-
)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if __name__ == "__main__":
|
|
255
|
-
cli()
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
from codex.reporters import DefaultReporter
|
|
6
|
+
from codex.service import Codex, Git
|
|
7
|
+
|
|
8
|
+
cli = typer.Typer(no_args_is_help=True)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@cli.command(
|
|
12
|
+
name="sync",
|
|
13
|
+
help="Inject standards into pyproject TOML file.",
|
|
14
|
+
)
|
|
15
|
+
def _(
|
|
16
|
+
path: str = typer.Option(
|
|
17
|
+
".",
|
|
18
|
+
"--path",
|
|
19
|
+
"-p",
|
|
20
|
+
help="Target directory.",
|
|
21
|
+
),
|
|
22
|
+
dry_run: bool = typer.Option(
|
|
23
|
+
False,
|
|
24
|
+
"--dry-run",
|
|
25
|
+
help="Show changes without applying them.",
|
|
26
|
+
),
|
|
27
|
+
) -> None:
|
|
28
|
+
(
|
|
29
|
+
Codex(target=Path(path))
|
|
30
|
+
.sync(dry_run=dry_run)
|
|
31
|
+
.report(using=DefaultReporter())
|
|
32
|
+
.exit(using=typer.Exit)
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@cli.command(
|
|
37
|
+
name="install",
|
|
38
|
+
help="Install project tools and dependencies.",
|
|
39
|
+
)
|
|
40
|
+
def _(
|
|
41
|
+
path: str = typer.Option(
|
|
42
|
+
".",
|
|
43
|
+
"--path",
|
|
44
|
+
"-p",
|
|
45
|
+
help="Target directory.",
|
|
46
|
+
),
|
|
47
|
+
) -> None:
|
|
48
|
+
(
|
|
49
|
+
Codex(target=Path(path))
|
|
50
|
+
.install()
|
|
51
|
+
.report(using=DefaultReporter())
|
|
52
|
+
.exit(using=typer.Exit)
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@cli.command(
|
|
57
|
+
name="lock",
|
|
58
|
+
help="Lock project dependencies.",
|
|
59
|
+
)
|
|
60
|
+
def _(
|
|
61
|
+
path: str = typer.Option(
|
|
62
|
+
".",
|
|
63
|
+
"--path",
|
|
64
|
+
"-p",
|
|
65
|
+
help="Target directory.",
|
|
66
|
+
),
|
|
67
|
+
) -> None:
|
|
68
|
+
(
|
|
69
|
+
Codex(target=Path(path))
|
|
70
|
+
.lock()
|
|
71
|
+
.report(using=DefaultReporter())
|
|
72
|
+
.exit(using=typer.Exit)
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@cli.command(
|
|
77
|
+
name="update",
|
|
78
|
+
help="Update project dependencies.",
|
|
79
|
+
)
|
|
80
|
+
def _(
|
|
81
|
+
path: str = typer.Option(
|
|
82
|
+
".",
|
|
83
|
+
"--path",
|
|
84
|
+
"-p",
|
|
85
|
+
help="Target directory.",
|
|
86
|
+
),
|
|
87
|
+
) -> None:
|
|
88
|
+
(
|
|
89
|
+
Codex(target=Path(path))
|
|
90
|
+
.update()
|
|
91
|
+
.report(using=DefaultReporter())
|
|
92
|
+
.exit(using=typer.Exit)
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@cli.command(
|
|
97
|
+
name="build",
|
|
98
|
+
help="Build a Docker image.",
|
|
99
|
+
)
|
|
100
|
+
def _(
|
|
101
|
+
tag: str = typer.Option(
|
|
102
|
+
...,
|
|
103
|
+
"--tag",
|
|
104
|
+
"-t",
|
|
105
|
+
help="Target tag, e.g. my-project:latest",
|
|
106
|
+
),
|
|
107
|
+
path: str = typer.Option(
|
|
108
|
+
".",
|
|
109
|
+
"--path",
|
|
110
|
+
"-p",
|
|
111
|
+
help="Target directory.",
|
|
112
|
+
),
|
|
113
|
+
) -> None:
|
|
114
|
+
(
|
|
115
|
+
Codex(target=Path(path))
|
|
116
|
+
.build(tag=tag)
|
|
117
|
+
.report(using=DefaultReporter())
|
|
118
|
+
.exit(using=typer.Exit)
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@cli.command(
|
|
123
|
+
name="lint",
|
|
124
|
+
help="Run linting (Ruff) and type checking (MyPy).",
|
|
125
|
+
)
|
|
126
|
+
def _(
|
|
127
|
+
path: str = typer.Option(
|
|
128
|
+
".",
|
|
129
|
+
"--path",
|
|
130
|
+
"-p",
|
|
131
|
+
help="Target directory.",
|
|
132
|
+
),
|
|
133
|
+
ci: bool = typer.Option(
|
|
134
|
+
False,
|
|
135
|
+
"--ci",
|
|
136
|
+
help="Run in CI mode.",
|
|
137
|
+
),
|
|
138
|
+
silent: bool = typer.Option(
|
|
139
|
+
False,
|
|
140
|
+
"--silent",
|
|
141
|
+
"-s",
|
|
142
|
+
help="Suppress output.",
|
|
143
|
+
),
|
|
144
|
+
) -> None:
|
|
145
|
+
(
|
|
146
|
+
Codex(target=Path(path))
|
|
147
|
+
.ci(on=ci)
|
|
148
|
+
.lint()
|
|
149
|
+
.silenced(when=silent)
|
|
150
|
+
.report(using=DefaultReporter())
|
|
151
|
+
.exit(using=typer.Exit)
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@cli.command(
|
|
156
|
+
name="fix",
|
|
157
|
+
help="Automatically fix Ruff linting errors.",
|
|
158
|
+
)
|
|
159
|
+
def _(
|
|
160
|
+
path: str = typer.Option(
|
|
161
|
+
".",
|
|
162
|
+
"--path",
|
|
163
|
+
"-p",
|
|
164
|
+
help="Target directory.",
|
|
165
|
+
),
|
|
166
|
+
silent: bool = typer.Option(
|
|
167
|
+
False,
|
|
168
|
+
"--silent",
|
|
169
|
+
"-s",
|
|
170
|
+
help="Suppress output.",
|
|
171
|
+
),
|
|
172
|
+
unsafe: bool = typer.Option(
|
|
173
|
+
False,
|
|
174
|
+
"--unsafe",
|
|
175
|
+
help="Run unsafe Ruff fixes.",
|
|
176
|
+
),
|
|
177
|
+
) -> None:
|
|
178
|
+
(
|
|
179
|
+
Codex(target=Path(path))
|
|
180
|
+
.fix(unsafe=unsafe)
|
|
181
|
+
.silenced(when=silent)
|
|
182
|
+
.report(using=DefaultReporter())
|
|
183
|
+
.exit(using=typer.Exit)
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
@cli.command(
|
|
188
|
+
name="amend",
|
|
189
|
+
help="Amend the last git commit without changing the message.",
|
|
190
|
+
)
|
|
191
|
+
def _() -> None:
|
|
192
|
+
Git().amend().report(using=DefaultReporter()).exit(using=typer.Exit)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
from codex.reporters import DefaultReporter
|
|
6
|
+
from codex.service import Codex
|
|
7
|
+
|
|
8
|
+
cli = typer.Typer()
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@cli.command(
|
|
12
|
+
name="unit",
|
|
13
|
+
help="Run programmer tests.",
|
|
14
|
+
)
|
|
15
|
+
def run_unit_tests(
|
|
16
|
+
path: str = typer.Option(
|
|
17
|
+
".",
|
|
18
|
+
"--path",
|
|
19
|
+
"-p",
|
|
20
|
+
help="Target directory.",
|
|
21
|
+
),
|
|
22
|
+
ci: bool = typer.Option(
|
|
23
|
+
False,
|
|
24
|
+
"--ci",
|
|
25
|
+
help="Run in CI mode.",
|
|
26
|
+
),
|
|
27
|
+
) -> None:
|
|
28
|
+
(
|
|
29
|
+
Codex(target=Path(path))
|
|
30
|
+
.ci(on=ci)
|
|
31
|
+
.test()
|
|
32
|
+
.report(using=DefaultReporter())
|
|
33
|
+
.exit(using=typer.Exit)
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@cli.command(
|
|
38
|
+
name="integration",
|
|
39
|
+
help="Run integration tests.",
|
|
40
|
+
)
|
|
41
|
+
def _(
|
|
42
|
+
path: str = typer.Option(
|
|
43
|
+
".",
|
|
44
|
+
"--path",
|
|
45
|
+
"-p",
|
|
46
|
+
help="Target directory.",
|
|
47
|
+
),
|
|
48
|
+
ci: bool = typer.Option(
|
|
49
|
+
False,
|
|
50
|
+
"--ci",
|
|
51
|
+
help="Run in CI mode.",
|
|
52
|
+
),
|
|
53
|
+
) -> None:
|
|
54
|
+
(
|
|
55
|
+
Codex(target=Path(path))
|
|
56
|
+
.ci(on=ci)
|
|
57
|
+
.test_integration()
|
|
58
|
+
.report(using=DefaultReporter())
|
|
59
|
+
.exit(using=typer.Exit)
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@cli.command(
|
|
64
|
+
name="behaviour",
|
|
65
|
+
help="Run behaviour tests.",
|
|
66
|
+
)
|
|
67
|
+
def _(
|
|
68
|
+
path: str = typer.Option(
|
|
69
|
+
".",
|
|
70
|
+
"--path",
|
|
71
|
+
"-p",
|
|
72
|
+
help="Target directory.",
|
|
73
|
+
),
|
|
74
|
+
ci: bool = typer.Option(
|
|
75
|
+
False,
|
|
76
|
+
"--ci",
|
|
77
|
+
help="Run in CI mode.",
|
|
78
|
+
),
|
|
79
|
+
) -> None:
|
|
80
|
+
(
|
|
81
|
+
Codex(target=Path(path))
|
|
82
|
+
.ci(on=ci)
|
|
83
|
+
.test_behaviour()
|
|
84
|
+
.report(using=DefaultReporter())
|
|
85
|
+
.exit(using=typer.Exit)
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@cli.callback(invoke_without_command=True)
|
|
90
|
+
def _(ctx: typer.Context) -> None:
|
|
91
|
+
if ctx.invoked_subcommand is not None:
|
|
92
|
+
return
|
|
93
|
+
|
|
94
|
+
run_unit_tests(path=".", ci=False)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "apexcodexpy"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "The Non-Destructive Configuration Steward for Python Projects."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -10,7 +10,7 @@ dynamic = ["dependencies"]
|
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
|
|
12
12
|
[project.scripts]
|
|
13
|
-
codex = "codex.
|
|
13
|
+
codex = "codex.runner:cli"
|
|
14
14
|
|
|
15
15
|
[tool.poetry]
|
|
16
16
|
packages = [
|
|
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
|