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

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