Exemple #1
0
    def run(self):
        install.run(self)

        if self.user:
            prefix = path.abspath(get_config_vars('userbase')[0])
        else:
            prefix = path.abspath(get_config_vars('prefix')[0])

        data_dir = path.abspath(check_data_dir())
        man_file = path.join(data_dir, "combirepo.1")

        if not path.exists(man_file):
            self.run_command('build_manpage')
        man_path = path.abspath('{0}/share/man/man1/'.format(prefix))
        if not path.exists(man_path):
            makedirs(man_path)

        print "Installing man page into {0}".format(man_path)
        cmd = "bash -c 'gzip -f {0} \
               && install -m 0644 {0}.gz {1}/'".format(man_file, man_path)
        args = shlex.split(cmd)
        call(args)
Exemple #2
0
            print("Found SWIG: %s (version %s)" % (swig_executable, swig_version))
        return swig_executable, swig_version, swig_valid
    swig_executable, swig_version, swig_valid = get_swig_executable()
    print('swig_version %s, swig_executable %s' % (swig_version, swig_executable))
except BaseException:
    def get_swig_executable():
        return None, None, False
    swig_valid = False

# %% Trick to remove option for c++ code compilation
try:
    # see
    # http://stackoverflow.com/questions/8106258/cc1plus-warning-command-line-option-wstrict-prototypes-is-valid-for-ada-c-o
    from setuptools.py31compat import get_config_vars

    (opt,) = get_config_vars('OPT')

    if not opt is None:
        opt = " ".join(flag for flag in opt.split()
                       if flag != '-Wstrict-prototypes')
        os.environ['OPT'] = opt
except BaseException:
    import setuptools
    print('old version of setuptools: %s' % setuptools.__version__)


# %% Test suite

class OATest(TestCommand):
    """ Run a limited set of tests for the package """
Exemple #3
0
    swig_executable, swig_version, swig_valid = get_swig_executable()
    print('swig_version %s' % swig_version)
except:
    # fallback
    swig_valid = True

if not swig_valid:
    raise Exception('could not find a recent version if SWIG')

#%% Hack to remove option for c++ code
try:
    # see
    # http://stackoverflow.com/questions/8106258/cc1plus-warning-command-line-option-wstrict-prototypes-is-valid-for-ada-c-o
    from setuptools.py31compat import get_path, get_config_vars

    (opt, ) = get_config_vars('OPT')

    if not opt is None:
        opt = " ".join(flag for flag in opt.split()
                       if flag != '-Wstrict-prototypes')
        os.environ['OPT'] = opt
except:
    import setuptools
    print('old version of setuptools: %s' % setuptools.__version__)
    pass

#%% Test suite


class OATest(TestCommand):
    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]