Python setuptools.command.install() Examples

The following are 11 code examples of setuptools.command.install(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module setuptools.command , or try the search function .
Example #1
Source File: setup.py    From qubes-core-admin with GNU Lesser General Public License v2.1 6 votes vote down vote up
def run(self):
        bin = os.path.join(self.root, "usr/bin")
        try:
            os.makedirs(bin)
        except:
            pass
        for file, pkg in get_console_scripts():
           path = os.path.join(bin, file)
           with open(path, "w") as f:
               f.write(
"""#!/usr/bin/python3
from {} import main
import sys
if __name__ == '__main__':
	sys.exit(main())
""".format(pkg))

           os.chmod(path, 0o755)
        setuptools.command.install.install.run(self) 
Example #2
Source File: setup.py    From qubes-core-admin-client with GNU Lesser General Public License v2.1 6 votes vote down vote up
def run(self):
        bin = os.path.join(self.root, "usr/bin")
        try:
            os.makedirs(bin)
        except:
            pass
        for file, pkg in get_console_scripts():
           path = os.path.join(bin, file)
           with open(path, "w") as f:
               f.write(
"""#!/usr/bin/python3
from {} import main
import sys
if __name__ == '__main__':
	sys.exit(main())
""".format(pkg))

           os.chmod(path, 0o755)
        setuptools.command.install.install.run(self) 
Example #3
Source File: setup.py    From textpipe with MIT License 5 votes vote down vote up
def run(self):
        setuptools.command.install.install.run(self)
        try:
            import spacy
            spacy.cli.validate()
        except ModuleNotFoundError:
            pass 
Example #4
Source File: setup.py    From forest with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def build_js(command_subclass):
    """Decorator to call npm install and npm run build"""
    subclass_run = command_subclass.run
    def run(self):
        self.run_command("build_js")
        subclass_run(self)
    command_subclass.run = run
    return command_subclass 
Example #5
Source File: setup.py    From forest with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def run(self):
        cwd = os.getcwd()
        os.chdir(JS_DIR)
        if not os.path.exists("node_modules"):
            subprocess.check_call(["npm", "install"])
        subprocess.check_call(["npm", "run", "build"])
        os.chdir(cwd)
        super().run() 
Example #6
Source File: setup.py    From LatentGNN-V1-PyTorch with MIT License 5 votes vote down vote up
def run(self):
        create_version_file()
        setuptools.command.install.install.run(self) 
Example #7
Source File: setup.py    From PyEasyArchive with GNU General Public License v2.0 5 votes vote down vote up
def run(self):
        _pre_install()
        setuptools.command.install.install.run(self) 
Example #8
Source File: setup.py    From gluoncv-torch with MIT License 5 votes vote down vote up
def run(self):
        create_version_file()
        setuptools.command.install.install.run(self) 
Example #9
Source File: setup.py    From dragon with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        setuptools.command.install.install.run(self) 
Example #10
Source File: setup.py    From ANTsPy with Apache License 2.0 5 votes vote down vote up
def run(self):
        setuptools.command.install.install.run(self) 
Example #11
Source File: setup.py    From ANTsPy with Apache License 2.0 5 votes vote down vote up
def run(self):
        self.run_command("build_py")
        return setuptools.command.install.install.run(self)