Stop using nodeenv (#1178)

Constant downloading of Node & Pyright is flaky and a waste of resources.
This commit is contained in:
Hynek Schlawack 2023-08-17 09:20:45 +02:00 committed by GitHub
parent 8514e22bb8
commit 16dfa9f713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 13 deletions

View File

@ -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:

View File

@ -5,3 +5,8 @@ updates:
directory: /
schedule:
interval: monthly
- package-ecosystem: npm
directory: /
schedule:
interval: monthly

View File

@ -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

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ attrs.docset
attrs.tgz
Justfile
t.py
node_modules

40
package-lock.json generated Normal file
View File

@ -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"
}
}
}
}

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"dependencies": {
"pyright": "^1.1.323"
}
}

12
tox.ini
View File

@ -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