Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x GitLab CI中的Docker Python3'keyboard'模块未能使用uinput模块创建设备文件_Python 3.x_Docker_Gitlab_Gitlab Ci - Fatal编程技术网

Python 3.x GitLab CI中的Docker Python3'keyboard'模块未能使用uinput模块创建设备文件

Python 3.x GitLab CI中的Docker Python3'keyboard'模块未能使用uinput模块创建设备文件,python-3.x,docker,gitlab,gitlab-ci,Python 3.x,Docker,Gitlab,Gitlab Ci,我的Python3测试脚本(我想在Docker容器中运行)使用键盘模块 在Docker容器中(具有kbd依赖项),我能够成功地执行Python3keyboard模块方法(例如keyboard.press('a')) 我只能在我运行docker时提供-v”/dev/input:/dev/input“选项时这样做。这会将我的本地/dev/input目录装载到容器的/dev/input目录 如果我不这样做,尝试使用键盘模块方法会导致设备或文件不存在的错误 现在,我想在GitLab CI/CD中自动运行

我的Python3测试脚本(我想在Docker容器中运行)使用
键盘
模块

在Docker容器中(具有
kbd
依赖项),我能够成功地执行Python3
keyboard
模块方法(例如keyboard.press('a'))

我只能在我运行docker时提供
-v”/dev/input:/dev/input“
选项时这样做。这会将我的本地
/dev/input
目录装载到容器的
/dev/input
目录

如果我不这样做,尝试使用
键盘
模块方法会导致设备或文件不存在的错误

现在,我想在GitLab CI/CD中自动运行此测试。我正在使用GitLab提供的共享运行程序。执行此操作时,我的作业将执行,并收到以下警告:

/usr/local/lib/python3.6/dist-packages/keyboard/_nixkeyboard.py:110: UserWarning: Failed to create a device file using `uinput` module. Sending of events may be limited or unavailable depending on plugged-in devices.
  device = aggregate_devices('kbd')
这导致我的脚本失败

我在存储库中提供了一个
config.toml
,它指定了
volumes=[“/dev/input:/dev/input”]
,但是当CI启动我的作业时,行为似乎没有变化

config.toml
是否仅适用于私人托管的GitLab Runner?GitLab文档在这方面不清楚

任何帮助都将不胜感激