ammaraskar / sphinx-action

Github action that builds docs using sphinx and places errors inline
Apache License 2.0
195 stars 117 forks source link

Class description missing, trouble with pinning python versions for sphinx-action #59

Closed gituser789 closed 6 months ago

gituser789 commented 7 months ago

I ran into some trouble using sphinx-action to include class documentations. The documentation part is inside the class/function definitions inside the package code.

Local build by using sphinx make html image

But when i build the documentation by the provided package, the result is the following: image

According to this answer, i want to include the package as given. https://stackoverflow.com/questions/73033594/github-action-using-wrong-version-of-python

So i added the -e . option in the requirements.txt file for this github action.

The the package to install requires minimum python 3.10.

By using setup-python, the version is pinned to 3.10. The first run pip install -e . works perfect using python 3.10.

When coming to the Build HTML section, with the -e . option, the following error appears.

ERROR: Package 'femmt' requires a different Python: 3.8.2 not in '>=3.10'

It seems like, for this package is python 3.8 used. It is not clear for me, why? When i remove the -e . option inside the requirements.txt, the documentation is bild without the class description as shown as in the second figure.

Do you have any ideas how to use python 3.10 for the build process? Or are there any other ways to overcome this drawback?

here is the build file:

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
    - name: Setup Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.10'
    - uses: actions/checkout@v4
    - name: Install sphinx and build documentation with sphinx
      run: |
        python --version
        pip install sphinx sphinx-multiversion sphinx_rtd_theme sphinxcontrib-email
        pip install -e .
    - name: Build HTML
      uses: ammaraskar/sphinx-action@master
      with:
        docs-folder: "docs/"
gituser789 commented 6 months ago

Fixed by a missing dependency of our package.