How to use the setuptools.command.install.install function in setuptools

To help you get started, we’ve selected a few setuptools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github petsc / petsc / setup.py View on Github external
if status != 0: raise RuntimeError(status)

class context(object):
    def __init__(self):
        self.sys_argv = sys.argv[:]
        self.wdir = os.getcwd()
    def enter(self):
        del sys.argv[1:]
        pdir = os.environ['PETSC_DIR']
        os.chdir(pdir)
        return self
    def exit(self):
        sys.argv[:] = self.sys_argv
        os.chdir(self.wdir)

class cmd_install(_install):

    def initialize_options(self):
        _install.initialize_options(self)
        self.optimize = 1

    def finalize_options(self):
        _install.finalize_options(self)
        self.install_lib = self.install_platlib
        self.install_libbase = self.install_lib

    def run(self):
        root_dir = os.path.abspath(self.install_lib)
        prefix = os.path.join(root_dir, 'petsc')
        #
        ctx = context().enter()
        try:
github gipit / gippy / setup.py View on Github external
out = subprocess.check_output(cmd.split(' '))
                log.debug(out)


class _develop(develop):
    def run(self):
        log.debug('_develop run')
        develop.run(self)
        # move lib files into gippy directory
        [shutil.move(f, 'gippy/') for f in glob.glob('*.so')]
        if sysconfig.get_config_var('SOABI') is not None:
            # rename libgip if Python 3.2+
            os.rename(gip_module._file_name, 'gippy/libgip.so')


class _install(install):
    def run(self):
        log.debug('_install run')
        # ensure extension built before packaging
        self.run_command('build_ext')
        install.run(self)


#class _bdist_wheel(bdist_wheel):
    # binary wheel
#    def run(self):
#        log.debug('_bdist_wheel run')
#        self.distribution.ext_modules = [gip_module] + swig_modules
#        self.run_command('build_ext')
#        bdist_wheel.run(self)
github Ashton-Sidhu / aethos / setup.py View on Github external
"itables==0.2.1",
    "selenium==3.141.0",
    "graphviz==0.13.2",
    "pyldavis==2.1.2",
    "swifter==0.302",
    "lightgbm==2.3.1",
    "mlflow==1.7.2",
    "statsmodels==0.11.1",
    "ppscore==0.0.2",
    "autoviz==0.0.68",
]

extras = {"ptmodels": ["transformers==2.3.0", "tensorflow==2.1.0"]}


class VerifyVersionCommand(install):
    """Custom command to verify that the git tag matches our version"""

    description = "verify that the git tag matches our version"

    def run(self):
        tag = os.getenv("CIRCLE_TAG")

        if tag != "v" + VERSION:
            info = "Git tag: {0} does not match the version of this app: {1}".format(
                tag, VERSION
            )
            sys.exit(info)


with open("README.md", "r") as fh:
    long_description = fh.read()
github vsuthichai / paraphraser / setup.py View on Github external
def run(self):
        install.run(self)
        import spacy
        import nltk
        nltk.download('wordnet')
        spacy.cli.download('download', 'en')
github Azure / iotedgedev / setup.py View on Github external
def run(self):
        atexit.register(_execute)
        install.run(self)
github cea-hpc / pcocc / setup.py View on Github external
glob.glob('helpers/examples/*')))
        self.distribution.data_files.append((os.path.join(self.mandir, 'man1'),
                                             glob.glob('docs/build/man/*.1')))
        self.distribution.data_files.append((os.path.join(self.mandir, 'man5'),
                                             glob.glob('docs/build/man/*.5')))
        self.distribution.data_files.append((os.path.join(self.mandir, 'man7'),
                                             glob.glob('docs/build/man/*.7')))

        self.distribution.data_files.append((os.path.join(self.sysconfdir, 'slurm/lua.d'),
                                             ['plugins/slurm/vm-setup.lua']))
        if self.unitdir:
            self.distribution.data_files+=[(self.unitdir, ['dist/pkeyd.service'])]

        self.distribution.data_files += recursive_scan_data_files(self.pkgdocdir, 'docs/build/html/')

        install.finalize_options(self)
github lianghongzhuo / PointNetGPD / meshpy / setup.py View on Github external
"""
Setup of meshpy python codebase
Author: Jeff Mahler
"""
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.develop import develop
import os

class PostDevelopCmd(develop):
    def run(self):
        develop.run(self)

class PostInstallCmd(install):
    def run(self):
        install.run(self)

requirements = [
    'numpy',
    'scipy',
    'sklearn',
    'Pillow',
]

setup(name='meshpy',
    version='0.1.0',
    description='MeshPy project code',
    author='Matt Matl',
    author_email='mmatl@berkeley.edu',
    package_dir = {'': '.'},
github fail2ban / fail2ban / setup.py View on Github external
def finalize_options(self):
		global _2to3
		## in the test cases 2to3 should be already done (fail2ban-2to3):
		if self.disable_2to3:
			_2to3 = False
		if _2to3:
			cmdclass = self.distribution.cmdclass
			cmdclass['build_py'] = build_py_2to3
			cmdclass['build_scripts'] = build_scripts_2to3
		install.finalize_options(self)
	def run(self):
github plasticityai / supersqlite / setup.py View on Github external
def run(self):
        if not(download_and_install_wheel()):
            custom_compile(THIRD_PARTY, INTERNAL)
            install_req_wheels()
            open(BUILT_LOCAL, 'w+').close()
        print("Running install...")
        p = Process(target=install.run, args=(self,))
        p.start()
        p.join()
        print("Done running install")
        if not(download_and_install_wheel()):
            print("Running egg_install...")
            p = Process(target=install.do_egg_install, args=(self,))
            p.start()
            p.join()
            install_requirements()
            print("Done running egg_install")
        else:
            print("Skipping egg_install")
        copy_custom_compile()
github telldus / tellstick-server / lua / setup.py View on Github external
#!/usr/bin/env python
# -*- coding: utf-8 -*-

try:
	from setuptools import setup
	from setuptools.command.install import install
except ImportError:
	from distutils.core import setup
	from distutils.command.install import install
import os

class buildweb(install):
	def run(self):
		print("generate web application")
		os.system('npm install')
		os.system('npm run build')
		install.run(self)

setup(
	name='Lua',
	version='0.1',
	packages=['lua'],
	package_dir = {'':'src'},
	cmdclass={'install': buildweb},
	entry_points={ \
		'telldus.plugins': ['c = lua:Lua [cREQ]']
	},
	extras_require = dict(cREQ = 'Base>=0.1\nTelldus>=0.1\nTelldusWeb>=0.1'),