From 532107b31a4f74cc1937b7a934136cc7c1998442 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Mon, 18 Jan 2021 01:19:38 +0100 Subject: [PATCH] Fix the generation of the Python API docs Reported in issue #373. --- .github/workflows/cpp-python-build.yml | 10 ++++++++-- doc/python/sphinx/conf.py.in | 2 +- python/Doxy2PyDocStrings.py | 4 +--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cpp-python-build.yml b/.github/workflows/cpp-python-build.yml index 6df3e789e0..eff3caaef6 100644 --- a/.github/workflows/cpp-python-build.yml +++ b/.github/workflows/cpp-python-build.yml @@ -263,7 +263,7 @@ jobs: MacOSX: strategy: matrix: - os: [ macos-10.15, macos-11.0 ] + os: [ macos-10.15, ] runs-on: ${{ matrix.os }} steps: - name: Set up Python 3.7 @@ -495,16 +495,22 @@ jobs: with: python-version: '3.6' - name: Install Python packages - run: pip install -U cython sphinx + run: pip install -U cython numpy sphinx - name: Checkout JSBSim uses: actions/checkout@v2 - name: Configure JSBSim run: | mkdir build && cd build cmake -DCMAKE_C_FLAGS_DEBUG="--coverage" -DCMAKE_CXX_FLAGS_DEBUG="--coverage" -DCMAKE_BUILD_TYPE=Debug .. + - name: Download Python wheels + uses: actions/download-artifact@v2 + with: + name: ManyLinux-Wheels.binaries + path: build - name: Build Python docs working-directory: build run: | + pip install jsbsim --no-index -f . touch documentation/html/.nojekyll sphinx-build -b html documentation documentation/html/python - name: Build JSBSim diff --git a/doc/python/sphinx/conf.py.in b/doc/python/sphinx/conf.py.in index db74a3bded..eecc8dfd95 100644 --- a/doc/python/sphinx/conf.py.in +++ b/doc/python/sphinx/conf.py.in @@ -19,7 +19,7 @@ sys.path.insert(0, '${CMAKE_BINARY_DIR}/tests') # -- Project information ----------------------------------------------------- project = u'JSBSim' -copyright = u'2019, ${PROJECT_CONTACT_VENDOR}' +copyright = u'2021, ${PROJECT_CONTACT_VENDOR}' author = u'${PROJECT_CONTACT_VENDOR}' # The short X.Y version diff --git a/python/Doxy2PyDocStrings.py b/python/Doxy2PyDocStrings.py index a57620e8db..bf0c15320b 100644 --- a/python/Doxy2PyDocStrings.py +++ b/python/Doxy2PyDocStrings.py @@ -26,8 +26,6 @@ LASTCOL = 79 -version = '_'+'_'.join('${PROJECT_VERSION}'.split('.')[:2]) - def wrap_last_line(txt, tab): col = txt.rfind('\n'+tab)+len(tab)+1 lastline = txt[col:].strip() @@ -166,7 +164,7 @@ def convert_para(para, indent): while doxytag: names = doxytag.group(1).split('::') - xmlfilename = 'class'+version.join(names[:2])+'.xml' + xmlfilename = 'class'+'_1_1'.join(names[:2])+'.xml' tree = et.parse('${CMAKE_BINARY_DIR}/documentation/xml/'+xmlfilename) root = tree.getroot() docstring = ''