From 16dfa9f7134d18abf2bc6b2a668611188aa9dd0b Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Thu, 17 Aug 2023 09:20:45 +0200 Subject: [PATCH] Stop using nodeenv (#1178) Constant downloading of Node & Pyright is flaky and a waste of resources. --- .github/CONTRIBUTING.md | 4 ++++ .github/dependabot.yml | 5 +++++ .github/workflows/ci.yml | 4 +--- .gitignore | 1 + package-lock.json | 40 ++++++++++++++++++++++++++++++++++++++++ package.json | 5 +++++ tox.ini | 12 ++---------- 7 files changed, 58 insertions(+), 13 deletions(-) create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 59fff35a..23048a95 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -55,6 +55,10 @@ If you're using tools that understand `.python-version` files like [*pyenv*](htt --- +For our [Pyright](https://github.com/microsoft/pyright) tests, you also need working [Node.js](https://nodejs.org/) and [*npm*](https://www.npmjs.com) installations. + +--- + Then, [fork](https://github.com/python-attrs/attrs/fork) the repository on GitHub. Clone the fork to your computer: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fd898955..68e46acf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,3 +5,8 @@ updates: directory: / schedule: interval: monthly + + - package-ecosystem: npm + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25e77479..9feef788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,9 +164,7 @@ jobs: - coverage - docs - install-dev - # Pyright is currently flaky - # XXX: https://github.com/ekalinin/nodeenv/issues/324 - # - pyright + - pyright runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index b58afd70..51605c71 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ attrs.docset attrs.tgz Justfile t.py +node_modules diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..b801531e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,40 @@ +{ + "name": "attrs", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "pyright": "^1.1.323" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/pyright": { + "version": "1.1.323", + "resolved": "https://registry.npmjs.org/pyright/-/pyright-1.1.323.tgz", + "integrity": "sha512-H6CnGjaL/2lJJPFcV4G0zFP7s7jJPzVsPhQnbnS9m6JWJpb7OssX7y94icPpnZs4574oHergGH2zLvF8OZp5ag==", + "bin": { + "pyright": "index.js", + "pyright-langserver": "langserver.index.js" + }, + "engines": { + "node": ">=12.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..15edd185 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "pyright": "^1.1.323" + } +} diff --git a/tox.ini b/tox.ini index f3ab7c06..104c24cb 100644 --- a/tox.ini +++ b/tox.ini @@ -97,16 +97,8 @@ commands = [testenv:pyright] -# Install and configure node and pyright -# This *could* be folded into a custom install_command -# Use nodeenv to configure node in the running tox virtual environment -# Seeing errors using "nodeenv -p" -# Use npm install -g to install "globally" into the virtual environment -deps = nodeenv -commands_pre = - nodeenv --prebuilt --node=lts --force {envdir} - npm install -g --no-package-lock --no-save pyright - pyright --version +extras = tests +deps = pyright commands = pytest tests/test_pyright.py -vv