-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Doc fixes and separate workflow for building docs via CI (#3462)
* Use new smart_open compression parameter instead of ignore_ext when possible Keep compatibility with old versions of smart_open just in case. 1.8.1 is required by the deps, 5.1.0 introduced the compression parameter, 6.0.0 dropped the ignore_ext parameter. * Download the NLTK WordNet data before using the WordNet lemmatizer Fixes the docs build for the run_lda.py and run_ensemblelda.py tutorials. * Add missing documentation build dependency scikit-learn The run_compare_lda.py howto and run_word2vec.py tutorial import it. It was removed from docs_testenv when the scikit-learn wrapper was removed. Fixes: commit a21d9cc * Update the order in which the tutorials will be placed Add the ensemblelda and scm tutorials added in 2021. Remove the summarization tutorial as it was removed in 2020. Use the order from the existing prebuilt docs files. Without a defined order they will be placed non-deterministically, which means commits not changing docs will change prebuilt docs. Fixes: commit 76579b3 Fixes: commit ddeeb12 Fixes: commit 2dcaaf8 * Improve the display of the stale prebuilt docs files Print the .md5 file when it is the stale file. Print the source path for each stale file. Print paths relative to the source tree. Print only one stale file pair per line. * Upload the changes to the generated docs to GitHub artifacts Building the docs often takes too long locally, so this allows pull request submitters to build on GitHub, download the changes and incorporate the changes to the generated docs in a commit, then update their pull request with the generated docs commit. Also check that the changes to the prebuilt docs are committed, except for docs that change for every single rebuild. * Update duplicate copies of howtos and tutorials * move action to separate workflow --------- Co-authored-by: Michael Penkov <[email protected]>
- Loading branch information
Showing
15 changed files
with
117 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# This workflow rebuilds documentation and stores the resulting patch as a | ||
# workflow artifact. We can then download the artifact, apply the patch, and | ||
# then push the changes. | ||
# | ||
# It's possible to do all this locally on a developer's machine, but it's not | ||
# trivial, because it requires many pre-requisites. | ||
# | ||
name: Rebuild documentation | ||
on: workflow_dispatch | ||
jobs: | ||
docs: | ||
name: Rebuild documentation | ||
timeout-minutes: 180 | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
# | ||
# We use Py3.8 here for historical reasons. | ||
# | ||
python-version: "3.8" | ||
|
||
- name: Update pip | ||
run: python -m pip install -U pip | ||
|
||
- name: Install apt packages for LaTeX rendering | ||
run: | | ||
sudo apt-get -yq update | ||
sudo apt-get -yq remove texlive-binaries --purge | ||
sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install dvipng texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk | ||
sudo apt-get -yq install build-essential python3.8-dev | ||
- name: Install gensim and its dependencies | ||
run: pip install -e .[docs] | ||
|
||
- name: Build documentation | ||
run: | | ||
python setup.py build_ext --inplace | ||
make -C docs/src clean html | ||
- name: Check changes to prebuilt docs | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Gensim Docs Build" | ||
if ! git diff --quiet @ ; then | ||
git add . | ||
branch="$GITHUB_HEAD_REF ($GITHUB_REF_NAME)" | ||
git commit -m "Import rebuilt documentation for branch $branch" | ||
git format-patch @^ | ||
git bundle create prebuilt-docs-changes.bundle @^...@ | ||
git reset --mixed @^ | ||
git diff --exit-code --stat @ | ||
fi | ||
- name: Upload prebuilt docs changes | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: prebuilt-docs-changes | ||
path: | | ||
*.patch | ||
*.bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ data | |
*.inv | ||
*.js | ||
docs/_images/ | ||
docs/_downloads/ | ||
|
||
# | ||
# Generated by Cython | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7020ef8545a05962fe2d7146b4b95f11 | ||
507b6c07ce76db341761559a96daa17d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
be0c32b18644ebb1a7826764b37ebc01 | ||
9f666b02b1eeac820f2a2200e6d14f6e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0995a15406049093d95974700d471876 | ||
802d286d0c620260af50bf5ef0e08253 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters