1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
Subject: skip virtualenv installation
Description: installer uses pip and virtualenv for install,
this patch removes this specific install to install in Debian dirs
and use Debian libs
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2015-04-30
Forwarded: no
--- a/distutils.ext/obidistutils/serenity/__init__.py
+++ b/distutils.ext/obidistutils/serenity/__init__.py
@@ -63,7 +63,7 @@
log.info("%s will be installed with python : %s" % (package,virtualpython))
- if install_requirements():
+ if install_requirements(False):
log.info("Restarting installation with all dependencies ok")
rerun_with_anothe_python(virtualpython)
--- a/distutils.ext/obidistutils/serenity/checkpackage.py
+++ b/distutils.ext/obidistutils/serenity/checkpackage.py
@@ -15,48 +15,7 @@
from obidistutils.serenity.checkpip import get_a_pip_module
def is_installed(requirement,pip=None):
-
- if pip is None:
- pip = get_a_pip_module()
-
- get_installed_distributions=pip.util.get_installed_distributions
-
- requirement_project,requirement_relation,requirement_version = parse_package_requirement(requirement)
-
- package = [x for x in get_installed_distributions() if x.project_name==requirement_project]
-
- if len(package)==1:
- if requirement_version is not None and requirement_relation is not None:
- rep = (len(package)==1) and eval("StrictVersion('%s') %s StrictVersion('%s')" % (package[0].version,
- requirement_relation,
- requirement_version)
- )
- else:
- rep=True
- else:
- rep=False
-
- if rep:
- if requirement_version is not None and requirement_relation is not None:
- log.info("Look for package %s (%s%s) : ok version %s installed" % (requirement_project,
- requirement_relation,
- requirement_version,
- package[0].version))
- else:
- log.info("Look for package %s : ok version %s installed" % (requirement_project,
- package[0].version))
- else:
- if len(package)!=1:
- log.info("Look for package %s (%s%s) : not installed" % (requirement_project,
- requirement_relation,
- requirement_version))
- else:
- log.info("Look for package %s (%s%s) : failed only version %s installed" % (requirement_project,
- requirement_relation,
- requirement_version,
- package[0].version))
-
- return rep
+ return True
def get_requirements(pip=None):
@@ -77,52 +36,13 @@
def install_requirements(skip_virtualenv=True,pip=None):
- if pip is None:
- pip = get_a_pip_module()
-
install_something=False
- try:
- requirements = open('requirements.txt').readlines()
- requirements = [x.strip() for x in requirements]
- requirements = [x for x in requirements if x[0]!='-']
-
- log.info("Required packages for the installation :")
- for x in requirements:
- if not skip_virtualenv or x[0:10]!='virtualenv':
- ok = is_installed(x,pip)
- if not ok:
- log.info(" Installing requirement : %s" % x)
- pip_install_package(x,pip=pip)
- install_something=True
-
- except IOError:
- pass
return install_something
def check_requirements(skip_virtualenv=True,pip=None):
-
- if pip is None:
- pip = get_a_pip_module()
-
-
- try:
- requirements = open('requirements.txt').readlines()
- requirements = [x.strip() for x in requirements]
- requirements = [x for x in requirements if x[0]!='-']
-
- log.info("Required packages for the installation :")
- for x in requirements:
- if not skip_virtualenv or x[0:10]!='virtualenv':
- ok = is_installed(x,pip)
- if not ok:
- log.error(" Missing requirement : %s -- Package installation stopped" % x)
- sys.exit(0)
-
- except IOError:
- pass
-
+ pass
def parse_package_requirement(requirement):
@@ -146,18 +66,7 @@
def get_package_requirement(package,pip=None):
- if pip is None:
- pip = get_a_pip_module()
-
- requirements = get_requirements(pip)
- req = [x for x in requirements
- if x[0:len(package)]==package
- ]
-
- if len(req)==1:
- return req[0]
- else:
- return None
+ return None
def pip_install_package(package,directory=None,pip=None):
--- a/setup.py
+++ b/setup.py
@@ -66,5 +66,5 @@
license=LICENSE,
url=URL,
python_src=SRC,
- sse='sse2',
- serenity=serenity)
+ sse='sse2')
+ #serenity=serenity)
--- a/distutils.ext/obidistutils/core.py
+++ b/distutils.ext/obidistutils/core.py
@@ -24,13 +24,11 @@
from obidistutils.command.build import build
from obidistutils.command.littlebigman import littlebigman
from obidistutils.command.build_cexe import build_cexe
-from obidistutils.command.build_sphinx import build_sphinx
from obidistutils.command import build_ext
from obidistutils.command.build_ctools import build_ctools
from obidistutils.command.build_files import build_files
from obidistutils.command.build_scripts import build_scripts
from obidistutils.command.install_scripts import install_scripts
-from obidistutils.command.install_sphinx import install_sphinx
from obidistutils.command.install import install
from obidistutils.command.pidname import pidname
@@ -125,9 +123,7 @@
'build_cexe':build_cexe,
'build_ext': build_ext,
'build_scripts':build_scripts,
- 'build_sphinx':build_sphinx,
'install_scripts':install_scripts,
- 'install_sphinx':install_sphinx,
'install':install,
'sdist':sdist}
--- a/distutils.ext/obidistutils/command/build.py
+++ b/distutils.ext/obidistutils/command/build.py
@@ -38,8 +38,7 @@
('build_ctools', has_ctools),
('build_files', has_files),
('build_cexe', has_executables)] \
- + ori_build.sub_commands + \
- [('build_sphinx',has_doc)]
+ + ori_build.sub_commands
def run(self):
log.info('\n\nRunning obidistutils build process\n\n')
|