Browse Source

Merge pull request #9182 from afshin/rtd-fix

Update RTD build
Afshin Taylor Darian 4 years ago
parent
commit
18bce5ff82
4 changed files with 35 additions and 18 deletions
  1. 17 0
      docs/environment.yml
  2. 0 8
      docs/requirements.txt
  3. 5 2
      readthedocs.yml
  4. 13 8
      scripts/ci_script.sh

+ 17 - 0
docs/environment.yml

@@ -0,0 +1,17 @@
+
+name: jupyterlab_documentation
+channels:
+  - conda-forge
+dependencies:
+- python=3.8
+- sphinx>=1.8
+- sphinx-copybutton
+- sphinx_rtd_theme
+- recommonmark
+- pytest
+- pip
+- nodejs
+- pip:
+  - jsx-lexer
+  - pytest-check-links[cache]>=0.4.3
+  - requests_cache

+ 0 - 8
docs/requirements.txt

@@ -1,8 +0,0 @@
-sphinx>=1.8
-sphinx-copybutton
-sphinx_rtd_theme
-recommonmark
-pytest
-pytest-check-links[cache]>=0.4.3
-jsx-lexer
-requests_cache

+ 5 - 2
readthedocs.yml

@@ -1,8 +1,11 @@
 version: 2
 sphinx:
   configuration: docs/source/conf.py
+conda:
+  environment: docs/environment.yml
 python:
   version: 3.7
   install:
-    # install docs requirements
-    - requirements: docs/requirements.txt
+    # install jupyterlab itself
+    - method: pip
+      path: .

+ 13 - 8
scripts/ci_script.sh

@@ -38,24 +38,27 @@ fi
 
 
 if [[ $GROUP == docs ]]; then
-    # Build the tutorial docs
+    # Build the docs (includes API docs)
     pushd docs
-    pip install -r ./requirements.txt
+    conda env create -f environment.yml
+    conda init --all
+    source $CONDA/bin/activate jupyterlab_documentation
     make html
+    conda deactivate
     popd
-
-    # Build the API docs
-    jlpm build:packages
-    jlpm docs
 fi
 
 if [[ $GROUP == linkcheck ]]; then
-    # Build the tutorial docs
+    # Build the docs
     pushd docs
-    pip install -r ./requirements.txt
+    conda env create -f environment.yml
+    conda init --all
+    source $CONDA/bin/activate jupyterlab_documentation
     make html
     popd
 
+    pip install -e ".[test]"
+
     # Run the link check on the built html files
     CACHE_DIR="${HOME}/.cache/pytest-link-check"
     mkdir -p ${CACHE_DIR}
@@ -70,6 +73,8 @@ if [[ $GROUP == linkcheck ]]; then
     # Run the link check on md files - allow for a link to fail once (--lf means only run last failed)
     args="--check-links --check-links-cache --check-links-cache-expire-after ${LINKS_EXPIRE} --check-links-cache-name ${CACHE_DIR}/cache"
     py.test $args --links-ext .md -k .md . || py.test $args --links-ext .md -k .md --lf .
+
+    conda deactivate
 fi