moat-src 0.8.1__py3-none-any.whl → 0.8.2__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
@@ -94,7 +94,7 @@ class Package(_Common):
94
94
  path:Path = field(init=False,repr=False)
95
95
  files:set(Path) = field(init=False,factory=set,repr=False)
96
96
  subs:dict[str,Package] = field(factory=dict,init=False,repr=False)
97
- hidden:bool = field(init=False)
97
+ hidden:bool = field(init=False,repr=False)
98
98
 
99
99
  def __init__(self, repo, name):
100
100
  self.__attrs_init__(repo,name)
@@ -159,7 +159,10 @@ class Package(_Common):
159
159
  """
160
160
  Return the most-recent tag for this subrepo
161
161
  """
162
- tag,commit = self._repo.versions[self.dash]
162
+ try:
163
+ tag,commit = self._repo.versions[self.dash]
164
+ except KeyError:
165
+ raise KeyError(f"No version for {self.dash} found") from None
163
166
  if unchanged and self.has_changes(commit):
164
167
  raise ChangedError(subsys,t,ref)
165
168
  return tag,commit
@@ -281,7 +284,7 @@ class Repo(git.Repo,_Common):
281
284
  return name
282
285
 
283
286
  if path.parts[0] != "moat":
284
- return name
287
+ return None
285
288
 
286
289
  for p in path.parts[1:]:
287
290
  if p in sc.subs:
