proj-flow 0.9.3__py3-none-any.whl → 0.10.0__py3-none-any.whl
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.
- proj_flow/__init__.py +6 -1
- proj_flow/api/arg.py +47 -24
- proj_flow/api/ctx.py +43 -23
- proj_flow/api/env.py +7 -2
- proj_flow/api/makefile.py +1 -1
- proj_flow/api/step.py +3 -5
- proj_flow/base/name_list.py +19 -0
- proj_flow/base/plugins.py +1 -36
- proj_flow/base/registry.py +19 -4
- proj_flow/cli/__init__.py +2 -4
- proj_flow/cli/argument.py +3 -3
- proj_flow/{flow/dependency.py → dependency.py} +1 -1
- proj_flow/ext/cplusplus/__init__.py +10 -0
- proj_flow/ext/cplusplus/cmake/__init__.py +12 -0
- proj_flow/{plugins → ext/cplusplus}/cmake/__version__.py +5 -0
- proj_flow/{plugins → ext/cplusplus}/cmake/context.py +10 -8
- proj_flow/{plugins → ext/cplusplus}/cmake/parser.py +6 -28
- proj_flow/ext/cplusplus/cmake/steps.py +142 -0
- proj_flow/ext/cplusplus/cmake/version.py +35 -0
- proj_flow/{plugins → ext/cplusplus}/conan/__init__.py +7 -3
- proj_flow/{plugins → ext/cplusplus}/conan/_conan.py +8 -3
- proj_flow/ext/github/__init__.py +2 -2
- proj_flow/ext/github/cli.py +2 -11
- proj_flow/{plugins/github.py → ext/github/switches.py} +3 -3
- proj_flow/ext/{markdown_changelist.py → markdown_changelog.py} +2 -1
- proj_flow/ext/python/rtdocs.py +1 -1
- proj_flow/ext/python/version.py +1 -2
- proj_flow/ext/{re_structured_changelist.py → re_structured_changelog.py} +3 -1
- proj_flow/{plugins → ext}/sign/__init__.py +64 -44
- proj_flow/ext/sign/api.py +83 -0
- proj_flow/ext/sign/win32.py +152 -0
- proj_flow/{plugins/store/store_packages.py → ext/store.py} +51 -9
- proj_flow/flow/__init__.py +2 -2
- proj_flow/log/release.py +1 -1
- proj_flow/log/rich_text/markdown.py +1 -1
- proj_flow/log/rich_text/re_structured_text.py +1 -1
- proj_flow/minimal/__init__.py +2 -2
- proj_flow/{plugins → minimal}/base.py +3 -2
- proj_flow/{plugins/commands → minimal}/init.py +44 -11
- proj_flow/minimal/run.py +1 -2
- proj_flow/project/__init__.py +11 -0
- proj_flow/project/api.py +51 -0
- proj_flow/project/cplusplus.py +17 -0
- proj_flow/project/data.py +14 -0
- proj_flow/{flow → project}/interact.py +114 -13
- {proj_flow-0.9.3.dist-info → proj_flow-0.10.0.dist-info}/METADATA +3 -2
- {proj_flow-0.9.3.dist-info → proj_flow-0.10.0.dist-info}/RECORD +50 -55
- proj_flow/flow/init.py +0 -65
- proj_flow/plugins/__init__.py +0 -8
- proj_flow/plugins/cmake/__init__.py +0 -11
- proj_flow/plugins/cmake/build.py +0 -29
- proj_flow/plugins/cmake/config.py +0 -59
- proj_flow/plugins/cmake/pack.py +0 -37
- proj_flow/plugins/cmake/test.py +0 -29
- proj_flow/plugins/commands/__init__.py +0 -12
- proj_flow/plugins/commands/ci/__init__.py +0 -17
- proj_flow/plugins/commands/ci/changelog.py +0 -47
- proj_flow/plugins/commands/ci/matrix.py +0 -46
- proj_flow/plugins/commands/ci/release.py +0 -116
- proj_flow/plugins/sign/win32.py +0 -191
- proj_flow/plugins/store/__init__.py +0 -11
- proj_flow/plugins/store/store_both.py +0 -22
- proj_flow/plugins/store/store_tests.py +0 -21
- {proj_flow-0.9.3.dist-info → proj_flow-0.10.0.dist-info}/WHEEL +0 -0
- {proj_flow-0.9.3.dist-info → proj_flow-0.10.0.dist-info}/entry_points.txt +0 -0
- {proj_flow-0.9.3.dist-info → proj_flow-0.10.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
3
|
|
|
4
4
|
"""
|
|
5
|
-
The **proj_flow.
|
|
6
|
-
prompts.
|
|
5
|
+
The **proj_flow.project.interact** provides initialization context through
|
|
6
|
+
user prompts.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from dataclasses import dataclass
|
|
10
|
-
from typing import List, Union
|
|
10
|
+
from typing import Callable, List, Optional, Union
|
|
11
11
|
|
|
12
12
|
from prompt_toolkit import prompt as tk_prompt
|
|
13
13
|
from prompt_toolkit.completion import WordCompleter
|
|
14
|
+
from prompt_toolkit.formatted_text.base import AnyFormattedText
|
|
14
15
|
from prompt_toolkit.shortcuts import CompleteStyle
|
|
15
16
|
from prompt_toolkit.validation import Validator
|
|
16
17
|
|
|
@@ -39,7 +40,7 @@ class _Question:
|
|
|
39
40
|
def ps(self):
|
|
40
41
|
return self.prompt or f'"{self.key}"'
|
|
41
42
|
|
|
42
|
-
def _ps(self, default: ctx.Values, counter: int, size: int):
|
|
43
|
+
def _ps(self, default: ctx.Values, counter: int, size: int) -> AnyFormattedText:
|
|
43
44
|
if default:
|
|
44
45
|
if isinstance(default, str):
|
|
45
46
|
return [
|
|
@@ -89,7 +90,7 @@ class _Question:
|
|
|
89
90
|
|
|
90
91
|
def _tk_prompt(
|
|
91
92
|
self,
|
|
92
|
-
defaults: Union[bool
|
|
93
|
+
defaults: Union[bool, List[str]],
|
|
93
94
|
words: List[str],
|
|
94
95
|
counter: int,
|
|
95
96
|
size: int,
|
|
@@ -108,27 +109,127 @@ class _Question:
|
|
|
108
109
|
)
|
|
109
110
|
|
|
110
111
|
|
|
111
|
-
def
|
|
112
|
-
|
|
113
|
-
Prompts user to provide details of newly-crated project.
|
|
112
|
+
def _project_filter(project: Optional[str]):
|
|
113
|
+
if project is None:
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
def impl(setting: ctx.Setting):
|
|
116
|
+
return setting.project is None
|
|
117
|
+
|
|
118
|
+
return impl
|
|
119
|
+
|
|
120
|
+
def impl(setting: ctx.Setting):
|
|
121
|
+
return setting.project is None or setting.project == project
|
|
122
|
+
|
|
123
|
+
return impl
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _prompt(wanted: Callable[[ctx.Setting], bool]) -> ctx.SettingsType:
|
|
117
127
|
settings: ctx.SettingsType = {}
|
|
118
128
|
|
|
119
|
-
|
|
129
|
+
defaults = [setting for setting in ctx.defaults if wanted(setting)]
|
|
130
|
+
switches = [setting for setting in ctx.switches if wanted(setting)]
|
|
131
|
+
|
|
132
|
+
size = len(defaults) + len(switches)
|
|
120
133
|
counter = 1
|
|
121
134
|
|
|
122
|
-
for setting in
|
|
135
|
+
for setting in defaults:
|
|
123
136
|
loaded = _Question.load_default(setting, settings)
|
|
124
137
|
value = loaded.interact(counter, size)
|
|
125
138
|
settings[loaded.key] = value
|
|
126
139
|
counter += 1
|
|
127
140
|
|
|
128
|
-
for setting in
|
|
141
|
+
for setting in switches:
|
|
129
142
|
loaded = _Question.load_default(setting, settings)
|
|
130
143
|
value = loaded.interact(counter, size)
|
|
131
144
|
settings[loaded.key] = value
|
|
132
145
|
counter += 1
|
|
133
146
|
|
|
134
147
|
return settings
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def _all_default(wanted: Callable[[ctx.Setting], bool]):
|
|
151
|
+
"""
|
|
152
|
+
Chooses default answers for all details of newly-crated project.
|
|
153
|
+
|
|
154
|
+
:returns: Dictionary with default values of all interactive settings
|
|
155
|
+
and switches.
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
settings: ctx.SettingsType = {}
|
|
159
|
+
|
|
160
|
+
defaults = [setting for setting in ctx.defaults if wanted(setting)]
|
|
161
|
+
switches = [setting for setting in ctx.switches if wanted(setting)]
|
|
162
|
+
|
|
163
|
+
for setting in defaults:
|
|
164
|
+
value = _get_default(setting, settings)
|
|
165
|
+
settings[setting.json_key] = value
|
|
166
|
+
|
|
167
|
+
for setting in switches:
|
|
168
|
+
value = _get_default(setting, settings)
|
|
169
|
+
settings[setting.json_key] = value
|
|
170
|
+
|
|
171
|
+
return settings
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def _fixup(settings: ctx.SettingsType, key: str, fixup: str, force=False):
|
|
175
|
+
value = settings.get(key, "")
|
|
176
|
+
if value != "" and not force:
|
|
177
|
+
return
|
|
178
|
+
|
|
179
|
+
value = ctx._build_fixup(settings, fixup)
|
|
180
|
+
settings[key] = value
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _get_default(setting: ctx.Setting, settings: ctx.SettingsType):
|
|
184
|
+
value = setting.calc_value(settings)
|
|
185
|
+
if isinstance(value, list):
|
|
186
|
+
return value[0]
|
|
187
|
+
return value
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _fixup_context(settings: ctx.SettingsType, wanted: Callable[[ctx.Setting], bool]):
|
|
191
|
+
defaults = [setting for setting in ctx.defaults if wanted(setting)]
|
|
192
|
+
hidden = [setting for setting in ctx.hidden if wanted(setting)]
|
|
193
|
+
|
|
194
|
+
for setting in hidden:
|
|
195
|
+
value = _get_default(setting, settings)
|
|
196
|
+
if isinstance(value, bool) or value != "":
|
|
197
|
+
settings[setting.json_key] = value
|
|
198
|
+
|
|
199
|
+
for coll in [defaults, hidden]:
|
|
200
|
+
for setting in coll:
|
|
201
|
+
_fixup(settings, setting.json_key, setting.fix or "", setting.force_fix)
|
|
202
|
+
|
|
203
|
+
try:
|
|
204
|
+
del settings["EXT"]
|
|
205
|
+
except KeyError:
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
result = {}
|
|
209
|
+
for key in settings:
|
|
210
|
+
path = key.split(".")
|
|
211
|
+
path_ctx = result
|
|
212
|
+
for step in path[:-1]:
|
|
213
|
+
if step not in path_ctx or not isinstance(path_ctx[step], dict):
|
|
214
|
+
path_ctx[step] = {}
|
|
215
|
+
path_ctx = path_ctx[step]
|
|
216
|
+
path_ctx[path[-1]] = settings[key]
|
|
217
|
+
return result
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def get_context(interactive: bool, project: Optional[str]):
|
|
221
|
+
"""
|
|
222
|
+
Prompts user to provide details of newly-crated project. If `interactive`
|
|
223
|
+
is true, however, this functions skips the prompts and chooses all the
|
|
224
|
+
default answers.
|
|
225
|
+
|
|
226
|
+
:param interactive: Selects, if the initialization process is done through
|
|
227
|
+
prompts, or not
|
|
228
|
+
|
|
229
|
+
:returns: Dictionary with answers to all interactive settings and switches.
|
|
230
|
+
"""
|
|
231
|
+
|
|
232
|
+
wanted = _project_filter(project)
|
|
233
|
+
return _fixup_context(
|
|
234
|
+
_all_default(wanted) if not interactive else _prompt(wanted), wanted
|
|
235
|
+
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: proj-flow
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: C++ project maintenance, automated
|
|
5
|
+
Project-URL: Changelog, https://github.com/mzdun/proj-flow/blob/main/CHANGELOG.rst
|
|
5
6
|
Project-URL: Documentation, https://proj-flow.readthedocs.io/en/latest/
|
|
6
7
|
Project-URL: Homepage, https://pypi.org/project/proj-flow/
|
|
7
8
|
Project-URL: Source Code, https://github.com/mzdun/proj-flow
|
|
@@ -75,7 +76,7 @@ From PowerShell with:
|
|
|
75
76
|
A fresh C++ project can be created with a
|
|
76
77
|
|
|
77
78
|
```sh
|
|
78
|
-
proj-flow init
|
|
79
|
+
proj-flow init cxx
|
|
79
80
|
```
|
|
80
81
|
|
|
81
82
|
This command will ask multiple questions to build Mustache context for the
|
|
@@ -1,39 +1,52 @@
|
|
|
1
|
-
proj_flow/__init__.py,sha256=
|
|
1
|
+
proj_flow/__init__.py,sha256=cd3hxTcDnlv9Qd6qQYRRa3g7bs5iuMrPJtfF_ENzMTY,277
|
|
2
2
|
proj_flow/__main__.py,sha256=HUar_qQ9Ndmchmryegtzu__5wukwCLrFN_SGRl5Ol_M,233
|
|
3
|
+
proj_flow/dependency.py,sha256=CpcnR6El8AO9hlLc9lQtYQADYlkx3GMHlkLYbEAtdMI,4639
|
|
3
4
|
proj_flow/api/__init__.py,sha256=gV2f6kll_5JXtvkGASvnx7CbOWr34PHOdck-4ce-qEk,378
|
|
4
|
-
proj_flow/api/arg.py,sha256=
|
|
5
|
+
proj_flow/api/arg.py,sha256=id08mLFVDWIvsrhEaPuJfng27f92Vf8pIA5VajyjGVo,4802
|
|
5
6
|
proj_flow/api/completers.py,sha256=NapNVu6QAQ_iF6dqcAzOV5kDHKD9MAMVX209Bklq-Mw,2464
|
|
6
|
-
proj_flow/api/ctx.py,sha256=
|
|
7
|
-
proj_flow/api/env.py,sha256=
|
|
7
|
+
proj_flow/api/ctx.py,sha256=IJu0q0Chivo6b2M4MKkAlV09oi7Cn9VxtDFeAeL_tnc,6646
|
|
8
|
+
proj_flow/api/env.py,sha256=4VvSkfA2k6OPrtvkPtEPhb24dDyaqbUoqSznIgvAXNg,11082
|
|
8
9
|
proj_flow/api/init.py,sha256=an0czDiPCDqW4Bp0I8sGQgaAlDAozLO0ZYnP149lWqk,521
|
|
9
|
-
proj_flow/api/makefile.py,sha256=
|
|
10
|
+
proj_flow/api/makefile.py,sha256=AxtGOvmypBtSvoyMEDJq1bGoaVD5yW9YYRZSdunUEeg,3856
|
|
10
11
|
proj_flow/api/release.py,sha256=A-t4qcjeaptEgfBCZs2Q9cOjsGACrNM0CzmCorms0U4,2401
|
|
11
|
-
proj_flow/api/step.py,sha256=
|
|
12
|
+
proj_flow/api/step.py,sha256=AOqe1wXYnU_O3pD5KlzfyyOm_D9fcF_4vyhhr1w-NrI,4561
|
|
12
13
|
proj_flow/base/__init__.py,sha256=RRmqiYjdVlC4i8QijXHNiRh9yzNH8305WXezrSaPjKk,311
|
|
13
14
|
proj_flow/base/cmd.py,sha256=Vo3e8kd4CHRzbsUkO-MnbhQxjLXTczv7YQRUkFlcBQE,1560
|
|
14
15
|
proj_flow/base/inspect.py,sha256=lt5P19rvSZ-wMCTrCYAaQFCt2S9fUjEQXlrKK-Tmvwc,2786
|
|
15
16
|
proj_flow/base/matrix.py,sha256=8XBFGYOwW6Myt_4h3WNk36V2bJ5xeqUv6DvzF4B3q_g,7767
|
|
16
|
-
proj_flow/base/
|
|
17
|
-
proj_flow/base/
|
|
17
|
+
proj_flow/base/name_list.py,sha256=KiHSnbDgYplJc25O3EehYhFAhD7Z3mHVAK6UYOdg5PQ,416
|
|
18
|
+
proj_flow/base/plugins.py,sha256=evn2Dym_NeoBaIZAu2YUtRd--15PCFpHD0h5zSsWkQE,978
|
|
19
|
+
proj_flow/base/registry.py,sha256=C04Imxux_BO7DffZZth28iFLPnM4Yw9K7IGt06VokE0,3528
|
|
18
20
|
proj_flow/base/uname.py,sha256=7Awb3Es0jTAKMpyRawdrC16xc5X9M97BlPqEfQibqIk,2295
|
|
19
|
-
proj_flow/cli/__init__.py,sha256=
|
|
20
|
-
proj_flow/cli/argument.py,sha256
|
|
21
|
+
proj_flow/cli/__init__.py,sha256=cMsZpECkXeSzY4Hv_ela3Ou-FhwE5w1A3ypMSnZZikM,1196
|
|
22
|
+
proj_flow/cli/argument.py,sha256=OCx_Z0NVm4bmHI30WFdtPdqVMdDnvkqqluhAgP7Ya0w,13686
|
|
21
23
|
proj_flow/cli/finder.py,sha256=5x7H1nH0k63DetDauhB_wABel_f0RQpsZ5YnhPfbkRc,1402
|
|
22
24
|
proj_flow/ext/__init__.py,sha256=XD52rUFTPz3GnyRq6KZUNeWdMce7e0bB19iTx-zU6DE,169
|
|
23
|
-
proj_flow/ext/
|
|
24
|
-
proj_flow/ext/
|
|
25
|
-
proj_flow/ext/
|
|
26
|
-
proj_flow/ext/
|
|
25
|
+
proj_flow/ext/markdown_changelog.py,sha256=fRGL09jojnv2B-8vAX2prvgNp8e7uyq5NxboSZjFCJ8,436
|
|
26
|
+
proj_flow/ext/re_structured_changelog.py,sha256=UF23W9eu_YgPO42MiaoDbEKu8In_48mQg6rH9--mI30,459
|
|
27
|
+
proj_flow/ext/store.py,sha256=yfyIb2G7UhoIkPmVDnp1RPx2fwFZK8FyLZzrMvPlEUM,3681
|
|
28
|
+
proj_flow/ext/cplusplus/__init__.py,sha256=dAmLMyGVQq586jJM_jiAuo5Ecw9U8agpvSRbzzPgh3g,245
|
|
29
|
+
proj_flow/ext/cplusplus/cmake/__init__.py,sha256=f-_gTY_XpIfcKrAj0jhT57DBGeifkW2s7NlSxjpHTMg,366
|
|
30
|
+
proj_flow/ext/cplusplus/cmake/__version__.py,sha256=imja0GnhpBvS8Crz-64eOUKhc4i6FeRrjBGRB68x_p0,239
|
|
31
|
+
proj_flow/ext/cplusplus/cmake/context.py,sha256=BJDMRuIvCEXR577yWuYSw-wzQ9PQudpXjnIxo1gKHBU,3172
|
|
32
|
+
proj_flow/ext/cplusplus/cmake/parser.py,sha256=ZqQRZqS_VU5VtC8uwax-dknh7sfuLEvtazG8ChSqHDQ,3814
|
|
33
|
+
proj_flow/ext/cplusplus/cmake/steps.py,sha256=Q7HcVlMbKOwrRj-Sms0W7FS027M_shM7s2FJx6rX4KQ,4100
|
|
34
|
+
proj_flow/ext/cplusplus/cmake/version.py,sha256=E0PAUdO9Wg02pxtU4LWYTNoTB-9Oer3Y9zr1lR2zvgw,962
|
|
35
|
+
proj_flow/ext/cplusplus/conan/__init__.py,sha256=1WmGMY1hhvJdHsXfHg5MjA8g6qL3H2FABsK0TLBigCI,2022
|
|
36
|
+
proj_flow/ext/cplusplus/conan/_conan.py,sha256=9xnji-f8uN7huXLqavVBUDC33CgnjBIyZX6wVcGm2RA,3352
|
|
37
|
+
proj_flow/ext/github/__init__.py,sha256=Mgx19YS6SYBXYB66_pOgIgwuB2WKRxqp5UGutq0B9Xk,282
|
|
38
|
+
proj_flow/ext/github/cli.py,sha256=zQS2TB7fDeY0VwR1bOw065Trz2NPe07JKcFQaJbwKGg,3934
|
|
27
39
|
proj_flow/ext/github/hosting.py,sha256=3iW8QjeJk7MyqKNbv92nB-5a_Yn_B5_eEIlw_cdgUT0,519
|
|
40
|
+
proj_flow/ext/github/switches.py,sha256=g7O2hvrg4mHm3WSHYsRBhEDU0bIkEJgp4Qclhqxk0uI,421
|
|
28
41
|
proj_flow/ext/python/__init__.py,sha256=GbEKEJJZ3PJ4sRHEykAWjGIR6yyyrYdlUFulldvsAGI,252
|
|
29
|
-
proj_flow/ext/python/rtdocs.py,sha256=
|
|
42
|
+
proj_flow/ext/python/rtdocs.py,sha256=idm6DTUnbA18L-EpxQiFVXCz9x8AIRSb52ZPqIXzrf8,6354
|
|
30
43
|
proj_flow/ext/python/steps.py,sha256=pDHGAe_CDzzdRFAzM1AIBvkbc14KB3SNUunusKZAaaY,1815
|
|
31
|
-
proj_flow/ext/python/version.py,sha256=
|
|
32
|
-
proj_flow/
|
|
44
|
+
proj_flow/ext/python/version.py,sha256=pnyuKATyZwBh1p0gf9KmqbRSZx8hJ5285CiFK_tHEaY,3159
|
|
45
|
+
proj_flow/ext/sign/__init__.py,sha256=yvXpqLdvBwkB0GDBl4yWw--iZ2tFxhx-97EP9OAzx2g,4345
|
|
46
|
+
proj_flow/ext/sign/api.py,sha256=dlnXYYoBDYXx_WWGBQ8ThKmEMYmw2kt6NNZA8j-MXuM,2288
|
|
47
|
+
proj_flow/ext/sign/win32.py,sha256=fV8_Z42KaeDBEf3_5qCzlALb0dy1zN0Pqy8Hr-ZMAQ4,4874
|
|
48
|
+
proj_flow/flow/__init__.py,sha256=5Zo97zJsR7HMbl64jeMB9PbUuxCxpOlNuLmo3apWSVU,277
|
|
33
49
|
proj_flow/flow/configs.py,sha256=l-pIotrXFm4oMqqpuvKP-RdtlTmDDnK_izhTJfsWbhk,5260
|
|
34
|
-
proj_flow/flow/dependency.py,sha256=5o_-5Soc2e1tOu5mwvkXa6jqDFplZi_chN8edkR6vVY,4644
|
|
35
|
-
proj_flow/flow/init.py,sha256=9k3cgVmmeOKtH6mJ0nc4IOmI48oXvtYXFYWx2rj60-M,1777
|
|
36
|
-
proj_flow/flow/interact.py,sha256=AJknpCxk3C39GhsR6BjH5QDk33KouWCZbHEUFLjvfGc,4166
|
|
37
50
|
proj_flow/flow/layer.py,sha256=6mvbhiOy9KcMP69Q9zew_7jGhf5Wqr7v-veS3YPGnmc,5720
|
|
38
51
|
proj_flow/flow/steps.py,sha256=PN_C_B6vNvqOsjpDpa5ESvH30Sc6RM1fSSqWqXgqg-4,2804
|
|
39
52
|
proj_flow/log/__init__.py,sha256=02EIgasE-K7mmbbNiIdX0IebWQMp2Co_D6H4ZBhJgcs,365
|
|
@@ -42,43 +55,25 @@ proj_flow/log/error.py,sha256=65Nvhfs_d1xSY4EB-ISdWgjotvg-on3iKjhAWHpsBYM,841
|
|
|
42
55
|
proj_flow/log/fmt.py,sha256=o14aO3iEt5_KKp9SqcfkscqbMKuTI83NBoSXHcrb7Kg,330
|
|
43
56
|
proj_flow/log/format.py,sha256=gp1kUoW0nYj5e7Ysu1c29Fh2ssfE1KBSDIYeUbhzN9g,333
|
|
44
57
|
proj_flow/log/msg.py,sha256=zARmRZHFV3yG-fBnx00wal4Y0O5aGnL-6XcGwNBNKA4,6758
|
|
45
|
-
proj_flow/log/release.py,sha256
|
|
58
|
+
proj_flow/log/release.py,sha256=-wZNv0VVLuTC_ynNaaDPQ1CcEw-5c-l6vzFOxvLVQnM,4160
|
|
46
59
|
proj_flow/log/hosting/__init__.py,sha256=9Teyw8jJcxeWH2MegqYEgW0n5OmSAWC7FFJj2u_UcrM,278
|
|
47
60
|
proj_flow/log/hosting/github.py,sha256=yLjJ9gSuOnnC87phPFNc4N2yWno0iIi7BruhSrYOjEI,7151
|
|
48
61
|
proj_flow/log/rich_text/__init__.py,sha256=D3Y2jy9xlGgnQZdNC_ekoLzQtwkF_NTgLqDTWPvSRUk,279
|
|
49
62
|
proj_flow/log/rich_text/api.py,sha256=PCSAGwkmDUMoVlpN7BDsgIA1AiMZEC0H6TUZXpr_Mg8,3571
|
|
50
|
-
proj_flow/log/rich_text/markdown.py,sha256=
|
|
51
|
-
proj_flow/log/rich_text/re_structured_text.py,sha256=
|
|
52
|
-
proj_flow/minimal/__init__.py,sha256=
|
|
63
|
+
proj_flow/log/rich_text/markdown.py,sha256=jBnNxxhBHzyIZ3Y4HXDfqpl7zlRbbKbKdwdnZwkmNAI,1623
|
|
64
|
+
proj_flow/log/rich_text/re_structured_text.py,sha256=DEl9KjBUF6cxfNWpQ7GVnHi7wKeuFnPGJwxQxjbCsnM,1823
|
|
65
|
+
proj_flow/minimal/__init__.py,sha256=NglaSdKiMebrOqfsqF9ctqi0ZwiiBHOQcUnp3DS8lP0,340
|
|
66
|
+
proj_flow/minimal/base.py,sha256=yJR3FAigR_x8krTQ1UeifBb4AnLUZAk6LfVVqB_RFO4,758
|
|
53
67
|
proj_flow/minimal/bootstrap.py,sha256=PcZfBsUmj8uDPGBC55iUgD5O7W4VSkpCQb6r9GEyAaQ,556
|
|
68
|
+
proj_flow/minimal/init.py,sha256=YFAsD_wGypGxweEFrbAbCdGptV1jQ2OdxUseUPi-3C8,2945
|
|
54
69
|
proj_flow/minimal/list.py,sha256=RlOqammE8olNKXsnbv1enF5uriu0MZ2wFbht37Z2ETw,4810
|
|
55
|
-
proj_flow/minimal/run.py,sha256=
|
|
70
|
+
proj_flow/minimal/run.py,sha256=4qvGLqz2ayCZDvVBrq4tG094fjfcmDPon-xcGPQkM_U,4665
|
|
56
71
|
proj_flow/minimal/system.py,sha256=9FliH5TD103JYSAe2O5EU7hkOHDgVzTqu0Exxk-WrXE,1579
|
|
57
|
-
proj_flow/
|
|
58
|
-
proj_flow/
|
|
59
|
-
proj_flow/
|
|
60
|
-
proj_flow/
|
|
61
|
-
proj_flow/
|
|
62
|
-
proj_flow/plugins/cmake/build.py,sha256=3IxHUm2tiTXqrPLwJfgxB5kHwEfQnVXBEf4qij5twCc,796
|
|
63
|
-
proj_flow/plugins/cmake/config.py,sha256=pBI9O-1bUFBSs-cM1maBwCYZJS-q0u0mjuhhjjCcx6w,1722
|
|
64
|
-
proj_flow/plugins/cmake/context.py,sha256=jpySxdeVo-EMeN_Vx8m8n2Z9ZZu3knLqPfR77xlO-aM,3079
|
|
65
|
-
proj_flow/plugins/cmake/pack.py,sha256=2rBaPePbqJn55pFBAkPQSjQJeK14HWfu6ogu9ZtVP_c,1030
|
|
66
|
-
proj_flow/plugins/cmake/parser.py,sha256=MA1PB1lWybDC0YGYhaXEuHawGRPRRsjpJJ4qFqkDf8U,4223
|
|
67
|
-
proj_flow/plugins/cmake/test.py,sha256=POUa5QBb9mTTCYhS7wLjkqtVRiFGoJxD8O556bDYHXs,790
|
|
68
|
-
proj_flow/plugins/commands/__init__.py,sha256=-5jT0bfrrGds3TbAOIRZOFJjH2Q8IUKDzm02Ac7PO_4,298
|
|
69
|
-
proj_flow/plugins/commands/init.py,sha256=MrdxMv9G-0oYZgLk5OOKjd36Z-b55mdJaTV9ix3va9o,2090
|
|
70
|
-
proj_flow/plugins/commands/ci/__init__.py,sha256=4PkKCd2HoCHypAzO7GZatCkrV0fteLWdoICviQXoyAg,369
|
|
71
|
-
proj_flow/plugins/commands/ci/changelog.py,sha256=Q2f-JGuFxmK0IJg7K8RN3z_Rv_29haexgoFQWUysUM0,1296
|
|
72
|
-
proj_flow/plugins/commands/ci/matrix.py,sha256=tjEpyCTdNvIY4xvyGNy5KffCkmOXnVUUXVTds9WeDeA,1362
|
|
73
|
-
proj_flow/plugins/commands/ci/release.py,sha256=F2KRMnc5TWu2-R7K003HWnRBDo9Pl9hfRvROpmtcMMw,3689
|
|
74
|
-
proj_flow/plugins/conan/__init__.py,sha256=YJ9DWfKjKYqgp6zb3gCUnvGC5QKFFs55dSawooGxT0Y,1933
|
|
75
|
-
proj_flow/plugins/conan/_conan.py,sha256=rI_vbM-Zk0yP7XJDM_nX9mXkuSTmeabcLASjJByvT8s,3270
|
|
76
|
-
proj_flow/plugins/sign/__init__.py,sha256=JsAU02LZQS_tRwgpVpzzwLpRToan832VfPrsXHCteSc,3678
|
|
77
|
-
proj_flow/plugins/sign/win32.py,sha256=h6YAtLxX0zM_YLVW60JS1tZZ-_du7I1Ko82M4AdvjN8,5335
|
|
78
|
-
proj_flow/plugins/store/__init__.py,sha256=PyDlpUQFJNT6-_JU8UTDwFAnJsSb6f-wRwPnabX2hBs,326
|
|
79
|
-
proj_flow/plugins/store/store_both.py,sha256=cwZl1WdUKIdCVimi3gN3t1lI4398d3tWUzKc3J67GXM,527
|
|
80
|
-
proj_flow/plugins/store/store_packages.py,sha256=LqVjIfZiOGlLGIzbhw-Li2X7aWSIrzwBl5WnxK8DJM8,2699
|
|
81
|
-
proj_flow/plugins/store/store_tests.py,sha256=0rh9RX-9EOp2pHYA-v_nsuGJJZLadFBFSp12N0EVNcA,567
|
|
72
|
+
proj_flow/project/__init__.py,sha256=AROrwhbuMR5rJE-HC769eL4IXrMLQYpQb3HgpkOAYqg,293
|
|
73
|
+
proj_flow/project/api.py,sha256=xQ3eFcxgLfi6ZAGs2q_1V0uHTpM7v9gsb7Ie2o2z-v8,1358
|
|
74
|
+
proj_flow/project/cplusplus.py,sha256=GXHXI4cdrSm0jWTr2g9dCBgeFS1G4g2fC9WCv6ILn0c,398
|
|
75
|
+
proj_flow/project/data.py,sha256=TluhBDoJEYL4dnyTpInmhQ49Uvf8mkWmpU-YMLQPNhE,317
|
|
76
|
+
proj_flow/project/interact.py,sha256=DgclUNeY6K146QQe510tdHcYnZmWmQZ0xH9w4HifLTU,7235
|
|
82
77
|
proj_flow/template/layers/base.json,sha256=jrlby8FUUwkx4V_EGMix_pkQlWcUCVUgmeoapZaZnt4,3
|
|
83
78
|
proj_flow/template/layers/cmake.json,sha256=KJe9uqTDoGm0ppdNOtniKEv30iNV2K4Yk8hZQetEZ7Y,385
|
|
84
79
|
proj_flow/template/layers/conan.json,sha256=mAhDrxCtDjI_7Rbtr2hlNW5_jZkLdWLiwgfuhRsRuuw,29
|
|
@@ -133,8 +128,8 @@ proj_flow/template/licenses/MIT.mustache,sha256=NncPoQaNsuy-WmRmboik3fyhJJ8m5pc2
|
|
|
133
128
|
proj_flow/template/licenses/Unlicense.mustache,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
|
134
129
|
proj_flow/template/licenses/WTFPL.mustache,sha256=lvF4V_PrKKfZPa2TC8CZo8tlqaKvs3Bpv9G6XsWWQ4k,483
|
|
135
130
|
proj_flow/template/licenses/Zlib.mustache,sha256=uIj-mhSjes2HJ3rRapyy2ALflKRz4xQgS4mVM9827C0,868
|
|
136
|
-
proj_flow-0.
|
|
137
|
-
proj_flow-0.
|
|
138
|
-
proj_flow-0.
|
|
139
|
-
proj_flow-0.
|
|
140
|
-
proj_flow-0.
|
|
131
|
+
proj_flow-0.10.0.dist-info/METADATA,sha256=bQUtOSHQevlBQB43X1xui_BfX4KBey_TwIYx_tUNx1Q,2868
|
|
132
|
+
proj_flow-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
133
|
+
proj_flow-0.10.0.dist-info/entry_points.txt,sha256=d_OmGKZzpY7FCWz0sZ4wnBAPZC75oMEzTgJZWtpDELo,49
|
|
134
|
+
proj_flow-0.10.0.dist-info/licenses/LICENSE,sha256=vpOQJ5QlrTedF3coEWvA4wJzVJH304f66ZitR7Od4iU,1068
|
|
135
|
+
proj_flow-0.10.0.dist-info/RECORD,,
|
proj_flow/flow/init.py
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.flow.init** supports the ``init`` command.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from proj_flow.api import ctx
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def _fixup(settings: ctx.SettingsType, key: str, fixup: str, force=False):
|
|
12
|
-
value = settings.get(key, "")
|
|
13
|
-
if value != "" and not force:
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
value = ctx._build_fixup(settings, fixup)
|
|
17
|
-
settings[key] = value
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def _get_default(setting: ctx.Setting, settings: ctx.SettingsType):
|
|
21
|
-
value = setting.calc_value(settings)
|
|
22
|
-
if isinstance(value, list):
|
|
23
|
-
return value[0]
|
|
24
|
-
return value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def all_default():
|
|
28
|
-
settings: ctx.SettingsType = {}
|
|
29
|
-
|
|
30
|
-
for setting in ctx.defaults:
|
|
31
|
-
value = _get_default(setting, settings)
|
|
32
|
-
settings[setting.json_key] = value
|
|
33
|
-
|
|
34
|
-
for setting in ctx.switches:
|
|
35
|
-
value = _get_default(setting, settings)
|
|
36
|
-
settings[setting.json_key] = value
|
|
37
|
-
|
|
38
|
-
return settings
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def fixup(settings: ctx.SettingsType):
|
|
42
|
-
for setting in ctx.hidden:
|
|
43
|
-
value = _get_default(setting, settings)
|
|
44
|
-
if isinstance(value, bool) or value != "":
|
|
45
|
-
settings[setting.json_key] = value
|
|
46
|
-
|
|
47
|
-
for coll in [ctx.defaults, ctx.hidden]:
|
|
48
|
-
for setting in coll:
|
|
49
|
-
_fixup(settings, setting.json_key, setting.fix or "", setting.force_fix)
|
|
50
|
-
del settings["EXT"]
|
|
51
|
-
|
|
52
|
-
result = {}
|
|
53
|
-
for key in settings:
|
|
54
|
-
path = key.split(".")
|
|
55
|
-
path_ctx = result
|
|
56
|
-
for step in path[:-1]:
|
|
57
|
-
if step not in path_ctx or not isinstance(path_ctx[step], dict):
|
|
58
|
-
path_ctx[step] = {}
|
|
59
|
-
path_ctx = path_ctx[step]
|
|
60
|
-
path_ctx[path[-1]] = settings[key]
|
|
61
|
-
return result
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def get_internal(key: str, value: any = None):
|
|
65
|
-
return ctx.internals.get(key, value)
|
proj_flow/plugins/__init__.py
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins** provides the runtime comnponents of the *Project Flow*:
|
|
6
|
-
the :class:`initialization helpers <proj_flow.api.init.InitStep>` and
|
|
7
|
-
:class:`run steps <proj_flow.api.step.Step>`.
|
|
8
|
-
"""
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.cmake** provides ``"CMake"``, ``"Build"``, ``"Pack"`` and
|
|
6
|
-
``"Test"`` steps, as well as CMake-specific initialization context.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from . import build, config, context, pack, parser, test
|
|
10
|
-
|
|
11
|
-
__all__ = ["build", "config", "context", "pack", "parser", "test"]
|
proj_flow/plugins/cmake/build.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.cmake.build** provides ``"Build"`` step.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import os
|
|
9
|
-
|
|
10
|
-
from proj_flow.api import env, step
|
|
11
|
-
|
|
12
|
-
from .__version__ import CMAKE_VERSION
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@step.register()
|
|
16
|
-
class CMakeBuild:
|
|
17
|
-
"""Builds the project using ``preset`` config."""
|
|
18
|
-
|
|
19
|
-
name = "Build"
|
|
20
|
-
runs_after = ["Conan", "CMake"]
|
|
21
|
-
|
|
22
|
-
def platform_dependencies(self):
|
|
23
|
-
return [f"cmake>={CMAKE_VERSION}"]
|
|
24
|
-
|
|
25
|
-
def is_active(self, config: env.Config, rt: env.Runtime) -> int:
|
|
26
|
-
return os.path.isfile("CMakeLists.txt") and os.path.isfile("CMakePresets.json")
|
|
27
|
-
|
|
28
|
-
def run(self, config: env.Config, rt: env.Runtime) -> int:
|
|
29
|
-
return rt.cmd("cmake", "--build", "--preset", config.preset, "--parallel")
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.cmake.config** provides ``"CMake"`` step.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import os
|
|
9
|
-
from typing import Dict, List, cast
|
|
10
|
-
|
|
11
|
-
from proj_flow import api
|
|
12
|
-
|
|
13
|
-
from .__version__ import CMAKE_VERSION
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@api.step.register
|
|
17
|
-
class CMakeConfig:
|
|
18
|
-
"""Configures the project using ``preset`` config."""
|
|
19
|
-
|
|
20
|
-
name = "CMake"
|
|
21
|
-
runs_after = ["Conan"]
|
|
22
|
-
|
|
23
|
-
def platform_dependencies(self):
|
|
24
|
-
return [f"cmake>={CMAKE_VERSION}"]
|
|
25
|
-
|
|
26
|
-
def is_active(self, config: api.env.Config, rt: api.env.Runtime) -> int:
|
|
27
|
-
return os.path.isfile("CMakeLists.txt") and os.path.isfile("CMakePresets.json")
|
|
28
|
-
|
|
29
|
-
def directories_to_remove(self, config: api.env.Config) -> List[str]:
|
|
30
|
-
return [f"build/{config.build_type}"]
|
|
31
|
-
|
|
32
|
-
def run(self, config: api.env.Config, rt: api.env.Runtime) -> int:
|
|
33
|
-
cmake_vars = cast(Dict[str, str], rt._cfg.get("cmake", {}).get("vars", {}))
|
|
34
|
-
defines: List[str] = []
|
|
35
|
-
for var in cmake_vars:
|
|
36
|
-
value = cmake_vars[var]
|
|
37
|
-
|
|
38
|
-
is_flag = value.startswith("?")
|
|
39
|
-
if is_flag:
|
|
40
|
-
value = value[1:]
|
|
41
|
-
|
|
42
|
-
if value.startswith("config:"):
|
|
43
|
-
value = value[len("config:")]
|
|
44
|
-
value = config.get_path(value)
|
|
45
|
-
elif value.startswith("runtime:"):
|
|
46
|
-
value = value[len("runtime:")]
|
|
47
|
-
value = getattr(rt, value, None)
|
|
48
|
-
|
|
49
|
-
if is_flag:
|
|
50
|
-
value = "ON" if value else "OFF"
|
|
51
|
-
|
|
52
|
-
defines.append(f"-D{var}={value}")
|
|
53
|
-
|
|
54
|
-
return rt.cmd(
|
|
55
|
-
"cmake",
|
|
56
|
-
"--preset",
|
|
57
|
-
f"{config.preset}-{config.build_generator}",
|
|
58
|
-
*defines,
|
|
59
|
-
)
|
proj_flow/plugins/cmake/pack.py
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.cmake.pack** provides ``"Pack"`` step.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import os
|
|
9
|
-
|
|
10
|
-
from proj_flow.api import env, step
|
|
11
|
-
|
|
12
|
-
from .__version__ import CMAKE_VERSION
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@step.register
|
|
16
|
-
class PackStep:
|
|
17
|
-
"""
|
|
18
|
-
Packs archives and installers from ``cpack_generator`` config, using
|
|
19
|
-
``preset`` config.
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
name = "Pack"
|
|
23
|
-
runs_after = ["Build"]
|
|
24
|
-
|
|
25
|
-
def platform_dependencies(self):
|
|
26
|
-
return [f"cmake>={CMAKE_VERSION}", f"cpack>={CMAKE_VERSION}"]
|
|
27
|
-
|
|
28
|
-
def is_active(self, config: env.Config, rt: env.Runtime) -> int:
|
|
29
|
-
return (
|
|
30
|
-
os.path.isfile("CMakeLists.txt")
|
|
31
|
-
and os.path.isfile("CMakePresets.json")
|
|
32
|
-
and len(config.items.get("cpack_generator", [])) > 0
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
def run(self, config: env.Config, rt: env.Runtime) -> int:
|
|
36
|
-
generators = ";".join(config.items.get("cpack_generator", []))
|
|
37
|
-
return rt.cmd("cpack", "--preset", config.preset, "-G", generators)
|
proj_flow/plugins/cmake/test.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.cmake.test** provides ``"Test"`` step.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import os
|
|
9
|
-
|
|
10
|
-
from proj_flow.api import env, step
|
|
11
|
-
|
|
12
|
-
from .__version__ import CMAKE_VERSION
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@step.register
|
|
16
|
-
class CMakeTest:
|
|
17
|
-
"""Runs tests in the project using ``preset`` config."""
|
|
18
|
-
|
|
19
|
-
name = "Test"
|
|
20
|
-
runs_after = ["Build"]
|
|
21
|
-
|
|
22
|
-
def platform_dependencies(self):
|
|
23
|
-
return [f"cmake>={CMAKE_VERSION}", f"ctest>={CMAKE_VERSION}"]
|
|
24
|
-
|
|
25
|
-
def is_active(self, config: env.Config, rt: env.Runtime) -> int:
|
|
26
|
-
return os.path.isfile("CMakeLists.txt") and os.path.isfile("CMakePresets.json")
|
|
27
|
-
|
|
28
|
-
def run(self, config: env.Config, rt: env.Runtime) -> int:
|
|
29
|
-
return rt.cmd("ctest", "--preset", config.preset)
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.commands** package implements various CLI commands.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import sys
|
|
9
|
-
|
|
10
|
-
from proj_flow.base.plugins import load_module_plugins
|
|
11
|
-
|
|
12
|
-
load_module_plugins(sys.modules[__name__])
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.commands.ci** implements ``./flow ci`` command.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from proj_flow.api import arg
|
|
9
|
-
|
|
10
|
-
from . import changelog, matrix, release
|
|
11
|
-
|
|
12
|
-
__all__ = ["changelog", "matrix", "release"]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@arg.command("ci")
|
|
16
|
-
def main():
|
|
17
|
-
"""Perform various CI tasks"""
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
-
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
-
|
|
4
|
-
"""
|
|
5
|
-
The **proj_flow.plugins.commands.ci.changelog** implements
|
|
6
|
-
``./flow ci changelog`` command.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import typing
|
|
10
|
-
|
|
11
|
-
from proj_flow.api import arg, env
|
|
12
|
-
from proj_flow.log import commit, hosting, rich_text
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@arg.command("ci", "changelog")
|
|
16
|
-
def main(
|
|
17
|
-
rt: env.Runtime,
|
|
18
|
-
rst: typing.Annotated[
|
|
19
|
-
bool,
|
|
20
|
-
arg.FlagArgument(help="Use reStructuredText instead of Markdown."),
|
|
21
|
-
],
|
|
22
|
-
rebuild: typing.Annotated[
|
|
23
|
-
bool,
|
|
24
|
-
arg.FlagArgument(
|
|
25
|
-
help="Recreate entire changelog. Useful, when adapting existing project."
|
|
26
|
-
),
|
|
27
|
-
],
|
|
28
|
-
all: typing.Annotated[
|
|
29
|
-
bool, arg.FlagArgument(help="Take all Conventional Commits.")
|
|
30
|
-
],
|
|
31
|
-
):
|
|
32
|
-
generator = rich_text.select_generator(rst=rst)
|
|
33
|
-
|
|
34
|
-
git = commit.Git(rt)
|
|
35
|
-
tags = git.tag_list()
|
|
36
|
-
gh_links = hosting.github.GitHub.from_repo(git)
|
|
37
|
-
|
|
38
|
-
if rebuild:
|
|
39
|
-
generator.create_changelog(tags, git, gh_links, rt, take_all=all)
|
|
40
|
-
return 0
|
|
41
|
-
|
|
42
|
-
prev_tag = tags[-2] if len(tags) > 1 else None
|
|
43
|
-
curr_tag = tags[-1] if len(tags) > 0 else None
|
|
44
|
-
|
|
45
|
-
setup = commit.LogSetup(gh_links, prev_tag, curr_tag, take_all=all)
|
|
46
|
-
log, _ = git.get_log(setup)
|
|
47
|
-
generator.update_changelog(log, setup, rt)
|