Skip to content

Commit c772f2e

Browse files
krisctlprabhakk-mw
authored andcommitted
Adds retries to npm install step to avoid transient rate limiting issues.
Example failure: https://github.com/mathworks/matlab-proxy/actions/runs/17205709807/job/48805769105
1 parent d035da0 commit c772f2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hatch_build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import subprocess
55
from pathlib import Path
6-
from shutil import which, copytree
6+
from shutil import copytree, which
77
from typing import Any, Dict
88

99
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
@@ -23,7 +23,8 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None:
2323
"npm must be installed and on the path during package build!"
2424
)
2525

26-
npm_install = [npm_path, "install"]
26+
# Adding retries to npm install to avoid transient rate limiting issues
27+
npm_install = [npm_path, "install", "--fetch-retries", "10"]
2728
npm_build = [npm_path, "run", "build"]
2829

2930
pwd = Path.cwd()

0 commit comments

Comments
 (0)