From ce6ea89c2101d7f8ea7d34cf2cc65eafdb7de708 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 31 Mar 2016 17:28:03 +0200 Subject: [PATCH] Add the missing bootstrappip module --- .../obidistutils/serenity/bootstrappip.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 distutils.ext/obidistutils/serenity/bootstrappip.py diff --git a/distutils.ext/obidistutils/serenity/bootstrappip.py b/distutils.ext/obidistutils/serenity/bootstrappip.py new file mode 100644 index 0000000..01aebdf --- /dev/null +++ b/distutils.ext/obidistutils/serenity/bootstrappip.py @@ -0,0 +1,36 @@ +''' +Created on 22 janv. 2016 + +@author: coissac +''' + +import sys +from urllib import request +import os.path + +from obidistutils.serenity.util import get_serenity_dir +from obidistutils.serenity.rerun import rerun_with_anothe_python +from obidistutils.serenity.checkpython import is_a_virtualenv_python + +getpipurl="https://bootstrap.pypa.io/get-pip.py" + +def bootstrap(): + + getpipfile=os.path.join(get_serenity_dir(),"get-pip.py") + + with request.urlopen(getpipurl) as getpip: + with open(getpipfile,"wb") as out: + for l in getpip: + out.write(l) + + python = sys.executable + + if is_a_virtualenv_python(): + command= "%s %s" % (python,getpipfile) + else: + command= "%s %s --user" % (python,getpipfile) + + os.system(command) + + rerun_with_anothe_python(python) + \ No newline at end of file