mct-cli 0.2.9__tar.gz → 0.2.10__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.
@@ -187,7 +187,7 @@ jobs:
187
187
  env:
188
188
  GH_TOKEN: ${{ github.token }}
189
189
  run: |
190
- BOTTLE=$(find . -name "*.bottle.tar.gz" | head -1)
190
+ BOTTLE=$(find . -name "*.bottle*.tar.gz" | head -1)
191
191
  echo "Found bottle: $BOTTLE"
192
192
  gh release upload "${{ steps.version.outputs.tag }}" "$BOTTLE" --repo ${{ github.repository }}
193
193
 
@@ -195,7 +195,7 @@ jobs:
195
195
  uses: actions/upload-artifact@v4
196
196
  with:
197
197
  name: bottle-json-${{ matrix.os }}
198
- path: "**/*.bottle.json"
198
+ path: "**/*.bottle*.json"
199
199
 
200
200
  update-bottle-formula:
201
201
  needs: build-bottles
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mct-cli
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: macOS Configuration Tools
5
5
  Author-email: Oscar Colunga <oscar@ancile.dev>
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mct-cli"
3
- version = "0.2.9"
3
+ version = "0.2.10"
4
4
  authors = [{ name = "Oscar Colunga", email = "oscar@ancile.dev" }]
5
5
  description = "macOS Configuration Tools"
6
6
  readme = "README.md"
@@ -9,25 +9,35 @@ TAG_ORDER = ["arm64_tahoe", "arm64_sequoia"]
9
9
 
10
10
 
11
11
  def collect_bottles(bottles_dir):
12
- """Return {tag: {sha256, cellar}} from all .bottle.json files in the directory."""
13
- bottles = {}
14
- for json_file in Path(bottles_dir).glob("*.bottle.json"):
12
+ """Return (tags, root_url, rebuild) from all .bottle.json files in the directory."""
13
+ tags = {}
14
+ root_url = None
15
+ rebuild = 0
16
+ for json_file in Path(bottles_dir).glob("*.bottle*.json"):
15
17
  data = json.loads(json_file.read_text())
16
18
  for formula_info in data.values():
17
- for tag, tag_data in formula_info["bottle"]["tags"].items():
18
- bottles[tag] = {
19
+ bottle = formula_info["bottle"]
20
+ if root_url is None:
21
+ root_url = bottle.get("root_url")
22
+ rebuild = max(rebuild, bottle.get("rebuild", 0))
23
+ for tag, tag_data in bottle["tags"].items():
24
+ tags[tag] = {
19
25
  "sha256": tag_data["sha256"],
20
26
  "cellar": tag_data.get("cellar", ":any_skip_relocation"),
21
27
  }
22
- return bottles
28
+ return tags, root_url, rebuild
23
29
 
24
30
 
25
- def build_bottle_block(bottles):
31
+ def build_bottle_block(tags, root_url, rebuild):
26
32
  lines = [" bottle do\n"]
33
+ if root_url:
34
+ lines.append(f' root_url "{root_url}"\n')
35
+ if rebuild:
36
+ lines.append(f' rebuild {rebuild}\n')
27
37
  for tag in TAG_ORDER:
28
- if tag in bottles:
29
- cellar = bottles[tag]["cellar"]
30
- sha256 = bottles[tag]["sha256"]
38
+ if tag in tags:
39
+ cellar = tags[tag]["cellar"]
40
+ sha256 = tags[tag]["sha256"]
31
41
  padding = " " * (14 - len(tag))
32
42
  lines.append(f' sha256 cellar: {cellar}, {tag}:{padding}"{sha256}"\n')
33
43
  lines.append(" end\n")
@@ -35,8 +45,8 @@ def build_bottle_block(bottles):
35
45
 
36
46
 
37
47
  def update_formula(formula_path, bottles_dir):
38
- bottles = collect_bottles(bottles_dir)
39
- if not bottles:
48
+ tags, root_url, rebuild = collect_bottles(bottles_dir)
49
+ if not tags:
40
50
  raise RuntimeError(f"No .bottle.json files found in {bottles_dir}")
41
51
 
42
52
  content = Path(formula_path).read_text()
@@ -45,7 +55,7 @@ def update_formula(formula_path, bottles_dir):
45
55
  content = re.sub(r'\n bottle do\n.*? end\n', '\n', content, flags=re.DOTALL)
46
56
 
47
57
  # Insert after license line
48
- bottle_block = "\n" + build_bottle_block(bottles)
58
+ bottle_block = "\n" + build_bottle_block(tags, root_url, rebuild)
49
59
  content = re.sub(r'( license ".*"\n)', r'\1' + bottle_block, content)
50
60
 
51
61
  Path(formula_path).write_text(content)
@@ -37,7 +37,7 @@ wheels = [
37
37
 
38
38
  [[package]]
39
39
  name = "mct-cli"
40
- version = "0.2.9"
40
+ version = "0.2.10"
41
41
  source = { editable = "." }
42
42
  dependencies = [
43
43
  { name = "pyyaml" },
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