Skip to content
Snippets Groups Projects
Commit e9f4ed82 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

initial commit

parents
No related branches found
No related tags found
No related merge requests found
*~
*.swp
*.pyc
bin
eggs
parts
.installed.cfg
.mr.developer.cfg
*.egg-info
src
develop-eggs
sphinx
dist
.nfs*
.gdb_history
build
.coverage
record.txt
LICENSE 0 → 100644
Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
Written by Andre Anjos <andre.anjos@idiap.ch>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
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
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include LICENSE README.rst buildout.cfg version.txt
recursive-include doc conf.py *.rst
recursive-include bob *.cpp *.h
recursive-include bob/extension/examples *
recursive-include bob/extension/data *
.. vim: set fileencoding=utf-8 :
===============================================
A package that contains tools to maintain Bob
===============================================
This package is part of the signal-processing and machine learning toolbox
Bob_. It provides some tools to help maintain Bob_.
Installation
------------
This package needs to be installed in your base conda environment. To install
this package, run::
$ conda activate base
# the dependency list below matches the ones in setup.py
$ conda install pip click click-plugins conda-build
$ pip install -e .
Contact
-------
For questions or reporting issues to this software package, contact our
development `mailing list`_.
.. Place your references here:
.. _bob: https://www.idiap.ch/software/bob
.. _mailing list: https://www.idiap.ch/software/bob/discuss
from ..utils.click import raise_on_error
from ..utils.conda import should_skip_build
from click.testing import CliRunner
import click
import conda_build.api as cb
@click.command(context_settings=dict(
ignore_unknown_options=True, allow_extra_args=True),
epilog='''\b
Examples:
$ bob-tools cb-output conda_recipe_dir
$ bob-tools cb-output ../bob.conda/conda/kaldi -m ../bob.admin/gitlab/conda_build_config.yaml --python 3.6
'''
)
@click.argument('recipe_path')
@click.option('-m', '--variant-config-files', help='see conda build --help')
@click.option('--python', help='see conda build --help')
@raise_on_error
def cb_output(recipe_path, variant_config_files, python):
"""Outputs name(s) of package(s) that would be generated by conda build.
This command accepts extra unknown arguments so you can give it the same
arguments that you would give to conda build.
As of now, it only parses -m/--variant_config_files and --python and other
arguments are ignored.
"""
clirunner = CliRunner()
with clirunner.isolation():
# render
config = cb.get_or_merge_config(
None, variant_config_files=variant_config_files, python=python)
metadata_tuples = cb.render(recipe_path, config=config)
# check if build(s) should be skipped
if should_skip_build(metadata_tuples):
return 0
paths = cb.get_output_file_paths(metadata_tuples, config=config)
click.echo('\n'.join(sorted(paths)))
"""This is the main entry to bob_tools's scripts.
"""
import pkg_resources
import click
from click_plugins import with_plugins
@with_plugins(pkg_resources.iter_entry_points('bob_tools.cli'))
@click.group(context_settings=dict(help_option_names=['-?', '-h', '--help']))
def main():
"""The main command line interface for bob tools. Look below for available
commands."""
pass
from functools import wraps
import click
def raise_on_error(view_func):
"""Raise a click exception if returned value is not zero.
Click exits successfully if anything is returned, in order to exit properly
when something went wrong an exception must be raised.
"""
def _decorator(*args, **kwargs):
value = view_func(*args, **kwargs)
if value not in [None, 0]:
exception = click.ClickException("Error occurred")
exception.exit_code = value
raise exception
return value
return wraps(view_func)(_decorator)
def should_skip_build(metadata_tuples):
"""Takes the output of render_recipe as input and evaluates if this
recipe's build should be skipped.
"""
return all(m[0].skip() for m in metadata_tuples)
; vim: set fileencoding=utf-8 :
; Mon 16 Apr 08:29:18 2012 CEST
[buildout]
parts = scripts
develop = .
eggs = bob_tools
newest = false
[scripts]
recipe = bob.buildout:scripts
setup.py 0 → 100644
#!/usr/bin/env python
"""A package that contains tools to maintain Bob
"""
from setuptools import setup, find_packages
# Define package version
version = open("version.txt").read().rstrip()
setup(
name="bob_tools",
version=version,
description="Tools to maintain Bob packages",
url='http://gitlab.idiap.ch/bob/bob_tools',
license="BSD",
author='Bob Developers',
author_email='bob-devel@googlegroups.com',
long_description=open('README.rst').read(),
packages=find_packages(),
include_package_data=True,
zip_safe=False,
# when updating these dependencies, update the README too
install_requires=['setuptools', 'click', 'click-plugins', 'conda_build'],
entry_points={
'console_scripts': [
'bob-tools = bob_tools.scripts.main:main',
],
'bob_tools.cli': [
'cb-output = bob_tools.scripts.cb_output:cb_output',
],
},
classifiers=[
'Framework :: Bob',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
0.1.0b0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment