Replace deprecated pynvml with nvidia-ml-py to fix FutureWarning #907
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test installation | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| # ----------------------------------------- | |
| # Use a module from local source | |
| # ----------------------------------------- | |
| use_as_local_module: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ${{ github.event_name == 'workflow_dispatch' && fromJson('["ubuntu-latest","macos-latest","windows-latest"]') || fromJson('["ubuntu-latest"]') }} | |
| python-version: [3.9, '3.10', 3.11, 3.12, 3.13] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install batchflow requirements | |
| run: | | |
| pip install --user -U pip poetry | |
| pip install -e . | |
| - name: Run 'import batchflow' | |
| run: python -c 'import batchflow' | |
| - name: Run basic tests | |
| run: | | |
| pip install pytest | |
| cd batchflow/tests | |
| pytest --disable-pytest-warnings -v dataset_test.py filesindex_test.py datasetindex_test.py | |
| # ----------------------------------------- | |
| # Install with pip | |
| # ----------------------------------------- | |
| install_with_pip: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ${{ github.event_name == 'workflow_dispatch' && fromJson('["ubuntu-latest","macos-latest","windows-latest"]') || fromJson('["ubuntu-latest"]') }} | |
| python-version: [3.9, '3.10', 3.11, 3.12, 3.13] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install batchflow with pip | |
| run: | | |
| pip install --user -U pip wheel | |
| pip install --user "git+https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git@${{ github.head_ref }}" | |
| - name: Run 'import batchflow' | |
| run: python -c 'import batchflow' | |
| - uses: actions/checkout@v4 | |
| - name: Run basic tests | |
| run: | | |
| pip install -U pytest | |
| cd batchflow/tests | |
| pytest --disable-pytest-warnings -v dataset_test.py filesindex_test.py datasetindex_test.py | |
| # ----------------------------------------- | |
| # Install with poetry | |
| # ----------------------------------------- | |
| install_with_poetry: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ${{ github.event_name == 'workflow_dispatch' && fromJson('["ubuntu-latest","macos-latest","windows-latest"]') || fromJson('["ubuntu-latest"]') }} | |
| python-version: [3.9, '3.10', 3.11, 3.12, 3.13] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install batchflow with poetry | |
| run: | | |
| pip install --user -U pip | |
| pip install wheel poetry | |
| echo '[tool.poetry] | |
| name = "test_project" | |
| description = "test" | |
| version = "0.0.1" | |
| authors = ["Test <[email protected]>"] | |
| [tool.poetry.dependencies] | |
| python = "^${{ matrix.python-version }}" | |
| pytest = "^7.0" | |
| [build-system] | |
| requires = ["poetry-core"] | |
| build-backend = "poetry.core.masonry.api" | |
| ' >> pyproject.toml | |
| poetry add git+https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git@${{ github.head_ref }} | |
| - name: Run 'import batchflow' in installed environment | |
| run: poetry run python -c 'import batchflow' | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: src | |
| - name: Prepare directory | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp -r src/batchflow/tests . | |
| - name: Prepare directory | |
| if: runner.os == 'Windows' | |
| run: | | |
| xcopy /I /S src\batchflow\tests tests | |
| - name: Run basic tests | |
| run: | | |
| cd tests | |
| poetry run python -m pytest --disable-pytest-warnings -v dataset_test.py filesindex_test.py datasetindex_test.py | |
| # ----------------------------------------- | |
| # Install with uv | |
| # ----------------------------------------- | |
| install_with_uv: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ${{ github.event_name == 'workflow_dispatch' && fromJson('["ubuntu-latest","macos-latest","windows-latest"]') || fromJson('["ubuntu-latest"]') }} | |
| python-version: [3.9, '3.10', 3.11, 3.12, 3.13] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install batchflow with uv | |
| run: | | |
| pip install --user -U pip | |
| pip install wheel uv | |
| echo '[project] | |
| name = "test_project" | |
| description = "test" | |
| version = "0.0.1" | |
| authors = [{ name = "Test", email = "[email protected]" }] | |
| requires-python = ">=${{ matrix.python-version }}" | |
| dependencies = [ | |
| "pytest>=7.0" | |
| ] | |
| [build-system] | |
| requires = ["hatchling"] | |
| build-backend = "hatchling.build" | |
| [tool.hatch.build.targets.wheel] | |
| packages = ["."] | |
| ' >> pyproject.toml | |
| uv add git+https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git@${{ github.head_ref }} | |
| - name: Run 'import batchflow' in installed environment | |
| run: uv run python -c 'import batchflow' | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: src | |
| - name: Prepare directory | |
| if: runner.os != 'Windows' | |
| run: | | |
| cp -r src/batchflow/tests . | |
| - name: Prepare directory | |
| if: runner.os == 'Windows' | |
| run: | | |
| xcopy /I /S src\batchflow\tests tests | |
| - name: Run basic tests | |
| run: | | |
| cd tests | |
| uv run python -m pytest --disable-pytest-warnings -v dataset_test.py filesindex_test.py datasetindex_test.py |