mct-cli 0.2.7__tar.gz → 0.2.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mct-cli
3
- Version: 0.2.7
3
+ Version: 0.2.8
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.7"
3
+ version = "0.2.8"
4
4
  authors = [{ name = "Oscar Colunga", email = "oscar@ancile.dev" }]
5
5
  description = "macOS Configuration Tools"
6
6
  readme = "README.md"
@@ -4,6 +4,7 @@ import json
4
4
  import re
5
5
  import subprocess
6
6
  import sys
7
+ import time
7
8
  import urllib.request
8
9
 
9
10
  PACKAGE = "mct-cli"
@@ -23,14 +24,28 @@ def sdist_url_sha256(name, version):
23
24
  raise RuntimeError(f"No sdist for {name}=={version}")
24
25
 
25
26
 
26
- def get_deps(package, version):
27
- """Return {name: version} for all transitive pip deps (excluding the package itself)."""
28
- result = subprocess.run(
29
- [sys.executable, "-m", "pip", "install",
30
- "--dry-run", "--ignore-installed", "--quiet",
31
- "--report", "-", f"{package}=={version}"],
32
- capture_output=True, text=True, check=True,
33
- )
27
+ def get_deps(package, version, retries=20, delay=15):
28
+ """Return {name: version} for all transitive pip deps (excluding the package itself).
29
+
30
+ Retries because pip's simple index propagates slower than the PyPI JSON API.
31
+ """
32
+ for attempt in range(1, retries + 1):
33
+ try:
34
+ result = subprocess.run(
35
+ [sys.executable, "-m", "pip", "install",
36
+ "--dry-run", "--ignore-installed", "--quiet",
37
+ "--report", "-", f"{package}=={version}"],
38
+ capture_output=True, text=True, check=True,
39
+ )
40
+ break
41
+ except subprocess.CalledProcessError as e:
42
+ if attempt == retries:
43
+ print(f"pip stderr:\n{e.stderr}", file=sys.stderr)
44
+ raise
45
+ print(f"pip failed (attempt {attempt}/{retries}), retrying in {delay}s...")
46
+ if e.stderr:
47
+ print(f" {e.stderr.strip()}", file=sys.stderr)
48
+ time.sleep(delay)
34
49
  report = json.loads(result.stdout)
35
50
  pkg_names = {package.lower(), package.replace("-", "_").lower()}
36
51
  return {
@@ -37,7 +37,7 @@ wheels = [
37
37
 
38
38
  [[package]]
39
39
  name = "mct-cli"
40
- version = "0.2.7"
40
+ version = "0.2.8"
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