Commit c66b7d0b authored by André Anjos's avatar André Anjos 💬
Browse files

Merge branch 'various_fixes' into 'master'

Various fixes

Closes #1 as well.

See merge request !2
parents 9a6f3a67 fa52c419
Pipeline #4582 passed with stages
in 100 minutes and 47 seconds
# This build file is defined in two parts: 1) a generic set of instructions you # This build file heavily uses template features from YAML so it is generic
# probably **don't** need to change and 2) a part you may have to tune to your # enough for any Bob project. Don't modify it unless you know what you're
# project. It heavily uses template features from YAML to help you in only # doing.
# changing a minimal part of it and avoid code duplication to a maximum while
# still providing a nice pipeline display on your package.
# 1) Generic instructions (only change if you know what you're doing)
# -------------------------------------------------------------------
# Definition of our build pipeline # Definition of our build pipeline
stages: stages:
- build - build
- test - test
- docs - docs
- wheels - wheels
- deploy
# Global variables # ---------
variables: # Templates
CONDA_PREFIX: env # ---------
# Template for the build stage # Template for the build stage
# Needs to run on all supported architectures, platforms and python versions # Needs to run on all supported architectures, platforms and python versions
...@@ -27,104 +22,98 @@ variables: ...@@ -27,104 +22,98 @@ variables:
stage: build stage: build
before_script: before_script:
- git clean -ffdx - git clean -ffdx
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/7/raw | tr -d '\r' > bootstrap-conda.sh - mkdir _ci
- chmod 755 ./bootstrap-conda.sh - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
- ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX} - chmod 755 _ci/install.sh
variables: &build_variables - ./_ci/install.sh _ci #updates
BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/" - ./_ci/before_build.sh
script: script:
- ./bin/buildout - ./_ci/build.sh
- if [ -x ./bin/bob_dbmanage.py ]; then ./bin/bob_dbmanage.py all download --force; fi
- ./bin/sphinx-build doc sphinx
- ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG}
after_script: after_script:
- rm -rf ${CONDA_PREFIX} - ./_ci/after_build.sh
artifacts: artifacts:
expire_in: 1 day expire_in: 1 week
paths: paths:
- bootstrap-conda.sh - _ci/
- dist/ - dist/
- sphinx/ - sphinx/
# Template for building on a Linux machine # Template for the test stage - re-installs from uploaded wheels
.build_linux_template: &linux_build_job
<<: *build_job
variables: &linux_build_variables
<<: *build_variables
CONDA_FOLDER: "/local/conda"
CFLAGS: "-D_GLIBCXX_USE_CXX11_ABI=0 -coverage"
CXXFLAGS: "-D_GLIBCXX_USE_CXX11_ABI=0 -coverage"
# Template for building on a Mac OSX machine
.build_mac_template: &macosx_build_job
<<: *build_job
variables: &macosx_build_variables
<<: *build_variables
CONDA_FOLDER: "/opt/conda"
MACOSX_DEPLOYMENT_TARGET: "10.9"
CFLAGS: "-pthread -coverage"
CXXFLAGS: "-pthread -coverage"
LDFLAGS: "-lpthread"
# Template for the test stage - re-install from uploaded wheels
# Needs to run on all supported architectures, platforms and python versions # Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job .test_template: &test_job
stage: test stage: test
before_script: before_script:
- ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX} - ./_ci/install.sh _ci #updates
- source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX} - ./_ci/before_test.sh
- pip install --use-wheel --no-index --pre dist/*.whl
script: script:
- cd ${CONDA_PREFIX} - ./_ci/test.sh
- python -c "from ${CI_PROJECT_NAME} import get_config; print(get_config())"
- coverage run --source=${CI_PROJECT_NAME} ./bin/nosetests -sv ${CI_PROJECT_NAME}
- coverage report
- sphinx-build -b doctest ../doc ../sphinx
after_script: after_script:
- rm -rf ${CONDA_PREFIX} - ./_ci/after_test.sh
# Template for the wheel uploading stage # Template for the wheel uploading stage
# Needs to run against one combination of python 2.x and 3.x if it is a python # Needs to run against one supported architecture, platform and python version
# only package, otherwise, needs to run in both pythons to all supported
# architectures (Linux and Mac OSX 64-bit)
.wheels_template: &wheels_job .wheels_template: &wheels_job
stage: wheels stage: wheels
environment: intranet
only: only:
- master - master
- tags - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
before_script: before_script:
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/8/raw | tr -d '\r' > upload-wheel.sh - ./_ci/install.sh _ci #updates
- chmod 755 upload-wheel.sh - ./_ci/before_wheels.sh
script: script:
- ./upload-wheel.sh - ./_ci/wheels.sh
after_script:
- ./_ci/after_wheels.sh
# Template for (latest) documentation upload stage # Template for (latest) documentation upload stage
# Only one real job needs to do this # Only one real job needs to do this
.docs_template: &docs_job .docs_template: &docs_job
stage: docs stage: docs
environment: intranet
only: only:
- master - master
before_script: before_script:
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/9/raw | tr -d '\r' > upload-sphinx.sh - ./_ci/install.sh _ci #updates
- chmod 755 upload-sphinx.sh - ./_ci/before_docs.sh
script:
- ./_ci/docs.sh
after_script:
- ./_ci/after_docs.sh
# Template for the deployment stage - re-installs from uploaded wheels
# Needs to run on a single architecture only
# Will deploy your package to PyPI and other required services
# Only runs for tags
.deploy_template: &deploy_job
stage: deploy
environment: internet
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- branches
before_script:
- ./_ci/install.sh _ci #updates
- ./_ci/before_deploy.sh
script: script:
- ./upload-sphinx.sh - ./_ci/deploy.sh
after_script:
- ./_ci/after_deploy.sh
# 2) Package specific instructions (you may tune this if needed) # -------------
# -------------------------------------------------------------- # Build Targets
# -------------
# Linux + Python 2.7: Builds, tests, uploads wheel # Linux + Python 2.7: Builds, tests, uploads wheel and deploys (if needed)
build_linux_27: build_linux_27:
<<: *linux_build_job <<: *build_job
variables: &linux_27_build_variables variables: &linux_27_build_variables
<<: *linux_build_variables PYTHON_VERSION: "2.7"
PYTHON_VER: "2.7"
WHEEL_TAG: "py27" WHEEL_TAG: "py27"
tags: tags:
- conda-linux - conda-linux
...@@ -139,6 +128,15 @@ test_linux_27: ...@@ -139,6 +128,15 @@ test_linux_27:
wheels_linux_27: wheels_linux_27:
<<: *wheels_job <<: *wheels_job
variables: *linux_27_build_variables
dependencies:
- build_linux_27
tags:
- conda-linux
deploy_linux_27:
<<: *deploy_job
variables: *linux_27_build_variables
dependencies: dependencies:
- build_linux_27 - build_linux_27
tags: tags:
...@@ -147,10 +145,9 @@ wheels_linux_27: ...@@ -147,10 +145,9 @@ wheels_linux_27:
# Linux + Python 3.4: Builds and tests # Linux + Python 3.4: Builds and tests
build_linux_34: build_linux_34:
<<: *linux_build_job <<: *build_job
variables: &linux_34_build_variables variables: &linux_34_build_variables
<<: *linux_build_variables PYTHON_VERSION: "3.4"
PYTHON_VER: "3.4"
WHEEL_TAG: "py3" WHEEL_TAG: "py3"
tags: tags:
- conda-linux - conda-linux
...@@ -164,12 +161,11 @@ test_linux_34: ...@@ -164,12 +161,11 @@ test_linux_34:
- conda-linux - conda-linux
# Linux + Python 3.5: Builds, tests, uploads wheel # Linux + Python 3.5: Builds, tests and uploads wheel
build_linux_35: build_linux_35:
<<: *linux_build_job <<: *build_job
variables: &linux_35_build_variables variables: &linux_35_build_variables
<<: *linux_build_variables PYTHON_VERSION: "3.5"
PYTHON_VER: "3.5"
WHEEL_TAG: "py3" WHEEL_TAG: "py3"
tags: tags:
- conda-linux - conda-linux
...@@ -184,6 +180,7 @@ test_linux_35: ...@@ -184,6 +180,7 @@ test_linux_35:
wheels_linux_35: wheels_linux_35:
<<: *wheels_job <<: *wheels_job
variables: *linux_35_build_variables
dependencies: dependencies:
- build_linux_35 - build_linux_35
tags: tags:
...@@ -191,6 +188,7 @@ wheels_linux_35: ...@@ -191,6 +188,7 @@ wheels_linux_35:
docs_linux_35: docs_linux_35:
<<: *docs_job <<: *docs_job
variables: *linux_35_build_variables
dependencies: dependencies:
- build_linux_35 - build_linux_35
tags: tags:
...@@ -199,10 +197,9 @@ docs_linux_35: ...@@ -199,10 +197,9 @@ docs_linux_35:
# Mac OSX + Python 2.7: Builds and tests # Mac OSX + Python 2.7: Builds and tests
build_macosx_27: build_macosx_27:
<<: *macosx_build_job <<: *build_job
variables: &macosx_27_build_variables variables: &macosx_27_build_variables
<<: *macosx_build_variables PYTHON_VERSION: "2.7"
PYTHON_VER: "2.7"
WHEEL_TAG: "py27" WHEEL_TAG: "py27"
tags: tags:
- conda-macosx - conda-macosx
...@@ -218,10 +215,9 @@ test_macosx_27: ...@@ -218,10 +215,9 @@ test_macosx_27:
# Mac OSX + Python 3.4: Builds and tests # Mac OSX + Python 3.4: Builds and tests
build_macosx_34: build_macosx_34:
<<: *macosx_build_job <<: *build_job
variables: &macosx_34_build_variables variables: &macosx_34_build_variables
<<: *macosx_build_variables PYTHON_VERSION: "3.4"
PYTHON_VER: "3.4"
WHEEL_TAG: "py3" WHEEL_TAG: "py3"
tags: tags:
- conda-macosx - conda-macosx
...@@ -237,10 +233,9 @@ test_macosx_34: ...@@ -237,10 +233,9 @@ test_macosx_34:
# Mac OSX + Python 3.5: Builds and tests # Mac OSX + Python 3.5: Builds and tests
build_macosx_35: build_macosx_35:
<<: *macosx_build_job <<: *build_job
variables: &macosx_35_build_variables variables: &macosx_35_build_variables
<<: *macosx_build_variables PYTHON_VERSION: "3.5"
PYTHON_VER: "3.5"
WHEEL_TAG: "py3" WHEEL_TAG: "py3"
tags: tags:
- conda-macosx - conda-macosx
...@@ -251,4 +246,4 @@ test_macosx_35: ...@@ -251,4 +246,4 @@ test_macosx_35:
dependencies: dependencies:
- build_macosx_35 - build_macosx_35
tags: tags:
- conda-macosx - conda-macosx
\ No newline at end of file
Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/ Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
Written by Andre Anjos <andre.anjos@idiap.ch> Written by Pedro Tome <pedro.tome@idiap.ch>
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
...@@ -24,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ...@@ -24,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
include README.rst bootstrap-buildout.py buildout.cfg develop.cfg COPYING requirements.txt version.txt include README.rst bootstrap-buildout.py buildout.cfg develop.cfg LICENSE requirements.txt version.txt
recursive-include doc *.py *.rst recursive-include doc *.py *.rst
recursive-include bob *.sql3 recursive-include bob *.sql3
...@@ -39,7 +39,7 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -39,7 +39,7 @@ class Database(bob.db.base.SQLiteDatabase):
Parameters: Parameters:
protocol (str, Optional): One of the UTFVP protocols: protocol (:py:class:`str`, optional): One of the UTFVP protocols:
* ``1vsall`` * ``1vsall``
* ``nom`` * ``nom``
...@@ -50,8 +50,8 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -50,8 +50,8 @@ class Database(bob.db.base.SQLiteDatabase):
* ``nomRightMiddle`` * ``nomRightMiddle``
* ``nomRightRing`` * ``nomRightRing``
groups (str, Optional): ignored (The clients belong both to ``world`` and groups (:py:class:`str`, Optional): ignored (The clients belong both to
``dev``) ``world`` and ``dev``)
Returns Returns
...@@ -88,7 +88,7 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -88,7 +88,7 @@ class Database(bob.db.base.SQLiteDatabase):
Parameters: Parameters:
protocol (str, Optional): One of the UTFVP protocols: protocol (:py:class:`str`, optional): One of the UTFVP protocols:
* ``1vsall`` * ``1vsall``
* ``nom`` * ``nom``
...@@ -99,7 +99,8 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -99,7 +99,8 @@ class Database(bob.db.base.SQLiteDatabase):
* ``nomRightMiddle`` * ``nomRightMiddle``
* ``nomRightRing`` * ``nomRightRing``
groups (str, Optional): Groups the clients belong to. Should be one of: groups (:py:class:`str`, optional): Groups the clients belong to. Should
be one of:
* ``world`` * ``world``
* ``dev`` * ``dev``
...@@ -119,7 +120,7 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -119,7 +120,7 @@ class Database(bob.db.base.SQLiteDatabase):
Parameters: Parameters:
protocol (str, Optional): One of the UTFVP protocols: protocol (:py:class:`str`, optional): One of the UTFVP protocols:
* ``1vsall`` * ``1vsall``
* ``nom`` * ``nom``
...@@ -130,7 +131,8 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -130,7 +131,8 @@ class Database(bob.db.base.SQLiteDatabase):
* ``nomRightMiddle`` * ``nomRightMiddle``
* ``nomRightRing`` * ``nomRightRing``
groups (str, Optional): Groups the clients belong to. Should be one of: groups (:py:class:`str`, optional): Groups the clients belong to. Should
be one of:
* ``dev`` * ``dev``
* ``eval`` * ``eval``
...@@ -161,7 +163,7 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -161,7 +163,7 @@ class Database(bob.db.base.SQLiteDatabase):
Parameters: Parameters:
protocol (str, Optional): One of the UTFVP protocols: protocol (:py:class:`str`, optional): One of the UTFVP protocols:
* ``1vsall`` * ``1vsall``
* ``nom`` * ``nom``
...@@ -172,7 +174,8 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -172,7 +174,8 @@ class Database(bob.db.base.SQLiteDatabase):
* ``nomRightMiddle`` * ``nomRightMiddle``
* ``nomRightRing`` * ``nomRightRing``
groups (str, Optional): Groups the clients belong to. Should be one of: groups (:py:class:`str`, optional): Groups the clients belong to. Should
be one of:
* ``world`` * ``world``
* ``dev`` * ``dev``
...@@ -224,7 +227,8 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -224,7 +227,8 @@ class Database(bob.db.base.SQLiteDatabase):
Parameters: Parameters:
protocol (str, list, Optional): One or several of: protocol (:py:class:`str`, :py:class:`list`, optional): One or several
of:
* ``1vsall`` * ``1vsall``
* ``nom`` * ``nom``
...@@ -235,35 +239,36 @@ class Database(bob.db.base.SQLiteDatabase): ...@@ -235,35 +239,36 @@ class Database(bob.db.base.SQLiteDatabase):
* ``nomRightMiddle`` * ``nomRightMiddle``
* ``nomRightRing`` * ``nomRightRing``
purposes (str, list, Optional): One or several of: purposes (:py:class:`str`, :py:class:`list`, optional): One or several
of:
* ``train`` * ``train``
* ``enroll`` * ``enroll``
* ``probe`` * ``probe``
model_ids (str, list, Optional): Only retrieves the files for the model_ids (:py:class:`str`, :py:class:`list`, optional): Only retrieves
provided list of model ids. If ``None`` is given (this is the default), the files for the provided list of model ids. If ``None`` is given
no filter over the model_ids is performed. (this is the default), no filter over the model_ids is performed.
groups (str, list, Optional): Groups the clients belong to. Should be one groups (:py:class:`str`, :py:class:`list`, optional): Groups the clients
or several of: belong to. Should be one or several of:
* ``world`` * ``world``
* ``dev`` * ``dev``
* ``eval`` * ``eval``
classes (str, list, Optional): The classes (types of accesses) to be classes (:py:class:`str`, :py:class:`list`, optional): The classes (types
retrieved (``client`` or ``impostor``) or a tuple with several of them. of accesses) to be retrieved (``client`` or ``impostor``) or a tuple
If ``None`` is given (this is the default), it is considered the same with several of them. If ``None`` is given (this is the default), it
as a tuple with all possible values. is considered the same as a tuple with all possible values.
finger_ids (str, list, Optional): Only retrieves the files for the finger_ids (:py:class:`str`, :py:class:`list`, optional): Only retrieves
provided list of finger ids. If ``None`` is given (this is the the files for the provided list of finger ids. If ``None`` is given
default), no filter over the finger_ids is performed. (this is the default), no filter over the finger_ids is performed.
session_ids (str, list, Optional): Only retrieves the files for the session_ids (:py:class:`str`, :py:class:`list`, optional): Only retrieves
provided list of session ids. If ``None`` is given (this is the the files for the provided list of session ids. If ``None`` is given
default), no filter over the session_ids is performed. (this is the default), no filter over the session_ids is performed.
Returns: Returns:
......
...@@ -30,9 +30,29 @@ extensions = [ ...@@ -30,9 +30,29 @@ extensions = [
import sphinx import sphinx
if sphinx.__version__ >= "1.4.1": if sphinx.__version__ >= "1.4.1":
extensions.append('sphinx.ext.imgmath') extensions.append('sphinx.ext.imgmath')
imgmath_image_format = 'svg'
else: else:
extensions.append('sphinx.ext.pngmath') extensions.append('sphinx.ext.pngmath')
# Be picky about warnings
nitpicky = True
# Ignores stuff we can't easily resolve on other project's sphinx manuals
nitpick_ignore = []
# Allows the user to override warnings from a separate file
if os.path.exists('nitpick-exceptions.txt'):
for line in open('nitpick-exceptions.txt'):
if line.strip() == "" or line.startswith("#"):
continue
dtype, target = line.split(None, 1)
target = target.strip()
try: # python 2.x
target = unicode(target)
except NameError:
pass
nitpick_ignore.append((dtype, target))
# Always includes todos # Always includes todos
todo_include_todos = True todo_include_todos = True
...@@ -216,8 +236,13 @@ autodoc_default_flags = [ ...@@ -216,8 +236,13 @@ autodoc_default_flags = [
] ]
# For inter-documentation mapping: # For inter-documentation mapping:
from bob.extension.utils import link_documentation from bob.extension.utils import link_documentation, load_requirements
intersphinx_mapping = link_documentation() sphinx_requirements = "extra-intersphinx.txt"
if os.path.exists(sphinx_requirements):
intersphinx_mapping = link_documentation(additional_packages=load_requirements(sphinx_requirements))
else:
intersphinx_mapping = link_documentation()
# 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
......