From 81a3d6caea054f779d68f547c76c8a509fa8554d Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Mon, 2 Nov 2026 12:12:11 +0100 Subject: [PATCH] Install pyright's nodejs runtime for CI typechecking The CI image has no global node, so pyright falls back to running `python -m nodeenv` to download one, which ends up downloading `v27.0.0-alpha.0.0.0`. It then tries parsing that version and fails miserably because it assumes it's going to be `[major].[minor].[patch]`, all ints and calls `int("0-alpha")`. So do what pyright suggests and install `pyright[nodejs]` so it uses its own self contained binary for node. Heavily reduced traceback: ``` ValueError: invalid literal for int() with base 10: '0-alpha' [...] subprocess.CalledProcessError: Command '['/builds/worker/checkouts/vcs/.venv/bin/python', '-m', 'nodeenv', '/builds/worker/.cache/pyright-python/nodeenv']' returned non-zero exit status 1. [...] RuntimeError: nodeenv failed; for more reliable node.js binaries try `pip install pyright[nodejs]` ``` --- pyproject.toml | 2 +- uv.lock | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a056de3..603e95d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dev = [ "pytest-asyncio>=0.21", "pytest-mock>=3.11", "pytest-responses>=0.5", - "pyright>=1.1", + "pyright[nodejs]>=1.1", "responses>=0.23", "tox>=4.11", "tox-uv>=1.28", diff --git a/uv.lock b/uv.lock index b8bcefe..3a4e65b 100644 --- a/uv.lock +++ b/uv.lock @@ -1359,6 +1359,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/c8/12811c9b48fde162bb72b6f2e78fada9a247a09d7bb5be2050a5d099c77b/nodeenv-1.11.0-py2.py3-none-any.whl", hash = "sha256:edaa16e6c14d7cf395d75d4bbd5a26390f4dc06501a33b4e76282b02cc688a25", size = 34277, upload-time = "2026-09-26T11:29:19.933Z" }, ] +[[package]] +name = "nodejs-wheel-binaries" +version = "24.19.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/76/7e97195e14346598565a0de4ca8bdbd5e634b3fb5b1ba590b7b1b89f8a63/nodejs_wheel_binaries-24.19.0.tar.gz", hash = "sha256:db217eef8cab8551667863379b08db4d9067403f6cbbe87481eb40edceb8aa9b", size = 8058, upload-time = "2026-08-19T21:47:19.671Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8c/52/0774b52c7be8151ad9d5aff44edc100c3f13d6d8eb3765f63ffa40e69fe8/nodejs_wheel_binaries-24.19.0-py2.py3-none-macosx_13_0_arm64.whl", hash = "sha256:e12cbfd69089504e42fb14194ce734a9dcf3eb38c820ca63dd511d36fb964e9c", size = 56047203, upload-time = "2026-08-19T21:46:43.448Z" }, + { url = "https://files.pythonhosted.org/packages/67/3a/4fdbbfecf2c23d52c0e3f68de7f7c1b3c97a26d328c69c5f6c49c48e340e/nodejs_wheel_binaries-24.19.0-py2.py3-none-macosx_13_0_x86_64.whl", hash = "sha256:1c890adf4b7e6556ccc1ca66c866bb81884b6c9a581dee4e530dc7f78fb9d514", size = 56219459, upload-time = "2026-08-19T21:46:48.45Z" }, + { url = "https://files.pythonhosted.org/packages/5f/a8/0147149415195c59b8a72a594916bfb80d6be4d586f9fbfda313889e0efc/nodejs_wheel_binaries-24.19.0-py2.py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:4e029dadfae1295876063c96b236f673487e8c27379fe146c1e2250283520227", size = 60588256, upload-time = "2026-08-19T21:46:53.298Z" }, + { url = "https://files.pythonhosted.org/packages/f4/89/6631d0982353da1bb7bc00bb1988f702822c62b42634f57999ee53b5c337/nodejs_wheel_binaries-24.19.0-py2.py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:4196a947bcc883f2003ab101762d729f3e99b5e86b75bd09151563403e2eceb8", size = 61123607, upload-time = "2026-08-19T21:46:58.117Z" }, + { url = "https://files.pythonhosted.org/packages/32/a2/fa30f0841e4602995782e124359f9b910c7b481d98decf61ef0b2fc3ebfb/nodejs_wheel_binaries-24.19.0-py2.py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:352e048ab4dd35e7de5f338d1cc4fcbf77a0e93da30bf7336a8217ee246b31d7", size = 62632842, upload-time = "2026-08-19T21:47:03.42Z" }, + { url = "https://files.pythonhosted.org/packages/18/01/22d97ca72213f66cc386ee638db30c2e62757fdf761c6029074bced83d1c/nodejs_wheel_binaries-24.19.0-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:28d078b2ced9e2069516e652dc4b1380e7a1a7f2d3934eccd1611586d283ba4c", size = 63250653, upload-time = "2026-08-19T21:47:07.938Z" }, + { url = "https://files.pythonhosted.org/packages/88/d1/e3be8fa327a795bcaf7a19cd84299e338a7bce32ff0665fdce9cfa22573c/nodejs_wheel_binaries-24.19.0-py2.py3-none-win_amd64.whl", hash = "sha256:67e3abeb9c3830cae8c8487ae8a2af7cc27dfa75af06145cee5ca7d1857c81bd", size = 42448503, upload-time = "2026-08-19T21:47:12.093Z" }, + { url = "https://files.pythonhosted.org/packages/1d/37/34cf28ba1691a060174948a9927fe61091982d6048b2e403071a9acce443/nodejs_wheel_binaries-24.19.0-py2.py3-none-win_arm64.whl", hash = "sha256:d9074c665ea68b04e183d82482c86dc907d3a9bd15eb6cf85542cb785266bb36", size = 40090155, upload-time = "2026-08-19T21:47:16.032Z" }, +] + [[package]] name = "packaging" version = "26.3" @@ -1675,6 +1691,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d7/ba/18b6e682ead424ad24bcc134339ae5d1b931cd9ae260540592a058a91279/pyright-1.1.414-py3-none-any.whl", hash = "sha256:2a6b4b3298c9eec174c5ed83bd338de6eee82df2992f3e1930e6199d381be36f", size = 6225049, upload-time = "2026-09-10T12:26:51.427Z" }, ] +[package.optional-dependencies] +nodejs = [ + { name = "nodejs-wheel-binaries" }, +] + [[package]] name = "pytest" version = "9.1.1" @@ -1878,7 +1899,7 @@ dependencies = [ dev = [ { name = "aioresponses" }, { name = "coverage" }, - { name = "pyright" }, + { name = "pyright", extra = ["nodejs"] }, { name = "pytest" }, { name = "pytest-aioresponses" }, { name = "pytest-asyncio" }, @@ -1904,7 +1925,7 @@ requires-dist = [ dev = [ { name = "aioresponses", specifier = ">=0.7" }, { name = "coverage", specifier = ">=7.3" }, - { name = "pyright", specifier = ">=1.1" }, + { name = "pyright", extras = ["nodejs"], specifier = ">=1.1" }, { name = "pytest", specifier = ">=7.4" }, { name = "pytest-aioresponses", specifier = ">=0.2" }, { name = "pytest-asyncio", specifier = ">=0.21" },