Skip to content

Commit df7ff4d

Browse files
authored
Merge pull request #13 from ika-rwth-aachen/python3p12
Add support for up to Python 3.12 by replacing GPUtil with pynvml
2 parents 7fccd35 + 00744a3 commit df7ff4d

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ jobs:
2929
- name: Build wheel and tarball
3030
run: python3 -m build --sdist --wheel --outdir dist/ ${{ matrix.package }}
3131
- name: Publish to TestPyPI
32-
uses: pypa/gh-action-pypi-publish@v1.8.6
32+
uses: pypa/gh-action-pypi-publish@v1.12.4
3333
with:
3434
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
3535
repository-url: https://test.pypi.org/legacy/
3636
skip-existing: true
37+
verbose: true
3738
- name: Publish to PyPI
3839
if: startsWith(github.ref, 'refs/tags')
3940
uses: pypa/gh-action-pypi-publish@v1.8.6
4041
with:
4142
password: ${{ secrets.PYPI_API_TOKEN }}
4243
skip-existing: true
43-
# `continue-on-error` needed cause `skip-existing: true` is not honored
44-
# https://github.com/pypa/gh-action-pypi-publish/issues/201
45-
continue-on-error: true
44+
verbose: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
<p align="center">
66
<img src="https://img.shields.io/github/license/ika-rwth-aachen/docker-run"/>
7+
<a href="https://pypi.org/project/docker-run-cli/"><img src="https://img.shields.io/badge/python-v3.7--v3.12-blue.svg"/></a>
78
<a href="https://pypi.org/project/docker-run-cli/"><img src="https://img.shields.io/pypi/v/docker-run-cli?label=PyPI"/></a>
89
<a href="https://pypi.org/project/docker-run-cli/"><img src="https://img.shields.io/pypi/dm/docker-run-cli?color=blue&label=PyPI%20downloads"/></a>
910
</p>

docker-run-cli/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "docker-run-cli"
7-
version = "0.9.8"
7+
version = "0.9.9"
88
description = "'docker run' and 'docker exec' with useful defaults"
99
license = {file = "LICENSE"}
1010
readme = "README.md"
@@ -23,14 +23,14 @@ classifiers = [
2323
"Operating System :: POSIX :: Linux",
2424
]
2525
keywords = ["docker", "container"]
26-
dependencies = ["GPUtil~=1.4.0"]
26+
dependencies = ["nvidia-ml-py~=12.570.86"]
2727
requires-python = ">=3.7"
2828

2929
[project.optional-dependencies]
3030
dev = ["build", "twine"]
31-
docker-ros = ["docker-run-docker-ros>=1.0.5"]
32-
plugins = ["docker-run-docker-ros>=1.0.5"]
33-
all = ["docker-run-docker-ros>=1.0.5", "build", "twine"]
31+
docker-ros = ["docker-run-docker-ros>=1.0.6"]
32+
plugins = ["docker-run-docker-ros>=1.0.6"]
33+
all = ["docker-run-docker-ros>=1.0.6", "build", "twine"]
3434

3535
[project.urls]
3636
"Repository" = "https://github.com/ika-rwth-aachen/docker-run"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__name__ = "docker-run"
2-
__version__ = "0.9.8"
2+
__version__ = "0.9.9"

docker-run-cli/src/docker_run/plugins/core.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import tempfile
55
from typing import Any, Dict, List
66

7-
import GPUtil
7+
import pynvml
88

99
from docker_run.utils import log, runCommand
1010
from docker_run.plugins.plugin import Plugin
@@ -87,7 +87,13 @@ def localeFlags(cls) -> List[str]:
8787

8888
@classmethod
8989
def gpuSupportFlags(cls) -> List[str]:
90-
if len(GPUtil.getGPUs()) > 0:
90+
n_gpus = 0
91+
try:
92+
pynvml.nvmlInit()
93+
n_gpus = pynvml.nvmlDeviceGetCount()
94+
except pynvml.NVMLError:
95+
pass
96+
if n_gpus > 0:
9197
if cls.ARCH == "x86_64":
9298
return ["--gpus all"]
9399
elif cls.ARCH == "aarch64" and cls.OS == "Linux":

docker-run-docker-ros/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "docker-run-docker-ros"
7-
version = "1.0.5"
7+
version = "1.0.6"
88
description = "docker-run plugin for Docker images built by docker-ros"
99
license = {file = "LICENSE"}
1010
readme = "README.md"

0 commit comments

Comments
 (0)