Esempio n. 1
0
 def run(self):
     install.run(self)
     before_dir = os.getcwd()
     sys.path.insert(0, self.install_lib)
     from problog import setup as problog_setup
     try:
         problog_setup.install()
     except Exception as err:
         print('Optional ProbLog installation failed: %s' % err,
               file=sys.stderr)
     os.chdir(before_dir)
Esempio n. 2
0
from __future__ import print_function
import sys
import os

version_file = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                            'problog/version.py')

version = {}
with open(version_file) as fp:
    exec(fp.read(), version)
version = version['version']

if __name__ == '__main__' and len(sys.argv) == 1:
    from problog import setup as problog_setup
    problog_setup.install()
elif __name__ == '__main__':

    from setuptools import setup, find_packages
    from setuptools.command.install import install

    class ProbLogInstall(install):
        def run(self):
            install.run(self)
            before_dir = os.getcwd()
            sys.path.insert(0, self.install_lib)
            from problog import setup as problog_setup
            try:
                problog_setup.install()
            except Exception as err:
                print('Optional ProbLog installation failed: %s' % err,