chore(pre-commit): update pre-commit hooks

This commit is contained in:
Xuehai Pan 2024-12-20 01:08:43 +08:00
parent d2ffb689c3
commit 7edf30c964
3 changed files with 4 additions and 50 deletions

View file

@ -36,7 +36,7 @@ permissions:
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: github.repository == 'XuehaiPan/nvitop'
timeout-minutes: 30
steps:
@ -53,17 +53,6 @@ jobs:
python-version: "3.7 - 3.13"
update-environment: true
- name: Set up Python 3.7
id: py37
uses: actions/setup-python@v5
with:
python-version: "3.7"
update-environment: false
- name: Check syntax (Python 3.7)
run: |
"${{ steps.py37.outputs.python-path }}" -m compileall nvitop
- name: Upgrade build dependencies
run: python -m pip install --upgrade pip setuptools wheel build

View file

@ -15,7 +15,7 @@ permissions:
jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
@ -30,21 +30,6 @@ jobs:
python-version: "3.7 - 3.13"
update-environment: true
- name: Set up Python 3.7
id: py37
uses: actions/setup-python@v5
with:
python-version: "3.7"
update-environment: false
- name: Check syntax (Python 3.7)
run: |
"${{ steps.py37.outputs.python-path }}" -m compileall nvitop
(
cd nvitop-exporter &&
"${{ steps.py37.outputs.python-path }}" -m compileall nvitop_exporter
)
- name: Upgrade pip
run: |
python -m pip install --upgrade pip setuptools
@ -61,16 +46,6 @@ jobs:
python -m nvitop.select --version
python -m nvitop.select --help
- name: Import tests (Python 3.7)
run: |
"${{ steps.py37.outputs.python-path }}" -m pip install --upgrade pip setuptools
"${{ steps.py37.outputs.python-path }}" -m pip install -r requirements.txt
"${{ steps.py37.outputs.python-path }}" -c 'import nvitop'
"${{ steps.py37.outputs.python-path }}" -m nvitop --version
"${{ steps.py37.outputs.python-path }}" -m nvitop --help
"${{ steps.py37.outputs.python-path }}" -m nvitop.select --version
"${{ steps.py37.outputs.python-path }}" -m nvitop.select --help
- name: Install dependencies for nvitop-exporter
run: |
python -m pip install -r nvitop-exporter/requirements.txt
@ -84,16 +59,6 @@ jobs:
python -m nvitop_exporter --help
)
- name: Import tests for nvitop-exporter (Python 3.7)
run: |
(
cd nvitop-exporter &&
"${{ steps.py37.outputs.python-path }}" -m pip install -r requirements.txt &&
"${{ steps.py37.outputs.python-path }}" -c 'import nvitop_exporter' &&
"${{ steps.py37.outputs.python-path }}" -m nvitop_exporter --version &&
"${{ steps.py37.outputs.python-path }}" -m nvitop_exporter --help
)
- name: Install linters
run: |
python -m pip install --upgrade pre-commit pylint[spelling] mypy typing-extensions

View file

@ -25,7 +25,7 @@ repos:
- id: debug-statements
- id: double-quote-string-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
@ -34,7 +34,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus] # sync with requires-python