我正在尝试在 GitLab 上部署我的 Sphinx 文档。但它忽略了一些模块。请告诉我我做错了什么。我在我的主机上做了同样的事情并且它可以工作,但是在 gitlab 页面上不想找到一些模块。
gitlab-ci.yaml
# The Docker image that will be used to build your app
image: python:3.12.4-slim
pages:
script:
- apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
- sudo apt-get install python3-sphinx -y
- pip install -U rst-to-myst[sphinx]
- pip install -r requirements.txt
- pip install myst-parser
- pip install sphinxawesome-theme
- pip install autodocsumm
- sphinx-build -b html ./docs/source public
tags:
- linux
artifacts:
paths:
# The folder that contains the files to be exposed at the Page URL
- public
#rules:
# This ensures that only pushes to the default branch will trigger
# a pages deploy
#- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
文档/dource/conf.py
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.abspath('../../va_sdk')))
sys.path.insert(1, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.abspath('../../.')))
import va_sdk
# -- Project information -----------------------------------------------------
project = va_sdk.__name__
release = va_sdk.__version__
# -- General configuration ---------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'myst_parser',
'autodocsumm',
]
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
napoleon_google_docstring = True
napoleon_numpy_docstring = True
autosummary_generate = True
templates_path = ['_templates']
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
html_theme = 'sphinxawesome_theme'
html_static_path = ['_static']
GitLab 页面日志
[path]/edge_sdk/docs/source/md_pages/Документация пакета va_sdk.rst:23: WARNING: autosummary: failed to import va_sdk.components.
Possible hints:
* ModuleNotFoundError: No module named 'va_sdk.va_sdk'
* AttributeError: module 'VA SDK' has no attribute 'components'
* AttributeError: module 'VA SDK' has no attribute 'va_sdk'
* ImportError:
* ImportError: libGL.so.1: cannot open shared object file: No such file or directory
[path]/edge_sdk/docs/source/md_pages/Документация пакета va_sdk.rst:23: WARNING: autosummary: failed to import va_sdk.run.
Possible hints:
* ModuleNotFoundError: No module named 'va_sdk.va_sdk'
* AttributeError: module 'VA SDK' has no attribute 'run'
* AttributeError: module 'VA SDK' has no attribute 'va_sdk'
* ImportError:
* ImportError: libGL.so.1: cannot open shared object file: No such file or directory
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
我注意到,主机在该规格下运行良好。看截图。
树命令标准输出
/
└───edge_sdk
├───config
├───docs
│ ├───images
│ └───topics
├───example
├───logs
├───va_sdk # some additional modules with __init__.py
│ ├───components # some modules with __init__.py
│ │ ├───monitoring # some modules with __init__.py
│ │ └───utils_process # some modules with __init__.py
│ ├───schema # some modules with __init__.py
│ └───utils # some modules with __init__.py
└───tests
├───mockup
├───test_core
├───test_process
└───test_utils
好吧,我找到了解决方案。我不知道
t fully understand, but I imagine that this error was caused by LibGL. So If somebody will have the same problem my
gitlab-ci.yml`是
# The Docker image that will be used to build your app
image: python:3.12.4-slim
pages:
script:
- apt-get update && apt-get install ffmpeg libsm6 libxext6 libgl1 libgl1-mesa-dev -y
- pip install opencv-python-headless
- sudo apt-get install python3-sphinx -y
- pip install -U rst-to-myst[sphinx]
- pip install -r requirements.txt
- pip install myst-parser
- pip install sphinxawesome-theme
- pip install autodocsumm
- pip install -e .
- sphinx-build -b html ./docs/source public
tags:
- linux
artifacts:
paths:
# The folder that contains the files to be exposed at the Page URL
- public
#rules:
# This ensures that only pushes to the default branch will trigger
# a pages deploy
#- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
所以,据我所知,所有依赖项都应该正常工作