From 0f46db1d5f46404abe8e1c0fe956093e22071866 Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Sun, 24 Sep 2017 20:45:16 +0200
Subject: [PATCH] Do not put sphinx docs in the package

---
 gitlab/deploy.sh        | 13 ++++++-------
 templates/gitlab-ci.yml |  1 +
 templates/meta.yaml     | 24 +++++++++---------------
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/gitlab/deploy.sh b/gitlab/deploy.sh
index 62aae11..81c6ab6 100755
--- a/gitlab/deploy.sh
+++ b/gitlab/deploy.sh
@@ -17,13 +17,12 @@ for os in "osx-64" "noarch" "linux-64"; do
   done
 done
 
-# If a package does not build for Linux, $f does not exist.
-# Uploads docs for the last treated package
-run_cmd tar xvfj "${f}" docs/${CI_PROJECT_NAME}
-
-for folder in "${DOC_UPLOADS[@]}"; do
-  dav_upload_folder docs/${CI_PROJECT_NAME} "${folder}"
-done
+# if the sphinx folder exists (usually for Linux Python 3.6), upload the docs.
+if [[ -e sphinx ]]; then
+  for folder in "${DOC_UPLOADS[@]}"; do
+    dav_upload_folder sphinx "${folder}"
+  done
+fi
 
 # Deletes all the old packages if in beta
 if [ -z "${CI_COMMIT_TAG}" ]; then #beta
diff --git a/templates/gitlab-ci.yml b/templates/gitlab-ci.yml
index 1d7d795..36cfa09 100644
--- a/templates/gitlab-ci.yml
+++ b/templates/gitlab-ci.yml
@@ -89,6 +89,7 @@ build_linux_36:
     paths:
       - _ci/
       - dist/*.zip
+      - sphinx
       - ${CONDA_ENVS_PATH}/linux-64/*.tar.bz2
 
 build_macosx_27:
diff --git a/templates/meta.yaml b/templates/meta.yaml
index d01b688..a1ddf21 100644
--- a/templates/meta.yaml
+++ b/templates/meta.yaml
@@ -5,6 +5,7 @@ package:
   version: {{ environ.get('BOB_PACKAGE_VERSION', '0.0.1') }}
 
 build:
+  <ENTRY_POINTS>
   number: {{ environ.get('BOB_BUILD_NUMBER', 0) }}
   script:
     - cd {{ environ.get('CI_PROJECT_DIR', environ.get('RECIPE_DIR') + '/..') }}
@@ -12,42 +13,35 @@ build:
     - python setup.py sdist --formats=zip
     {% endif %}
     - pip install .
-    - sphinx-build -W doc $PREFIX/docs/{{ name }}
 
 requirements:
   build:
     - python
     - setuptools
     - toolchain {{ toolchain }}
-    - sphinx
-    - sphinx_rtd_theme
-    # place extra build dependencies below this line:
-    - <BUILD_DEPS>
+    <BUILD_DEPS>
   run:
     - python
     - setuptools
-    # place runtime dependencies below this line:
-    - <RUN_DEPS>
-
+    <RUN_DEPS>
 
 test:
   imports:
     - {{ name }}
-
   commands:
-    - nosetests --with-coverage -sv {{ name }}
-    # The doctests will run only if "CI_PROJECT_DIR" is available as an
+    <ENTRY_POINTS_TEST>
+    - nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
+    # The sphinx commands will run only if "CI_PROJECT_DIR" is available as an
     # environment variable. If you are testing locally, you can set it to the
     # root of your project.
-    - sphinx-build -b doctest {{ environ.get('CI_PROJECT_DIR') }}/doc sphinx
-
+    - sphinx-build -W {{ environ.get('CI_PROJECT_DIR') }}/doc {{ environ.get('CI_PROJECT_DIR') }}/sphinx
+    - sphinx-build -b doctest {{ environ.get('CI_PROJECT_DIR') }}/doc sphinx-test
   requires:
     - nose
     - coverage
     - sphinx
     - sphinx_rtd_theme
-    # place extra test requirements below this line:
-    - <TEST_DEPS>
+    <TEST_DEPS>
 
 about:
   home: https://www.idiap.ch/software/bob/
-- 
GitLab