moat-src 0.9.0__py3-none-any.whl → 0.9.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.
moat/src/_main.py CHANGED
@@ -9,6 +9,7 @@ import sys
9
9
  from collections import defaultdict, deque
10
10
  from configparser import RawConfigParser
11
11
  from pathlib import Path
12
+ from copy import deepcopy
12
13
 
13
14
  import asyncclick as click
14
15
  import git
@@ -188,7 +189,7 @@ class Package(_Common):
188
189
  lc = self.last_commit
189
190
  except AttributeError:
190
191
  return True
191
- for d in head.diff(self.last_commit, paths=Path("packaging")/self.dash if main else self.path):
192
+ for d in head.diff(self.last_commit, paths=self.path if main else Path("packaging")/self.dash):
192
193
  if (
193
194
  self._repo.repo_for(d.a_path, main) != self.name
194
195
  and self._repo.repo_for(d.b_path, main) != self.name
@@ -224,11 +225,16 @@ class Repo(git.Repo, _Common):
224
225
  self.moat_name = "-".join(p.parts[mi:])
225
226
  with open("versions.yaml") as f:
226
227
  self.versions = yload(f, attr=True)
228
+ self.orig_versions = deepcopy(self.versions)
229
+
227
230
 
228
231
  def write_tags(self):
232
+ if self.versions == self.orig_versions:
233
+ return False
229
234
  with open("versions.yaml", "w") as f:
230
235
  yprint(self.versions, f)
231
236
  self.index.add("versions.yaml")
237
+ return True
232
238
 
233
239
  @property
234
240
  def last_tag(self) -> Tag | None:
@@ -744,11 +750,11 @@ def tag(obj, run, minor, major, subtree, force, FORCE, show, build):
744
750
  r = repo
745
751
 
746
752
  if show:
747
- tag = r.last_tag
753
+ tag = r.vers
748
754
  if r.has_changes():
749
- print(f"{tag} STALE")
755
+ print(f"{tag.tag}-{tag.pkg} STALE")
750
756
  else:
751
- print(tag)
757
+ print(f"{tag.tag}-{tag.pkg}")
752
758
  return
753
759
 
754
760
  if force:
@@ -770,10 +776,11 @@ def tag(obj, run, minor, major, subtree, force, FORCE, show, build):
770
776
  pkg=1,
771
777
  rev=repo.head.commit.hexsha,
772
778
  )
779
+ print(f"{tag}-{sb.vers.pkg}")
773
780
  repo.write_tags()
774
781
  else:
775
782
  git.TagReference.create(repo, tag, force=FORCE)
776
- print(f"{tag}")
783
+ print(f"{tag}")
777
784
  else:
778
785
  print(f"{tag} DRY_RUN")
779
786
 