@@ -1045,7 +1048,6 @@ async def build(no_commit, no_dirty, no_test, no_tag, no_pypi, parts, dput_opts,
1045
1048
  targz = rd/"dist"/f"{r.under}-{tag}.tar.gz"
1046
1049
  done = rd/"dist"/f"{r.under}-{tag}.done"
1047
1050
  if targz.is_file():
1048
- print(f"{name}: Source package exists.")
1049
1051
  if not done.exists():
1050
1052
  up.add(r)
1051
1053
  else:
@@ -1053,6 +1055,8 @@ async def build(no_commit, no_dirty, no_test, no_tag, no_pypi, parts, dput_opts,
1053
1055
  subprocess.run(["python3", "-mbuild", "-snw"], cwd=rd, check=True)
1054
1056
  except subprocess.CalledProcessError:
1055
1057
  err.add(r.name)
1058
+ else:
1059
+ up.add(r)
1056
1060
  if err:
1057
1061
  if not run:
1058
1062
  print("*** Build errors:", file=sys.stderr)
@@ -1066,7 +1070,7 @@ async def build(no_commit, no_dirty, no_test, no_tag, no_pypi, parts, dput_opts,
1066
1070
  # Step 6: upload PyPI package
1067
1071
  if run:
1068
1072
  err=set()
1069
- for p in up:
1073
+ for r in up:
1070
1074
  rd=PACK/r.dash
1071
1075
  p = rd / "pyproject.toml"
1072
1076
  if not p.is_file():
@@ -1077,10 +1081,10 @@ async def build(no_commit, no_dirty, no_test, no_tag, no_pypi, parts, dput_opts,
1077
1081
  name=name[4:]
1078
1082
  else:
1079
1083
  name="moat-"+r.dash
1080
- targz = Path("dist")/f"{name}-{tag}.tar.gz"
1081
- whl = Path("dist")/f"{name}-{tag}-py3-none-any.whl"
1084
+ targz = Path("dist")/f"{r.under}-{tag}.tar.gz"
1085
+ whl = Path("dist")/f"{r.under}-{tag}-py3-none-any.whl"
1082
1086
  try:
1083
- subprocess.run(["twine", "upload", str(targz), str(whl)], cwd=rd, check=True)
1087
+ res = subprocess.run(["twine", "upload", str(targz), str(whl)], cwd=rd, check=True)
1084
1088
  except subprocess.CalledProcessError:
1085
1089
  err.add(r.name)
1086
1090
  else:
@@ -1099,11 +1103,18 @@ async def build(no_commit, no_dirty, no_test, no_tag, no_pypi, parts, dput_opts,
1099
1103
  dput_opts = ["-u","ext"]
1100
1104
  for r in repos:
1101
1105
  ltag = r.last_tag()[0]
1106
+ if not (PACK/r.dash/"debian").is_dir():
1107
+ continue
1102
1108
  changes = PACK/f"{r.mdash}_{ltag}-1_{ARCH}.changes"
1109
+ done = PACK/f"{r.mdash}_{ltag}-1_{ARCH}.done"
1110
+ if done.exists():
1111
+ continue
1103
1112
  try:
1104
- subprocess.run(["dput", *dput_opts, str(changes)], cwd=PACK, check=True)
1113
+ subprocess.run(["dput", *dput_opts, str(changes)], check=True)
1105
1114
  except subprocess.CalledProcessError:
1106
1115
  err.add(r.name)
1116
+ else:
1117
+ done.touch()
1107
1118
  if err:
1108
1119
  print("Upload errors:", file=sys.stderr)
1109
1120
  print(*err, file=sys.stderr)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moat-src
3
- Version: 0.8.1
3
+ Version: 0.8.2
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
@@ -0,0 +1,9 @@
1
+ moat/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ moat/src/_main.py,sha256=w2LWYzxMK0vzu9ZrykASuHdb3RJiScZQ8WcLRKIibyk,35047
3
+ moat/src/inspect.py,sha256=rUU-FQyQoQP8LJCebbtdL6lgzz9KPH7KGSq11kD4nmU,1489
4
+ moat/src/test.py,sha256=Xn7tIyKt9V0CL_Vt0vauKsZUeNmZTftiHUpnGgk4wyA,2191
5
+ moat_src-0.8.2.dist-info/licenses/LICENSE.txt,sha256=L5vKJLVOg5t0CEEPpW9-O_0vzbP0PEjEF06tLvnIDuk,541
6
+ moat_src-0.8.2.dist-info/METADATA,sha256=DkORkR7ZTGMgSjjLjBLGUPG-wTSqZRVcorLUtUxzICE,733
7
+ moat_src-0.8.2.dist-info/WHEEL,sha256=xcaH6rP_nCxh1LBIPM7Q0uOnzSGjsIye-Q44j_zbzw8,104
8
+ moat_src-0.8.2.dist-info/top_level.txt,sha256=pcs9fl5w5AB5GVi4SvBqIVmFrkRwQkVw_dEvW0Q0cSA,5
9
+ moat_src-0.8.2.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- moat/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- moat/src/_main.py,sha256=JsPNPLDgEtCHnaCF1UlZ6jhygd24vN5iayCGU_UI78o,34686
3
- moat/src/inspect.py,sha256=rUU-FQyQoQP8LJCebbtdL6lgzz9KPH7KGSq11kD4nmU,1489
4
- moat/src/test.py,sha256=Xn7tIyKt9V0CL_Vt0vauKsZUeNmZTftiHUpnGgk4wyA,2191
5
- moat_src-0.8.1.dist-info/licenses/LICENSE.txt,sha256=L5vKJLVOg5t0CEEPpW9-O_0vzbP0PEjEF06tLvnIDuk,541
6
- moat_src-0.8.1.dist-info/METADATA,sha256=pJMaFV-apjHD9OUa3oAzF0Mp-pPqixWAvwws_tOIwS0,733
7
- moat_src-0.8.1.dist-info/WHEEL,sha256=xcaH6rP_nCxh1LBIPM7Q0uOnzSGjsIye-Q44j_zbzw8,104
8
- moat_src-0.8.1.dist-info/top_level.txt,sha256=pcs9fl5w5AB5GVi4SvBqIVmFrkRwQkVw_dEvW0Q0cSA,5
9
- moat_src-0.8.1.dist-info/RECORD,,