Commit f45ee9fd authored by André Anjos's avatar André Anjos 💬

Merge branch 'conda-test' into 'master'

Allow package to be tested outside of source checkout

See merge request !53
parents 271f1eee 215dfa16
Pipeline #27337 passed with stages
in 35 minutes and 37 seconds
...@@ -24,3 +24,4 @@ browser_test: ...@@ -24,3 +24,4 @@ browser_test:
- apt-get install -y locales > /dev/null - apt-get install -y locales > /dev/null
- echo "en_US UTF-8" > /etc/locale.gen - echo "en_US UTF-8" > /etc/locale.gen
- locale-gen en_US.UTF-8 - locale-gen en_US.UTF-8
- rm -rf ${CI_PROJECT_DIR}/sphinx
{% set name = 'beat.editor' %} {% set name = 'beat.editor' %}
{% set project_dir = environ.get('RECIPE_DIR') + '/..' %}
package: package:
name: {{ name }} name: {{ name }}
...@@ -13,11 +12,15 @@ build: ...@@ -13,11 +12,15 @@ build:
- cd {{ environ.get('RECIPE_DIR') }}/js - cd {{ environ.get('RECIPE_DIR') }}/js
- npm install - npm install
- npm run build - npm run build
- cd {{ project_dir }} - cd {{ environ.get('RECIPE_DIR') + '/..' }}
{% if environ.get('BUILD_EGG') %} {% if environ.get('BUILD_EGG') %}
- python setup.py sdist --formats=zip - python setup.py sdist --formats=zip
{% endif %} {% endif %}
- python setup.py install --single-version-externally-managed --record record.txt - python setup.py install --single-version-externally-managed --record record.txt
# installs the documentation source, readme to share/doc so it is available
# during test time
- install -d "${PREFIX}/share/doc/{{ name }}"
- cp -R README.rst requirements.txt doc "${PREFIX}/share/doc/{{ name }}/"
requirements: requirements:
host: host:
...@@ -59,12 +62,12 @@ test: ...@@ -59,12 +62,12 @@ test:
- beat editor --help - beat editor --help
- beat editor serve --help - beat editor serve --help
- nosetests --with-coverage --cover-package={{ name }} -sv {{ name }} - nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then cd {{ project_dir }}/conda/js; fi - export CHROMIUM_BIN=chromium-browser
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then npm install; fi - if [ -n "${BEAT_BROWSER_TESTS}" ]; then pushd {{ environ.get('RECIPE_DIR') }}/js; npm install; npm test; popd; fi
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then CHROMIUM_BIN=chromium-browser npm test; fi - unset CHROMIUM_BIN
- if [ -n "${BEAT_BROWSER_TESTS}" ]; then cd -; fi - sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc sphinx
- sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx - if [ -n "${CI_PROJECT_DIR}" ]; then mv sphinx "${CI_PROJECT_DIR}/"; fi
- sphinx-build -aEb doctest {{ project_dir }}/doc sphinx - sphinx-build -aEb doctest ${PREFIX}/share/doc/{{ name }}/doc sphinx
- conda inspect linkages -p $PREFIX {{ name }} # [not win] - conda inspect linkages -p $PREFIX {{ name }} # [not win]
- conda inspect objects -p $PREFIX {{ name }} # [osx] - conda inspect objects -p $PREFIX {{ name }} # [osx]
...@@ -73,3 +76,4 @@ about: ...@@ -73,3 +76,4 @@ about:
license: AGPLv3 license: AGPLv3
summary: Local editor for BEAT objects summary: Local editor for BEAT objects
license_family: AGPL license_family: AGPL
license_file: ../LICENSE.AGPL
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # -*- coding: utf-8 -*-
import os import os
import sys
import glob
import pkg_resources import pkg_resources
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
...@@ -58,7 +55,7 @@ autosummary_generate = True ...@@ -58,7 +55,7 @@ autosummary_generate = True
numfig = True numfig = True
# If we are on OSX, the 'dvipng' path maybe different # If we are on OSX, the 'dvipng' path maybe different
dvipng_osx = '/opt/local/libexec/texlive/binaries/dvipng' dvipng_osx = '/Library/TeX/texbin/dvipng'
if os.path.exists(dvipng_osx): pngmath_dvipng = dvipng_osx if os.path.exists(dvipng_osx): pngmath_dvipng = dvipng_osx
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
...@@ -229,20 +226,25 @@ autodoc_default_flags = [ ...@@ -229,20 +226,25 @@ autodoc_default_flags = [
'show-inheritance', 'show-inheritance',
] ]
if not 'BOB_DOCUMENTATION_SERVER' in os.environ:
# notice we need to overwrite this for BEAT projects - defaults from Bob are
# not OK
os.environ['BOB_DOCUMENTATION_SERVER'] = "https://www.idiap.ch/software/beat/docs/beat/%(name)s/%(version)s/|https://www.idiap.ch/software/beat/docs/beat/%(name)s/master/"
# For inter-documentation mapping: # For inter-documentation mapping:
from bob.extension.utils import link_documentation, load_requirements from bob.extension.utils import link_documentation, load_requirements
sphinx_requirements = "extra-intersphinx.txt" sphinx_requirements = "extra-intersphinx.txt"
if os.path.exists(sphinx_requirements): if os.path.exists(sphinx_requirements):
intersphinx_mapping = link_documentation( intersphinx_mapping = link_documentation(
additional_packages=['python','numpy'] + \ additional_packages=['python','numpy'] + \
load_requirements(sphinx_requirements) load_requirements(sphinx_requirements))
)
else: else:
intersphinx_mapping = link_documentation() intersphinx_mapping = link_documentation()
# Adds simplejson, pyzmq links # Adds simplejson, flask links
intersphinx_mapping['http://simplejson.readthedocs.io/en/stable/'] = None intersphinx_mapping['http://simplejson.readthedocs.io/en/stable/'] = None
intersphinx_mapping['http://pyzmq.readthedocs.io/en/stable/'] = None intersphinx_mapping['http://flask.pocoo.org/docs/'] = None
intersphinx_mapping['http://jinja.pocoo.org/docs/'] = None
# We want to remove all private (i.e. _. or __.__) members # We want to remove all private (i.e. _. or __.__) members
# that are not in the list of accepted functions # that are not in the list of accepted functions
...@@ -253,7 +255,8 @@ def member_function_test(app, what, name, obj, skip, options): ...@@ -253,7 +255,8 @@ def member_function_test(app, what, name, obj, skip, options):
if len(name) > 1 and name[0] == '_': if len(name) > 1 and name[0] == '_':
# test if this private function should be allowed # test if this private function should be allowed
if name not in accepted_private_functions: if name not in accepted_private_functions:
# omit privat functions that are not in the list of accepted private functions # omit private functions that are not in the list of accepted private
# functions
return skip return skip
else: else:
# test if the method is documented # test if the method is documented
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment