Skip to content

Change Travis to use pip3 for installing sphinx - #2124

Merged
SergioRAgostinho merged 1 commit into
PointCloudLibrary:masterfrom
milliams:master
Dec 6, 2017
Merged

Change Travis to use pip3 for installing sphinx#2124
SergioRAgostinho merged 1 commit into
PointCloudLibrary:masterfrom
milliams:master

Conversation

@milliams

@milliams milliams commented Dec 6, 2017

Copy link
Copy Markdown
Contributor

WIP for updating Sphinx to use Python 3

@SergioRAgostinho

SergioRAgostinho commented Dec 6, 2017

Copy link
Copy Markdown
Member

Thanks for this 👍. I tried this yesterday but pip3 failed to complete the installation of sphinxcontrib. Jinja2 failed along the way. Let me post the exact changes to speed up your testing process.

Here's what stopped me yesterday
https://travis-ci.org/PointCloudLibrary/pcl/jobs/312156047#L1538

Here's the instructions to allow you to test things quicker

Changes to travis.yml

diff --git a/.travis.yml b/.travis.yml
index c8887d8..f5512e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,6 +27,7 @@ addons:
       - libvtk5-qt4-dev
       - libglew-dev
       - libopenni-dev
+      - python3-pip
 before_install:
   - bash .travis.sh before-install
 
@@ -58,32 +59,32 @@ env:
 
 jobs:
   include:
-    - stage: Core Build
-      env: TASK="build"
-      compiler: gcc
-      script: bash .travis.sh $TASK
-    - env: TASK="build"
-      compiler: clang
-      script: bash .travis.sh $TASK
-    - stage: Extended Build and Tests
-      compiler: clang
-      env: TASK="build-examples"
-      script: bash .travis.sh $TASK
-    - compiler: clang
-      env: TASK="build-tools"
-      script: bash .travis.sh $TASK
-    - compiler: clang
-      env: TASK="build-apps"
-      script: bash .travis.sh $TASK
+    # - stage: Core Build
+    #   env: TASK="build"
+    #   compiler: gcc
+    #   script: bash .travis.sh $TASK
+    # - env: TASK="build"
+    #   compiler: clang
+    #   script: bash .travis.sh $TASK
+    # - stage: Extended Build and Tests
+    #   compiler: clang
+    #   env: TASK="build-examples"
+    #   script: bash .travis.sh $TASK
+    # - compiler: clang
+    #   env: TASK="build-tools"
+    #   script: bash .travis.sh $TASK
+    # - compiler: clang
+    #   env: TASK="build-apps"
+    #   script: bash .travis.sh $TASK
     - compiler: gcc
       env: TASK="doc"
       script: bash .travis.sh $TASK
-    - compiler: gcc
-      env: TASK="test-core"
-      script: bash .travis.sh $TASK
-    - compiler: gcc
-      env: TASK="test-ext-1"
-      script: bash .travis.sh $TASK
-    - compiler: gcc
-      env: TASK="test-ext-2"
-      script: bash .travis.sh $TASK
+    # - compiler: gcc
+    #   env: TASK="test-core"
+    #   script: bash .travis.sh $TASK
+    # - compiler: gcc
+    #   env: TASK="test-ext-1"
+    #   script: bash .travis.sh $TASK
+    # - compiler: gcc
+    #   env: TASK="test-ext-2"
+    #   script: bash .travis.sh $TASK

changes to .travis.sh

diff --git a/.travis.sh b/.travis.sh
index 226e462..8976ca4 100755
--- a/.travis.sh
+++ b/.travis.sh
@@ -323,9 +323,10 @@ function test_ext_2 ()
 function doc ()
 {
   # Do not generate documentation for pull requests
-  if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then exit; fi
+  # if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then exit; fi
   # Install sphinx
-  pip install --user sphinx pyparsing==2.1.9 sphinxcontrib-doxylink
+  # pip install --user sphinx pyparsing==2.1.9 sphinxcontrib-doxylink
+  pip3 install --user sphinxcontrib-doxylink
   # Configure
   mkdir $BUILD_DIR && cd $BUILD_DIR
   cmake -DDOXYGEN_USE_SHORT_NAMES=OFF \
@@ -334,20 +335,21 @@ function doc ()
         -DWITH_TUTORIALS=ON \
         $PCL_DIR
 
-  git config --global user.email "documentation@pointclouds.org"
-  git config --global user.name "PointCloudLibrary (via TravisCI)"
+  # git config --global user.email "documentation@pointclouds.org"
+  # git config --global user.name "PointCloudLibrary (via TravisCI)"
 
-  if [ -z "$id_rsa_{1..23}" ]; then echo 'No $id_rsa_{1..23} found !' ; exit 1; fi
+  # if [ -z "$id_rsa_{1..23}" ]; then echo 'No $id_rsa_{1..23} found !' ; exit 1; fi
 
-  echo -n $id_rsa_{1..23} >> ~/.ssh/travis_rsa_64
-  base64 --decode --ignore-garbage ~/.ssh/travis_rsa_64 > ~/.ssh/id_rsa
+  # echo -n $id_rsa_{1..23} >> ~/.ssh/travis_rsa_64
+  # base64 --decode --ignore-garbage ~/.ssh/travis_rsa_64 > ~/.ssh/id_rsa
 
-  chmod 600 ~/.ssh/id_rsa
+  # chmod 600 ~/.ssh/id_rsa
 
-  echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
+  # echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
 
   cd $DOC_DIR
-  git clone git@github.com:PointCloudLibrary/documentation.git .
+  # git clone git@github.com:PointCloudLibrary/documentation.git .
+  git clone https://github.com/PointCloudLibrary/documentation.git .
 
   # Generate documentation and tutorials
   cd $BUILD_DIR
@@ -362,7 +364,7 @@ function doc ()
     cd $DOC_DIR
     git add --all
     git commit --amend --reset-author -m "Documentation for commit $TRAVIS_COMMIT" -q
-    git push --force
+    # git push --force
   else
     exit 2
   fi

@SergioRAgostinho

Copy link
Copy Markdown
Member

Worth mentioning this worked for me in Ubuntu 16.04, but apparently not in 14.04.

@milliams

milliams commented Dec 6, 2017

Copy link
Copy Markdown
Contributor Author

Yeah, I realised that once it had started running. I think I've got to the bottom of the issue though.

Tha Jinja error while building is completely ignorable, in fact in newer versions of pip, it would be hidden anyway.

The TypeError: unorderable types: float() > str() is the real problem and is due to a change in how variable comparisons changed in Python 3. In 2 you could compare any two types and most of the time it would give you an answer, even if it made no sense. In 3 it was changed to not allow comparing, e.g., strings and floats. In doc/advanced/content/conf.py the value of needs_sphinx was set to a float rather than a string and so the version comparison was failing.

Once I'm convinced I've fixed it wI will update this PR to have only the appropriate changes in it.

Make sure that needs_sphinx is a str, not a float
@milliams

milliams commented Dec 6, 2017

Copy link
Copy Markdown
Contributor Author

Ok, the last build managed to create the documentation correctly so I have rebased this PR to only have the correct changes. Once this is merged to master it should build the docs without error.

@SergioRAgostinho

Copy link
Copy Markdown
Member

Thanks for all the help :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants