18 #'': {'setup': '', 'url':'', 'local':''}, |
18 #'': {'setup': '', 'url':'', 'local':''}, |
19 'DISTRIBUTE': {'setup': 'distribute', 'url':'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz', 'local':"distribute-0.6.31.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
19 'DISTRIBUTE': {'setup': 'distribute', 'url':'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz', 'local':"distribute-0.6.31.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
20 'DJANGO': {'setup': 'django', 'url': 'https://www.djangoproject.com/download/1.6.2/tarball/', 'local':"Django-1.6.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
20 'DJANGO': {'setup': 'django', 'url': 'https://www.djangoproject.com/download/1.6.2/tarball/', 'local':"Django-1.6.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
21 'DJANGO-EXTENSIONS': { 'setup': 'django-extensions', 'url':'https://github.com/django-extensions/django-extensions/archive/1.3.3.tar.gz', 'local':"django-extensions-1.3.3.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
21 'DJANGO-EXTENSIONS': { 'setup': 'django-extensions', 'url':'https://github.com/django-extensions/django-extensions/archive/1.3.3.tar.gz', 'local':"django-extensions-1.3.3.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
22 'DJANGO-REGISTRATION': { 'setup': 'django-registration', 'url':'https://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-1.0.tar.gz', 'local':"django-registration-1.0.tar.gz", 'install': {'method': 'easy_install', 'option_str': '-Z', 'dict_extra_env': None}}, |
22 'DJANGO-REGISTRATION': { 'setup': 'django-registration', 'url':'https://bitbucket.org/ubernostrum/django-registration/downloads/django-registration-1.0.tar.gz', 'local':"django-registration-1.0.tar.gz", 'install': {'method': 'easy_install', 'option_str': '-Z', 'dict_extra_env': None}}, |
23 'SOUTH': { 'setup': 'South', 'url':'http://www.aeracode.org/releases/south/south-0.7.5.tar.gz', 'local':"south-0.7.5.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
23 'SOUTH': { 'setup': 'South', 'url':'https://bitbucket.org/andrewgodwin/south/get/0.8.4.tar.gz', 'local':"south-0.8.4.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
24 'SORL_THUMBNAIL' : { 'setup': 'sorl-thumbnail', 'url':'https://github.com/sorl/sorl-thumbnail/archive/master.tar.gz', 'local':"sorl-thumbnail-v11.12.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
24 'SORL_THUMBNAIL' : { 'setup': 'sorl-thumbnail', 'url':'https://github.com/mariocesar/sorl-thumbnail/archive/v11.12.1b.tar.gz', 'local':"sorl-thumbnail-11.12.1b.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
25 'LIBJPEG': {'setup': None, 'url':'jpegsrc.v9.tar.gz', 'local':'jpegsrc.v9.tar.gz', 'install': {'method': 'install_libjpeg', 'option_str': None, 'dict_extra_env': None}}, |
25 'LIBJPEG': {'setup': None, 'url':'jpegsrc.v9a.tar.gz', 'local':'jpegsrc.v9a.tar.gz', 'install': {'method': 'install_libjpeg', 'option_str': None, 'dict_extra_env': None}}, |
26 'ZLIB': {'setup': None, 'url':'zlib-1.2.7.tar.gz', 'local':'zlib-1.2.7.tar.gz', 'install': {'method': 'install_zlib', 'option_str': None, 'dict_extra_env': None}}, |
26 'ZLIB': {'setup': None, 'url':'zlib-1.2.8.tar.gz', 'local':'zlib-1.2.8.tar.gz', 'install': {'method': 'install_zlib', 'option_str': None, 'dict_extra_env': None}}, |
27 'PYCRYPTO': {'setup': 'pycrypto', 'url':'https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz', 'local':'pycrypto-2.6.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
27 'HAYSTACK': {'setup': 'django-haystack', 'url': 'https://github.com/toastdriven/django-haystack/archive/v2.1.0.tar.gz', 'local': 'django-haystack-2.1.0.tar.gz', 'install':{'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
28 'PARAMIKO': {'setup': 'paramiko', 'url':'https://github.com/paramiko/paramiko/archive/v1.9.0.tar.gz', 'local':'paramiko-1.9.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
28 'REQUESTS': {'setup': 'requests', 'url':'https://github.com/kennethreitz/requests/archive/v2.2.1.tar.gz', 'local':'requests-2.2.1.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
29 'FABRIC': {'setup': 'fabric', 'url':'https://github.com/fabric/fabric/tarball/1.5.1', 'local':'fabric-1.5.1.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
29 'PYELASTICSEARCH': {'setup': 'pyelasticsearch', 'url':'https://github.com/rhec/pyelasticsearch/archive/0.6.1.tar.gz', 'local':'pyelasticsearch-0.6.1.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
30 'MERCURIAL': {'setup': 'mercurial', 'url':'http://mercurial.selenic.com/release/mercurial-2.2.3.tar.gz', 'local':'mercurial-2.2.3.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
30 'WHOOSH': {'setup': 'whoosh', 'url':'https://bitbucket.org/mchaput/whoosh/get/2.5.7.tar.gz', 'local':'whoosh-2.5.7.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
31 'HAYSTACK': {'setup': 'django-haystack', 'url': 'https://github.com/toastdriven/django-haystack/tarball/master', 'local': 'django-haystack-V2.0.0-beta.tar.gz', 'install':{'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
32 'REQUESTS': {'setup': 'requests', 'url':'https://github.com/kennethreitz/requests/archive/v1.1.0.tar.gz', 'local':'requests-1.1.0.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
33 'PYELASTICSEARCH': {'setup': 'pyelasticsearch', 'url':'https://github.com/rhec/pyelasticsearch/archive/0.3.tar.gz', 'local':'pyelasticsearch-0.3.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
34 'WHOOSH': {'setup': 'whoosh', 'url':'https://bitbucket.org/mchaput/whoosh/get/tip.tar.gz', 'local':'whoosh-2.5.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
35 'SETUPTOOLS_HG' : {'setup':'setuptools_hg', 'url':'http://pypi.python.org/packages/source/s/setuptools_hg/setuptools_hg-0.4.tar.gz', 'local': 'setuptools_hg-0.4.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
36 'WSGIREF' : {'setup':'wsgiref', 'url':'http://pypi.python.org/packages/source/w/wsgiref/wsgiref-0.1.2.zip', 'local': 'wsgiref-0.1.2.zip', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
31 'WSGIREF' : {'setup':'wsgiref', 'url':'http://pypi.python.org/packages/source/w/wsgiref/wsgiref-0.1.2.zip', 'local': 'wsgiref-0.1.2.zip', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
37 'SIMPLEJSON': {'setup': 'simplejson', 'url':'https://github.com/simplejson/simplejson/archive/v3.0.7.tar.gz', 'local':"simplejson-3.0.7.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
32 'SIMPLEJSON': {'setup': 'simplejson', 'url':'https://github.com/simplejson/simplejson/archive/v3.3.3.tar.gz', 'local':"simplejson-3.3.3.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
38 'PYTZ' : {'setup': 'pytz', 'url':'http://pypi.python.org/packages/source/p/pytz/pytz-2012j.tar.gz', 'local' : 'pytz-2012j.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
33 'PYTZ' : {'setup': 'pytz', 'url':'https://pypi.python.org/packages/source/p/pytz/pytz-2014.2.tar.gz', 'local' : 'pytz-2014.2.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
39 # dependencies for Tastypie : mimeparse>=0.1.3, python-dateutil>=2.1, lxml, PyYAML (not necessary but we never know), python-digest |
34 # dependencies for Tastypie : mimeparse>=0.1.3, python-dateutil>=2.1, lxml, PyYAML (not necessary but we never know), python-digest |
40 'MIMEPARSE' : {'setup':'mimeparse', 'url':'http://pypi.python.org/packages/source/m/mimeparse/mimeparse-0.1.3.tar.gz', 'local': 'mimeparse-0.1.3.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
35 'MIMEPARSE' : {'setup':'mimeparse', 'url':'https://pypi.python.org/packages/source/p/python-mimeparse/python-mimeparse-0.1.4.tar.gz', 'local': 'python-mimeparse-0.1.4.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
41 'SIX' : {'setup':'six', 'url':'https://pypi.python.org/packages/source/s/six/six-1.6.1.tar.gz', 'local': 'six-1.6.1.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
36 'SIX' : {'setup':'six', 'url':'https://pypi.python.org/packages/source/s/six/six-1.6.1.tar.gz', 'local': 'six-1.6.1.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
42 'PYTHON-DATEUTIL' : {'setup':'python-dateutil', 'url':'http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.1.tar.gz', 'local': 'python-dateutil-2.1.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
37 'PYTHON-DATEUTIL' : {'setup':'python-dateutil', 'url':'https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz', 'local': 'python-dateutil-2.2.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
43 'PYYAML' : {'setup':'pyyaml', 'url':'http://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz', 'local': 'PyYAML-3.10.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
38 'PYYAML' : {'setup':'pyyaml', 'url':'http://pyyaml.org/download/pyyaml/PyYAML-3.11.tar.gz', 'local': 'PyYAML-3.11.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
44 'PYTHON-DIGEST' : {'setup':'python-digest', 'url':'http://pypi.python.org/packages/source/p/python-digest/python-digest-1.7.tar.gz', 'local': 'python-digest-1.7.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
39 'PYTHON-DIGEST' : {'setup':'python-digest', 'url':'http://pypi.python.org/packages/source/p/python-digest/python-digest-1.7.tar.gz', 'local': 'python-digest-1.7.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
45 'DJANGO-TASTYPIE' : {'setup':'django-tastypie', 'url':'https://github.com/toastdriven/django-tastypie/archive/v0.10.0.tar.gz', 'local': 'django-tastypie-0.10.0.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
40 'DJANGO-TASTYPIE' : {'setup':'django-tastypie', 'url':'https://github.com/toastdriven/django-tastypie/archive/v0.11.0.tar.gz', 'local': 'django-tastypie-0.11.0.tar.gz', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
46 'ISODATE' : {'setup': 'isodate', 'url': 'https://github.com/gweis/isodate/archive/0.4.9.tar.gz', 'local': 'isodate-0.4.9.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
41 'ISODATE' : {'setup': 'isodate', 'url': 'https://github.com/gweis/isodate/archive/0.5.0.tar.gz', 'local': 'isodate-0.5.0.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
47 'HTML5LIB' : {'setup': 'html5lib', 'url': 'https://html5lib.googlecode.com/files/html5lib-0.95.tar.gz', 'local': 'html5lib-0.95.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
42 'HTML5LIB' : {'setup': 'html5lib', 'url': 'https://github.com/html5lib/html5lib-python/archive/0.999.tar.gz', 'local': 'html5lib-0.999.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
48 'RDFLIB' : {'setup': 'rdflib', 'url': 'https://nodeload.github.com/RDFLib/rdflib/tar.gz/master', 'local': 'rdflib-2.4.0.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
43 'PYPARSING' : {'setup': 'pyparsing', 'url': 'https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.1.tar.gz', 'local': 'pyparsing-2.0.1.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
44 #SPARQLWRAPPER : the file SPARQLWrapper-1.5.2.tar.gz is needed in the folder to soleve RDFLIB dependencies. It will be installed when resolving the dependencies.graph. |
|
45 'RDFLIB' : {'setup': 'rdflib', 'url': 'https://github.com/RDFLib/rdflib/archive/4.1.1.tar.gz', 'local': 'rdflib-4.1.1.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
49 'PYCRYPTO' : {'setup': 'pycrypto', 'url': 'http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.1.tar.gz', 'local': 'pycrypto-2.6.1.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
46 'PYCRYPTO' : {'setup': 'pycrypto', 'url': 'http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.1.tar.gz', 'local': 'pycrypto-2.6.1.tar.gz', 'install': {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
50 } |
47 } |
51 |
48 |
52 if system_str == 'Windows': |
49 if system_str == 'Windows': |
53 |
|
54 URLS.update({ |
50 URLS.update({ |
55 'PSYCOPG2': {'setup': 'psycopg2','url': 'psycopg2-2.4.6.win32-py2.7-pg9.2.2-release.exe', 'local':"psycopg2-2.4.6.win32-py2.7-pg9.2.2-release.exe", 'install': {'method': 'install_psycopg2', 'option_str': None, 'dict_extra_env': None}}, |
51 'PSYCOPG2': {'setup': 'psycopg2','url': 'psycopg2-2.4.6.win32-py2.7-pg9.2.2-release.exe', 'local':"psycopg2-2.4.6.win32-py2.7-pg9.2.2-release.exe", 'install': {'method': 'install_psycopg2', 'option_str': None, 'dict_extra_env': None}}, |
56 'PIL': {'setup': 'pil', 'url': 'http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.7.exe', 'local':"PIL-1.1.7.win32-py2.7.exe", 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
52 'PIL': {'setup': 'pil', 'url': 'http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.7.exe', 'local':"PIL-1.1.7.win32-py2.7.exe", 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
57 }) |
53 }) |
58 else: |
54 else: |
59 URLS.update({ |
55 URLS.update({ |
60 'PSYCOPG2': {'setup': 'psycopg2','url': 'http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.6.tar.gz', 'local':"psycopg2-2.4.6.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
56 'PSYCOPG2': {'setup': 'psycopg2','url': 'http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.2.tar.gz', 'local':"psycopg2-2.5.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
61 'PIL': {'setup': 'pil', 'url': 'https://github.com/python-imaging/Pillow/archive/1.7.8.tar.gz', 'local':"Pillow-1.7.8.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
57 'PIL': {'setup': 'pil', 'url': 'https://github.com/python-imaging/Pillow/archive/2.3.1.tar.gz', 'local':"Pillow-2.3.1.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
62 }) |
58 }) |
63 |
59 |
64 |
60 |
65 class ResourcesEnv(object): |
61 class ResourcesEnv(object): |
66 |
62 |
67 def __init__(self, src_base, urls, normal_installs): |
63 def __init__(self, src_base, run_base, urls, normal_installs): |
68 self.src_base = src_base |
64 self.src_base = src_base |
|
65 self.run_base = run_base |
69 self.URLS = {} |
66 self.URLS = {} |
70 self.__init_url(urls) |
67 self.__init_url(urls) |
71 self.NORMAL_INSTALL = normal_installs |
68 self.NORMAL_INSTALL = normal_installs |
72 |
69 |
73 def get_src_base_path(self, fpath): |
70 def get_src_base_path(self, fpath): |
74 return os.path.abspath(os.path.join(self.src_base, fpath)).replace("\\","/") |
71 return os.path.abspath(os.path.join(self.src_base, fpath)).replace("\\","/") |
|
72 |
|
73 def get_run_res_base_path(self, fpath): |
|
74 return os.path.abspath(os.path.join(self.run_base, 'res', fpath)).replace("\\","/") |
75 |
75 |
76 def __add_package_def(self, key, dict): |
76 def __add_package_def(self, key, dict): |
77 self.URLS[key] = dict |
77 self.URLS[key] = dict |
78 |
78 |
79 def __init_url(self, urls): |
79 def __init_url(self, urls): |
80 for key, url_dict in urls.items(): |
80 for key, url_dict in urls.items(): |
81 url_dict_copy = url_dict.copy() |
81 url_dict_copy = url_dict.copy() |
|
82 if url_dict.get('install', {}).get('method','pip') == 'pip-req': |
|
83 get_base_path = self.get_run_res_base_path |
|
84 else: |
|
85 get_base_path = self.get_src_base_path |
82 if not url_dict['url'].startswith("http://"): |
86 if not url_dict['url'].startswith("http://"): |
83 url_dict_copy['url'] = self.get_src_base_path(url_dict['url']) |
87 url_dict_copy['url'] = get_base_path(url_dict['url']) |
84 url_dict_copy['local'] = self.get_src_base_path(url_dict['local']) |
88 url_dict_copy['local'] = get_base_path(url_dict['local']) |
85 |
89 |
86 self.__add_package_def(key, url_dict_copy ) |
90 self.__add_package_def(key, url_dict_copy ) |
87 |
91 |
88 def ensure_dir(dir, logger): |
92 def ensure_dir(dir, logger): |
89 logger.notify('Check directory %s' % dir) |
93 logger.notify('Check directory %s' % dir) |
90 if not os.path.exists(dir): |
94 if not os.path.exists(dir): |
226 if line.startswith(prefix): |
232 if line.startswith(prefix): |
227 return Logger.DEBUG |
233 return Logger.DEBUG |
228 return Logger.NOTIFY |
234 return Logger.NOTIFY |
229 |
235 |
230 |
236 |
231 def normal_install(key, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess): |
237 def normal_install(key, res_path, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess): |
232 logger.notify("Install %s from %s with %s" % (key,res_env.URLS[key][res_source_key],method)) |
238 logger.notify("Install %s from %s with %s" % (key,res_path,method)) |
233 if method == 'pip': |
239 if method == 'pip': |
234 if sys.platform == 'win32': |
240 if sys.platform == 'win32': |
235 args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', res_env.URLS[key][res_source_key]] |
241 args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', res_path] |
236 else: |
242 else: |
237 args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', res_env.URLS[key][res_source_key]] |
243 args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', res_path] |
238 if option_str : |
244 if option_str : |
239 args.insert(4,option_str) |
245 args.append(option_str) |
|
246 if res_source_key == 'local': |
|
247 if extra_env is None: |
|
248 extra_env = {} |
|
249 extra_env["PIP_DOWNLOAD_CACHE"] = res_env.get_src_base_path("") |
|
250 args.insert(2, '-f') |
|
251 args.insert(3, res_env.get_src_base_path("")) |
|
252 args.insert(4, '--no-index') |
|
253 logger.notify("Install %s from %s with %s args %s " % (key,res_path,method, repr(args))) |
|
254 call_subprocess(args, |
|
255 cwd=os.path.abspath(tmp_dir), |
|
256 filter_stdout=filter_python_develop, |
|
257 show_stdout=True, |
|
258 extra_env=extra_env) |
|
259 if method == 'pip-req': |
|
260 if sys.platform == 'win32': |
|
261 args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', '-r', res_path] |
|
262 else: |
|
263 args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', '-r', res_path] |
|
264 if option_str : |
|
265 args.append(option_str) |
|
266 if res_source_key == 'local': |
|
267 if extra_env is None: |
|
268 extra_env = {} |
|
269 extra_env["PIP_DOWNLOAD_CACHE"] = res_env.get_src_base_path("") |
|
270 args.insert(2, '-f') |
|
271 args.insert(3, res_env.get_src_base_path("")) |
|
272 args.insert(4, '--no-index') |
|
273 logger.notify("Install %s from %s with %s args %s " % (key,res_path,method, repr(args))) |
240 call_subprocess(args, |
274 call_subprocess(args, |
241 cwd=os.path.abspath(tmp_dir), |
275 cwd=os.path.abspath(tmp_dir), |
242 filter_stdout=filter_python_develop, |
276 filter_stdout=filter_python_develop, |
243 show_stdout=True, |
277 show_stdout=True, |
244 extra_env=extra_env) |
278 extra_env=extra_env) |
245 else: |
279 else: |
246 if sys.platform == 'win32': |
280 if sys.platform == 'win32': |
247 args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'easy_install')), res_env.URLS[key][res_source_key]] |
281 args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'easy_install')), res_path] |
248 else: |
282 else: |
249 args = [os.path.abspath(os.path.join(home_dir, 'bin', 'easy_install')), res_env.URLS[key][res_source_key]] |
283 args = [os.path.abspath(os.path.join(home_dir, 'bin', 'easy_install')), res_path] |
250 if option_str : |
284 if option_str : |
251 args.insert(1,option_str) |
285 args.insert(1,option_str) |
252 call_subprocess(args, |
286 call_subprocess(args, |
253 cwd=os.path.abspath(tmp_dir), |
287 cwd=os.path.abspath(tmp_dir), |
254 filter_stdout=filter_python_develop, |
288 filter_stdout=filter_python_develop, |