From 514444d8207ea3accccea9fe5d90c6f84bc57cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Thu, 18 Mar 2021 00:57:51 +0100 Subject: [PATCH] Fix pipeline generating python documentation (#7027) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xavier dupré --- docs/python/requirements.txt | 8 ++++++-- .../templates/py-packaging-stage.yml | 8 +++++--- tools/doc/builddoc.sh | 15 +++++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/python/requirements.txt b/docs/python/requirements.txt index 8bfb4e15bd..aa5a537762 100644 --- a/docs/python/requirements.txt +++ b/docs/python/requirements.txt @@ -1,6 +1,10 @@ +autopep8 +matplotlib +scikit-learn +skl2onnx sphinx sphinx-gallery pyquickhelper +sphinxcontrib.imagesvg tensorflow -tensorflow-onnx - +tf2onnx diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 06bbf036dc..6d166b97e5 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -109,6 +109,7 @@ stages: - task: CmdLine@2 displayName: 'Build Python Documentation' + condition: ne(variables['PythonVersion'], '3.9') # tensorflow not available on python 3.9 inputs: script: | mkdir -p $HOME/.onnx @@ -121,14 +122,15 @@ stages: -e NIGHTLY_BUILD \ -e BUILD_BUILDNUMBER \ onnxruntimecpubuild \ - bash /onnxruntime/tools/doc/builddoc.sh $(PythonManylinuxDir)/bin/ $(Build.SourcesDirectory) $(Build.BinariesDirectory) + bash /onnxruntime_src/tools/doc/builddoc.sh $(PythonManylinuxDir)/bin/ /onnxruntime_src /build workingDirectory: $(Build.SourcesDirectory) - task: CopyFiles@2 displayName: 'Copy Python Documentation to: $(Build.ArtifactStagingDirectory)' + condition: ne(variables['PythonVersion'], '3.9') # tensorflow not available on python 3.9 inputs: - SourceFolder: '$(Build.BinariesDirectory)' - Contents: '*.zip' + SourceFolder: '$(Build.BinariesDirectory)/docs/html' + Contents: '**' TargetFolder: '$(Build.ArtifactStagingDirectory)' - task: PublishBuildArtifacts@1 diff --git a/tools/doc/builddoc.sh b/tools/doc/builddoc.sh index c478c6faaa..39440b8985 100644 --- a/tools/doc/builddoc.sh +++ b/tools/doc/builddoc.sh @@ -2,8 +2,15 @@ # $1 python path # $2 source folder # $3 build folder +echo "----" +echo $1 +echo $2 +echo $3 +echo "----" +ls $3/Release +echo "----" $1/python -m pip install -r $2/docs/python/requirements.txt -export PYTHONPATH=$3/Release/Release:$PYTHONPATH -$1/python -m sphinx -j2 -v -T -b html -d $3/docs/_doctrees/html $2/docs/python $3/docs/html -$1/python -u rename_folders.py $3/docs/html -zip -r $3/python_doc.zip $3/docs/html \ No newline at end of file +export PYTHONPATH=$3/Release:$PYTHONPATH +$1/python -m sphinx -j1 -v -T -b html -d $3/docs/_doctrees/html $2/docs/python $3/docs/html +$1/python -u $2/tools/doc/rename_folders.py $3/docs/html +# zip -r $3/python_doc.zip $3/docs/html \ No newline at end of file