proj-flow 0.22.0__py3-none-any.whl → 0.22.1__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 +1 -1
- proj_flow/log/release.py +7 -4
- proj_flow/minimal/ext/bug_report.py +6 -4
- proj_flow/minimal/ext/versions.py +48 -0
- {proj_flow-0.22.0.dist-info → proj_flow-0.22.1.dist-info}/METADATA +1 -1
- {proj_flow-0.22.0.dist-info → proj_flow-0.22.1.dist-info}/RECORD +9 -8
- {proj_flow-0.22.0.dist-info → proj_flow-0.22.1.dist-info}/WHEEL +0 -0
- {proj_flow-0.22.0.dist-info → proj_flow-0.22.1.dist-info}/entry_points.txt +0 -0
- {proj_flow-0.22.0.dist-info → proj_flow-0.22.1.dist-info}/licenses/LICENSE +0 -0
proj_flow/__init__.py
CHANGED
proj_flow/log/release.py
CHANGED
|
@@ -18,13 +18,16 @@ OneOrMoreStrings = Union[str, Iterable[str]]
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class VersionUpdater:
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
def on_version_change(
|
|
23
|
+
self, rt: env.Runtime, new_version: str
|
|
24
|
+
) -> Optional[OneOrMoreStrings]:
|
|
22
25
|
return None
|
|
23
26
|
|
|
24
27
|
def on_version_change_tags(
|
|
25
|
-
self, new_version: str, tags: list[str]
|
|
28
|
+
self, rt: env.Runtime, new_version: str, tags: list[str]
|
|
26
29
|
) -> Optional[OneOrMoreStrings]:
|
|
27
|
-
return self.on_version_change(new_version)
|
|
30
|
+
return self.on_version_change(rt, new_version)
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
version_updaters = registry.Registry[VersionUpdater]("VersionUpdater")
|
|
@@ -118,7 +121,7 @@ def add_release(
|
|
|
118
121
|
files_to_commit.append(version_path)
|
|
119
122
|
|
|
120
123
|
for updater in version_updaters.get():
|
|
121
|
-
modified = updater.on_version_change_tags(next_version, tags)
|
|
124
|
+
modified = updater.on_version_change_tags(rt, next_version, tags)
|
|
122
125
|
if modified is None:
|
|
123
126
|
continue
|
|
124
127
|
elif isinstance(modified, str):
|
|
@@ -8,14 +8,14 @@ next to CHANGELOG.rst.
|
|
|
8
8
|
|
|
9
9
|
import re
|
|
10
10
|
import sys
|
|
11
|
-
from typing import List, Tuple
|
|
12
11
|
|
|
12
|
+
from proj_flow.api import env
|
|
13
13
|
from proj_flow.log import release
|
|
14
14
|
|
|
15
15
|
YAML_PATH = ".github/ISSUE_TEMPLATE/bug_report.yaml"
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def _version(ver: str) ->
|
|
18
|
+
def _version(ver: str) -> tuple[int, int, int, str]:
|
|
19
19
|
if ver[:1] == "v":
|
|
20
20
|
ver = ver[1:]
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ def _version(ver: str) -> Tuple[int, int, int, str]:
|
|
|
26
26
|
return (int(m.group(1)), int(m.group(2)), int(m.group(3)), ver)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def _prev_version(new_version: str, tags:
|
|
29
|
+
def _prev_version(new_version: str, tags: list[str]):
|
|
30
30
|
current = _version(new_version)
|
|
31
31
|
versions = [_version(tag) for tag in reversed(tags)]
|
|
32
32
|
index = 0
|
|
@@ -44,7 +44,9 @@ def _prev_version(new_version: str, tags: List[str]):
|
|
|
44
44
|
|
|
45
45
|
@release.version_updaters.add
|
|
46
46
|
class VersionUpdater(release.VersionUpdater):
|
|
47
|
-
def on_version_change_tags(
|
|
47
|
+
def on_version_change_tags(
|
|
48
|
+
self, rt: env.Runtime, new_version: str, tags: list[str]
|
|
49
|
+
):
|
|
48
50
|
old_version = _prev_version(new_version, tags)
|
|
49
51
|
|
|
50
52
|
range = [f" - Current (v{new_version})\n"]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Copyright (c) 2025 Marcin Zdun
|
|
2
|
+
# This code is licensed under MIT license (see LICENSE for details)
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
The **proj_flow.minimal.ext.versions** update version schema files from version-updates
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import cast
|
|
10
|
+
|
|
11
|
+
from proj_flow.api import env
|
|
12
|
+
from proj_flow.log import release
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@release.version_updaters.add
|
|
16
|
+
class VersionUpdater(release.VersionUpdater):
|
|
17
|
+
def on_version_change_tags(
|
|
18
|
+
self, rt: env.Runtime, new_version: str, tags: list[str]
|
|
19
|
+
) -> release.OneOrMoreStrings | None:
|
|
20
|
+
if not tags:
|
|
21
|
+
return None
|
|
22
|
+
prev_tag = tags[-1]
|
|
23
|
+
old_version = prev_tag[1:] if prev_tag.startswith("v") else prev_tag
|
|
24
|
+
|
|
25
|
+
files = cast(dict[str, str], rt._cfg.get("version-updates", {}))
|
|
26
|
+
changed_files: list[str] = []
|
|
27
|
+
|
|
28
|
+
rt.message("Config")
|
|
29
|
+
for key, value in files.items():
|
|
30
|
+
if "$VERSION" not in value:
|
|
31
|
+
continue
|
|
32
|
+
|
|
33
|
+
path = Path(key)
|
|
34
|
+
previous = value.replace("$VERSION", old_version)
|
|
35
|
+
next = value.replace("$VERSION", new_version)
|
|
36
|
+
rt.message(f" >> {key} :: {previous} -> {next}")
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
content = path.read_text(encoding="UTF-8")
|
|
40
|
+
except FileNotFoundError:
|
|
41
|
+
rt.fatal(f"File not found: {key}")
|
|
42
|
+
|
|
43
|
+
new_content = content.replace(previous, next)
|
|
44
|
+
if new_content != content:
|
|
45
|
+
path.write_text(new_content, encoding="UTF-8")
|
|
46
|
+
changed_files.append(key)
|
|
47
|
+
|
|
48
|
+
return changed_files
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: proj-flow
|
|
3
|
-
Version: 0.22.
|
|
3
|
+
Version: 0.22.1
|
|
4
4
|
Summary: C++ project maintenance, automated
|
|
5
5
|
Project-URL: Changelog, https://github.com/mzdun/proj-flow/blob/main/CHANGELOG.rst
|
|
6
6
|
Project-URL: Documentation, https://proj-flow.readthedocs.io/en/latest/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
proj_flow/__init__.py,sha256=
|
|
1
|
+
proj_flow/__init__.py,sha256=7tP0EcGLKC5fwA3PTFj4xAYTAJtwRuR1CO_ZEs1F_Sg,277
|
|
2
2
|
proj_flow/__main__.py,sha256=HUar_qQ9Ndmchmryegtzu__5wukwCLrFN_SGRl5Ol_M,233
|
|
3
3
|
proj_flow/dependency.py,sha256=f2wjr_F7Cy_3I4R5AfT6R9Q28F3G3WrLKbqyEld_CF0,4765
|
|
4
4
|
proj_flow/api/__init__.py,sha256=gV2f6kll_5JXtvkGASvnx7CbOWr34PHOdck-4ce-qEk,378
|
|
@@ -90,7 +90,7 @@ proj_flow/log/error.py,sha256=65Nvhfs_d1xSY4EB-ISdWgjotvg-on3iKjhAWHpsBYM,841
|
|
|
90
90
|
proj_flow/log/fmt.py,sha256=o14aO3iEt5_KKp9SqcfkscqbMKuTI83NBoSXHcrb7Kg,330
|
|
91
91
|
proj_flow/log/format.py,sha256=gp1kUoW0nYj5e7Ysu1c29Fh2ssfE1KBSDIYeUbhzN9g,333
|
|
92
92
|
proj_flow/log/msg.py,sha256=zARmRZHFV3yG-fBnx00wal4Y0O5aGnL-6XcGwNBNKA4,6758
|
|
93
|
-
proj_flow/log/release.py,sha256=
|
|
93
|
+
proj_flow/log/release.py,sha256=h3DI7yqTjrnVIlbyfVyrsxQ4GDO9OXiAJKpn3esCL-Y,4520
|
|
94
94
|
proj_flow/log/hosting/__init__.py,sha256=9Teyw8jJcxeWH2MegqYEgW0n5OmSAWC7FFJj2u_UcrM,278
|
|
95
95
|
proj_flow/log/hosting/github.py,sha256=O2BdB50vzVSKKIu3qNEYBiBdEUIPqj6C2xVvGAKjTZ4,9123
|
|
96
96
|
proj_flow/log/rich_text/__init__.py,sha256=D3Y2jy9xlGgnQZdNC_ekoLzQtwkF_NTgLqDTWPvSRUk,279
|
|
@@ -104,7 +104,8 @@ proj_flow/minimal/init.py,sha256=-ZNzhPFqAgZFAuN5hYOJFuFy_wHkPzjeSk90G2GUQfk,436
|
|
|
104
104
|
proj_flow/minimal/list.py,sha256=FIp49D0BW2UcOggibP_-5Ar1Ao_UmERMqHMDxNO7fRQ,8338
|
|
105
105
|
proj_flow/minimal/run.py,sha256=ASYisLyhPGVuDcaRIiZ5K7dtuaHXVihDskRSuveLccM,4702
|
|
106
106
|
proj_flow/minimal/system.py,sha256=9FliH5TD103JYSAe2O5EU7hkOHDgVzTqu0Exxk-WrXE,1579
|
|
107
|
-
proj_flow/minimal/ext/bug_report.py,sha256=
|
|
107
|
+
proj_flow/minimal/ext/bug_report.py,sha256=YxaS0LjSPaDQARuhQUVSCqe4URIOa4VIhKfzDJqCcYA,2341
|
|
108
|
+
proj_flow/minimal/ext/versions.py,sha256=nj_AMnDKbDnHF55UtPc0aX0F8MGQOM12DkCgNGjJb-4,1539
|
|
108
109
|
proj_flow/project/__init__.py,sha256=AROrwhbuMR5rJE-HC769eL4IXrMLQYpQb3HgpkOAYqg,293
|
|
109
110
|
proj_flow/project/api.py,sha256=j0j3UBWi8vwGLIScSL7t2fWUr2-ezAilYkc1FM-EfYM,2103
|
|
110
111
|
proj_flow/project/data.py,sha256=TluhBDoJEYL4dnyTpInmhQ49Uvf8mkWmpU-YMLQPNhE,317
|
|
@@ -168,8 +169,8 @@ proj_flow/template/licenses/MIT.mustache,sha256=NncPoQaNsuy-WmRmboik3fyhJJ8m5pc2
|
|
|
168
169
|
proj_flow/template/licenses/Unlicense.mustache,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
|
169
170
|
proj_flow/template/licenses/WTFPL.mustache,sha256=lvF4V_PrKKfZPa2TC8CZo8tlqaKvs3Bpv9G6XsWWQ4k,483
|
|
170
171
|
proj_flow/template/licenses/Zlib.mustache,sha256=uIj-mhSjes2HJ3rRapyy2ALflKRz4xQgS4mVM9827C0,868
|
|
171
|
-
proj_flow-0.22.
|
|
172
|
-
proj_flow-0.22.
|
|
173
|
-
proj_flow-0.22.
|
|
174
|
-
proj_flow-0.22.
|
|
175
|
-
proj_flow-0.22.
|
|
172
|
+
proj_flow-0.22.1.dist-info/METADATA,sha256=dWZixZZDgrrewFkhT7yvGMRoYUIdGtVKdtDkek58UbM,3472
|
|
173
|
+
proj_flow-0.22.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
174
|
+
proj_flow-0.22.1.dist-info/entry_points.txt,sha256=d_OmGKZzpY7FCWz0sZ4wnBAPZC75oMEzTgJZWtpDELo,49
|
|
175
|
+
proj_flow-0.22.1.dist-info/licenses/LICENSE,sha256=vpOQJ5QlrTedF3coEWvA4wJzVJH304f66ZitR7Od4iU,1068
|
|
176
|
+
proj_flow-0.22.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|