Skip to content

Commit

Permalink
fix(ci): Run pyright postinstall scripts manually
Browse files Browse the repository at this point in the history
Pyright postinstall scripts are as follow (stripped)

```json
    "scripts": {
        "postinstall": "node ./build/skipBootstrap.js || npm run install:others",
        "install:others": "cross-env SKIP_LERNA_BOOTSTRAP=yes lerna exec --no-bail npm install",
    }
```

When running `pybun install` on the pyright repository, bun execute the postinstall
script and replace `npm run install:others` with `bun install:others`.

But since we use pybun, we don't have a `bun` CLI available so the `bun install:others`
command fail.

To fix this, I rewrite the postinstall script to make it use `pybun`
instead of `bun`.
  • Loading branch information
ducdetronquito committed Oct 15, 2024
1 parent a2f03d9 commit 389eaca
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/build_pyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,28 @@ def install_pyright_dependencies(pyright_version: str):
logger.info(f"Install pyright {pyright_version} dependencies")

with chdir(f"./temp/pyright-{pyright_version}"):
return_code = subprocess.call([sys.executable, "-m", "pybun", "install"])
return_code = subprocess.call(
[sys.executable, "-m", "pybun", "install", "--ignore-scripts"]
)
if return_code != 0:
logger.error(f"Failed with code {return_code}")
return sys.exit(return_code)

with chdir(f"./temp/pyright-{pyright_version}"):
return_code = subprocess.call(
[
"pybun",
"run",
"cross-env",
"SKIP_LERNA_BOOTSTRAP=yes",
"lerna",
"exec",
"--no-bail",
"pybun",
"install",
]
)

if return_code != 0:
logger.error(f"Failed with code {return_code}")
return sys.exit(return_code)
Expand Down

0 comments on commit 389eaca

Please sign in to comment.