Closed copdips closed 1 year ago
I think I found the issue. It should due to cache, as I only cache the folder /opt/hostedtoolcache/Python/3.10.12/x64
, but pyright needs also ~/.cache/pyright-python
. In the CICD pipeline, when the cache is restored successfully, it thinks all the python packages including pyright are restored, but in fact not for ~/.cache/pyright-python
Hello,
I'm using pyright inside a pre-commit, and I encounter some strange error.
I have also enable the cache where the cache source location is :
/opt/hostedtoolcache/Python/3.10.12/x64
where we found all the install python packages.And hereunder a part of my pre-commit file:
pyright is installed in a previsous CI pipeline task by
pip install pyright
The error message is:
```bash ##[section]Starting: Lint code ============================================================================== Task : Command line Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows Version : 2.212.0 Author : Microsoft Corporation Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line ============================================================================== Generating script. Script contents: pre-commit run --all-files ========================== Starting Command Output =========================== [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/95183db4-ecb6-4505-81dd-9a1f9adeecf6.sh [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier@3.0.0-alpha.9-for-vscode. [INFO] Initializing environment for https://github.com/pre-commit/pygrep-hooks. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... check json...........................................(no files to check)Skipped check yaml...............................................................Passed check toml...............................................................Passed fix end of files.........................................................Passed trim trailing whitespace.................................................Passed debug statements (python)................................................Passed fix requirements.txt.....................................................Passed detect private key.......................................................Passed mixed line ending........................................................Passed check for added large files..............................................Passed don't commit to branch...................................................Passed CRLF end-lines checker...................................................Passed CRLF end-lines remover...................................................Passed No-tabs checker..........................................................Passed Tabs remover.............................................................Passed prettier.................................................................Passed check blanket type ignore................................................Passed check for not-real mock methods..........................................Passed use logger.warning(......................................................Passed type annotations not comments............................................Passed bandit...................................................................Passed ruff.....................................................................Passed black....................................................................Passed pyright..................................................................Failed - hook id: pyright - exit code: 1 npm WARN cleanup Failed to remove some directories [ npm WARN cleanup [ npm WARN cleanup undefined, npm WARN cleanup TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined npm WARN cleanup at rm (node:internal/fs/promises:679:38) npm WARN cleanup at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:553:20 npm WARN cleanup at Array.map (