Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
24
Issues
24
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools
Commits
2dc7c55b
Commit
2dc7c55b
authored
Nov 13, 2014
by
Eric Coissac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
parent
bc0378b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
checkpip.py
distutils.ext/obidistutils/serenity/checkpip.py
+10
-10
No files found.
distutils.ext/obidistutils/serenity/checkpip.py
View file @
2dc7c55b
...
...
@@ -36,12 +36,16 @@ def is_pip_installed(minversion=PIP_MINVERSION):
ok
=
False
log
.
info
(
"A too old version of pip is installed on your system"
)
for
m
in
[
x
for
x
in
sys
.
modules
if
x
.
startswith
(
'pip.'
or
x
==
'pip'
)]:
# We clean up the imported pip module for test purpose
for
m
in
[
x
for
x
in
sys
.
modules
if
x
.
startswith
(
'pip.'
)]:
del
sys
.
modules
[
m
]
del
sys
.
modules
[
'pip'
]
except
Exception
,
e
:
ok
=
False
log
.
info
(
"No pip installed on your system"
)
log
.
info
(
"No pip installed on your system"
)
return
ok
...
...
@@ -57,8 +61,7 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
if
'http_proxy'
in
os
.
environ
and
'https_proxy'
not
in
os
.
environ
:
os
.
environ
[
'https_proxy'
]
=
os
.
environ
[
'http_proxy'
]
pipinstallscript
=
urllib2
.
urlopen
(
'https://bootstrap.pypa.io/get-pip.py'
)
except
Exception
,
e
:
print
(
str
(
e
))
except
:
raise
DistutilsError
,
"Pip (>=
%
s) is not install on your system and I cannot install it"
%
PIP_MINVERSION
script
=
pipinstallscript
.
read
()
...
...
@@ -72,7 +75,6 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
ZIPFILE
=
getpip
.
ZIPFILE
pip_zip
=
os
.
path
.
join
(
tmpdir
,
"pip.zip"
)
print
pip_zip
with
open
(
pip_zip
,
"wb"
)
as
fp
:
log
.
info
(
"Installing temporary pip..."
)
fp
.
write
(
base64
.
decodestring
(
ZIPFILE
))
...
...
@@ -84,11 +86,10 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
pip
=
zi
.
load_module
(
"pip"
)
else
:
import
pip
pip
=
importlib
.
import_module
(
'pip'
)
local_pip
.
append
(
pip
)
print
pip
.
__file__
# Prepare the CERT certificat for https download
cert_path
=
os
.
path
.
join
(
tmpdir
,
"cacert.pem"
)
...
...
@@ -100,9 +101,8 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
os
.
environ
.
setdefault
(
"PIP_CERT"
,
cert_path
)
assert
hasattr
(
pip
,
'__version__'
)
and
LooseVersion
(
pip
.
__version__
)
>=
minversion
,
\
"Unable to find suitable version of pip get
%
s instead of
%
s"
%
(
pipmodule
.
__version__
,
minversion
)
assert
hasattr
(
pip
,
'__version__'
)
and
LooseVersion
(
pip
.
__version__
)
>=
LooseVersion
(
minversion
),
\
"Unable to find suitable version of pip"
return
local_pip
[
0
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment