class InstallCommand(install):
    user_options = install.user_options + [('someopt', None, None)]

def initialize_options(self):
    install.initialize_options(self)
self.someopt = None

def finalize_options(self):
    install.finalize_options(self)

def run(self):
    pass
How to obtain arguments passed to setup.py from pip with '--install-option'?