@@ -902,6 +909,8 @@ async def build(
902
909
  # Step 1: check for changed files since last tagging
903
910
  if autotag:
904
911
  for r in repos:
912
+ if r.name == "moat.src":
913
+ breakpoint()
905
914
  if r.has_changes(True):
906
915
  try:
907
916
  nt = r.next_tag()
@@ -949,7 +958,7 @@ async def build(
949
958
  fails = set()
950
959
  for p in parts:
951
960
  if not run_tests(p, *pytest_opts):
952
- fails.add(p.name)
961
+ fails.add(p)
953
962
  if fails:
954
963
  if not run:
955
964
  print("*** Tests failed:", *fails, file=sys.stderr)
@@ -1070,9 +1079,10 @@ async def build(
1070
1079
  targz = rd / "dist" / f"{r.under}-{tag}.tar.gz"
1071
1080
  done = rd / "dist" / f"{r.under}-{tag}.done"
1072
1081
 
1073
- if targz.is_file():
1074
- if not done.exists():
1075
- up.add(r)
1082
+ if done.exists():
1083
+ pass
1084
+ elif targz.is_file():
1085
+ up.add(r)
1076
1086
  else:
1077
1087
  try:
1078
1088
  subprocess.run(["python3", "-mbuild", "-snw"], cwd=rd, check=True)
@@ -1152,11 +1162,7 @@ async def build(
1152
1162
 
1153
1163
  # Step 8: commit the result
1154
1164
  if run:
1155
- for r in repos:
1156
- r.vers.rev = repo.head.commit.hexsha
1157
- repo.write_tags()
1158
-
1159
- if not no_commit:
1165
+ if repo.write_tags() and not no_commit:
1160
1166
  repo.index.commit(f"Build version {forcetag}")
1161
1167
  git.TagReference.create(repo, forcetag)
1162
1168
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moat-src
3
- Version: 0.9.0
3
+ Version: 0.9.1
4
4
  Summary: Tools for managing the MoaT sources
5
5
  Author-email: Matthias Urlichs <matthias@urlichs.de>
6
6
  Project-URL: homepage, https://m-o-a-t.org
@@ -1,14 +1,14 @@
1
1
  moat/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  moat/src/_cfg.yaml,sha256=bXRcamFBn1VCc7MhGBiWK5ciq4qw6iXyZzRJWvs_m0Q,35
3
- moat/src/_main.py,sha256=sWI450D4sZzPXs3vXE_444kx8_4vKThSJru6a1qu_kY,34903
3
+ moat/src/_main.py,sha256=tT2fvYD0VXvP3bePwHCZV9lQXCrip7vRta-fMbA9dwM,35145
4
4
  moat/src/inspect.py,sha256=rUU-FQyQoQP8LJCebbtdL6lgzz9KPH7KGSq11kD4nmU,1489
5
5
  moat/src/test.py,sha256=rA-YV_VDwtfBk-bzIEa31fk9GHl6V8f4HTXejLoAAbk,2187
6
6
  moat/src/_templates/moat/__init__.py,sha256=ZBoFcXbv35djD599Vo_PKTqDjvQXYYXTcPUs5RcQZrs,101
7
7
  moat/src/_templates/moat/_main.py,sha256=8gLupAmWb5T6wLkQYTi99V1nyaS8cAIccwxHet2ydFw,321
8
8
  moat/src/_templates/packaging/pyproject.default.yaml,sha256=nHUa7dQhe8QpDH9Gbmjflf3BI3ECk2cuXArf0oPCgeg,2801
9
9
  moat/src/_templates/packaging/pyproject.forced.yaml,sha256=djfcy3hgfoIgrn2pRrxDWTyN3EEsA1y5NhkzYrGjgNY,1427
10
- moat_src-0.9.0.dist-info/licenses/LICENSE.txt,sha256=L5vKJLVOg5t0CEEPpW9-O_0vzbP0PEjEF06tLvnIDuk,541
11
- moat_src-0.9.0.dist-info/METADATA,sha256=KZCUXs_GJPXgI9SSg88i4hErM5wiL_sjcHPukyixhjw,733
12
- moat_src-0.9.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
- moat_src-0.9.0.dist-info/top_level.txt,sha256=pcs9fl5w5AB5GVi4SvBqIVmFrkRwQkVw_dEvW0Q0cSA,5
14
- moat_src-0.9.0.dist-info/RECORD,,
10
+ moat_src-0.9.1.dist-info/licenses/LICENSE.txt,sha256=L5vKJLVOg5t0CEEPpW9-O_0vzbP0PEjEF06tLvnIDuk,541
11
+ moat_src-0.9.1.dist-info/METADATA,sha256=79RMw2oRZlqebQqQIsSO8ziG1EKnel9T_6hSz5km7-M,733
12
+ moat_src-0.9.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
+ moat_src-0.9.1.dist-info/top_level.txt,sha256=pcs9fl5w5AB5GVi4SvBqIVmFrkRwQkVw_dEvW0Q0cSA,5
14
+ moat_src-0.9.1.dist-info/RECORD,,