chore(workflows): update lint workflows

This commit is contained in:
Xuehai Pan 2023-08-18 11:19:42 +00:00
parent fc32f65aa1
commit 2c309cc5ec
3 changed files with 31 additions and 4 deletions

View file

@ -72,8 +72,9 @@ jobs:
python -m venv venv &&
(
source venv/bin/activate &&
python -m pip install --upgrade pip setuptools pre-commit pylint[spelling] mypy typing-extensions
python -m pip install --upgrade pip setuptools pre-commit pylint[spelling] mypy typing-extensions &&
python -m pip install -r requirements.txt &&
python -m pip install -r nvitop-exporter/requirements.txt &&
python -m pre_commit install --install-hooks &&
python -m pre_commit run --all-files &&
python -c 'import nvitop' &&

View file

@ -40,6 +40,10 @@ jobs:
- 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: |
@ -67,6 +71,29 @@ jobs:
"${{ 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
- name: Import tests for nvitop-exporter
run: |
(
cd nvitop-exporter &&
python -c 'import nvitop_exporter' &&
python -m nvitop_exporter --version &&
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

@ -1,3 +1,2 @@
# Sync with pyproject.toml and nvitop/version.py
nvitop == 1.2.0
prometheus-client
nvitop
prometheus-client >= 0.4.0