runner.py 431 B

123456789101112131415161718
  1. import sys
  2. import os
  3. def run():
  4. base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  5. ## FIXME: this is kind of crude; if we could create a fake pip
  6. ## module, then exec into it and update pip.__path__ properly, we
  7. ## wouldn't have to update sys.path:
  8. sys.path.insert(0, base)
  9. import pip
  10. return pip.main()
  11. if __name__ == '__main__':
  12. exit = run()
  13. if exit:
  14. sys.exit(exit)