setup.py 2.95 KB
Newer Older
1 2 3
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :

4 5
bob_packages = ['bob.core', 'bob.io.base']

6
from setuptools import setup, find_packages, dist
7
dist.Distribution(dict(setup_requires=['bob.extension', 'bob.blitz'] + bob_packages))
8
from bob.blitz.extension import Extension, build_ext
9

10 11 12
from bob.extension.utils import load_requirements
build_requires = load_requirements()

13 14
version = open("version.txt").read().rstrip()

15 16 17 18 19
# Local include directory
import os
package_dir = os.path.dirname(os.path.realpath(__file__))
include_dir = os.path.join(package_dir, 'bob', 'learn', 'boosting', 'include')

20 21 22
packages = ['boost']
boost_modules = ['system']

23
setup(
24 25
    name='bob.learn.boosting',
    version=version,
26
    description='Boosting framework for Bob',
André Anjos's avatar
André Anjos committed
27 28
    url='https://gitlab.idiap.ch/bob/bob.learn.boosting',
    license='BSD',
29 30
    author='Manuel Guenther (with help of Rakesh Mehta)',
    author_email='manuel.guenther@idiap.ch',
31 32 33 34 35

    long_description=open('README.rst').read(),

    packages=find_packages(),
    include_package_data=True,
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
36
    zip_safe=False,
37

38 39
    setup_requires = build_requires,
    install_requires = build_requires,
40

41
    ext_modules = [
42 43 44 45 46 47
      Extension("bob.learn.boosting.version",
        [
          "bob/learn/boosting/version.cpp",
        ],
        bob_packages = bob_packages,
        version = version,
48 49
        packages = packages,
        boost_modules = boost_modules,
50
        include_dirs=[include_dir],
51
      ),
52

53 54 55
      Extension(
        'bob.learn.boosting._library',
        [
56 57 58 59 60 61 62 63
          "bob/learn/boosting/main.cpp",
          "bob/learn/boosting/loss_function.cpp",
          "bob/learn/boosting/jesorsky_loss.cpp",
          "bob/learn/boosting/weak_machine.cpp",
          "bob/learn/boosting/stump_machine.cpp",
          "bob/learn/boosting/lut_machine.cpp",
          "bob/learn/boosting/boosted_machine.cpp",
          "bob/learn/boosting/lut_trainer.cpp",
André Anjos's avatar
André Anjos committed
64 65

          # old Library components
66 67 68 69 70 71
          "bob/learn/boosting/cpp/LossFunction.cpp",
          "bob/learn/boosting/cpp/JesorskyLoss.cpp",
          "bob/learn/boosting/cpp/StumpMachine.cpp",
          "bob/learn/boosting/cpp/LUTMachine.cpp",
          "bob/learn/boosting/cpp/BoostedMachine.cpp",
          "bob/learn/boosting/cpp/LUTTrainer.cpp",
72
        ],
73 74
        bob_packages = bob_packages,
        version = version,
75 76
        packages = packages,
        boost_modules = boost_modules,
77
        include_dirs=[include_dir],
78
      ),
79 80
    ],

81 82 83
    cmdclass = {
      'build_ext': build_ext
    },
84 85 86

    entry_points={
      'console_scripts': [
87
        'boosting_example.py = bob.learn.boosting.examples.mnist:main',
88
      ],
89
    },
90

André Anjos's avatar
André Anjos committed
91
    # https://pypi.org/classifiers/
92
    classifiers = [
93
      'Framework :: Bob',
André Anjos's avatar
André Anjos committed
94
      'Development Status :: 5 - Production/Stable',
95
      'Intended Audience :: Developers',
André Anjos's avatar
André Anjos committed
96
      'License :: OSI Approved :: BSD License',
97 98 99
      'Natural Language :: English',
      'Programming Language :: Python',
      'Topic :: Scientific/Engineering :: Artificial Intelligence',
100
    ],
101
)