diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f1d16ef..3383649 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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' && diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8c5a8cd..9af4d35 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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 diff --git a/nvitop-exporter/requirements.txt b/nvitop-exporter/requirements.txt index 92ff8d6..2b792ce 100644 --- a/nvitop-exporter/requirements.txt +++ b/nvitop-exporter/requirements.txt @@ -1,3 +1,2 @@ -# Sync with pyproject.toml and nvitop/version.py -nvitop == 1.2.0 -prometheus-client +nvitop +prometheus-client >= 0.4.0