From 6d701d2fea07198807351c7c4856001c0f1ebffb Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 20 Jan 2022 09:11:37 +0100 Subject: [PATCH] [fix] ensure that test.pyright installs pyright nodejs.ensure only sets up NVM if there isn't a system-wide installation of Node that matches our NODE_MINIMUM_VERSION. The ubuntu image in the CI comes with an up to date node version, so pyright from .nvm_packages is never installed. This commit fixes this by introducing a package.json file. --- .gitignore | 3 +++ .nvm_packages | 1 - manage | 3 ++- package.json | 5 +++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 package.json diff --git a/.gitignore b/.gitignore index bacf9d7a9..9b3eff158 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ dist/ local/ gh-pages/ *.egg-info/ + +/package-lock.json +/node_modules/ diff --git a/.nvm_packages b/.nvm_packages index fe8585c3b..13eabc5c2 100644 --- a/.nvm_packages +++ b/.nvm_packages @@ -5,5 +5,4 @@ # [1] https://github.com/nvm-sh/nvm#default-global-packages-from-file-while-installing eslint -pyright diff --git a/manage b/manage index aec3906df..45853de3d 100755 --- a/manage +++ b/manage @@ -687,9 +687,10 @@ test.pylint() { test.pyright() { build_msg TEST "[pyright] static type check of python sources" nodejs.ensure + npm install # We run Pyright in the virtual environment because Pyright # executes "python" to determine the Python version. - pyenv.cmd pyright -p pyrightconfig-ci.json + pyenv.cmd npx --no-install pyright -p pyrightconfig-ci.json dump_return $? } diff --git a/package.json b/package.json new file mode 100644 index 000000000..187d17a4b --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "pyright": "^1.1.212" + } +}