| author | ymh <ymh.work@gmail.com> |
| Fri, 19 Jul 2024 09:38:03 +0200 | |
| changeset 704 | b5835dca2624 |
| parent 688 | d3ae49dac5e7 |
| permissions | -rw-r--r-- |
| 0 | 1 |
import sys |
2 |
import os |
|
3 |
import os.path |
|
4 |
import shutil |
|
5 |
import tarfile |
|
6 |
import zipfile |
|
7 |
import urllib |
|
8 |
import platform |
|
9 |
import patch |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
10 |
import struct |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
11 |
import glob |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
12 |
import re |
| 0 | 13 |
|
14 |
join = os.path.join |
|
15 |
system_str = platform.system() |
|
16 |
||
17 |
URLS = { |
|
18 |
#'': {'setup': '', 'url':'', 'local':''}, |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
19 |
'DISTRIBUTE': {'setup': 'distribute', 'url':'http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz', 'local':"distribute-0.6.24.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
627
3fd558fa38b1
correct various small bugs. upgrade renkan. news version
ymh <ymh.work@gmail.com>
parents:
625
diff
changeset
|
20 |
'DJANGO': {'setup': 'django', 'url': 'https://www.djangoproject.com/download/1.8.2/tarball/', 'local':"Django-1.8.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 545 | 21 |
'DJANGO-EXTENSIONS': { 'setup': 'django-extensions', 'url':'https://github.com/django-extensions/django-extensions/archive/1.5.1.tar.gz', 'local':"django-extensions-1.5.1.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
688
d3ae49dac5e7
update ressources to correct virtualenv creation
ymh <ymh.work@gmail.com>
parents:
686
diff
changeset
|
22 |
'REGISTRATION': { 'setup': 'django-registration-redux', 'url':'https://github.com/macropin/django-registration/archive/v1.2.tar.gz', 'local':"django-registration-redux-1.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 345 | 23 |
'HTTPLIB2': { 'setup': 'httplib2', 'url':'https://github.com/jcgregorio/httplib2/archive/v0.9.tar.gz', 'local':"httplib2-0.7.4.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
24 |
'PYCRYPTO': {'setup': 'pycrypto', 'url':'https://github.com/dlitz/pycrypto/archive/v2.6.1.tar.gz', 'local':'pycrypto-2.6.1.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
25 |
'SSH': {'setup': 'ssh', 'url':'http://pypi.python.org/packages/source/s/ssh/ssh-1.7.14.tar.gz#md5=4cdd0549ef4699bd67b96264d3b21427', 'local':'ssh-1.7.14.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
26 |
'FABRIC': {'setup': 'fabric', 'url':'https://github.com/fabric/fabric/tarball/1.4.2', 'local':'fabric-1.4.2.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
27 |
'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}}, |
| 613 | 28 |
'HAYSTACK': {'setup': 'django-haystack', 'url': 'https://github.com/django-haystack/django-haystack/archive/v2.4.0.tar.gz', 'local': 'django-haystack-2.4.0.tar.gz', 'install':{'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 545 | 29 |
'WHOOSH': {'setup': 'whoosh', 'url':'https://pypi.python.org/packages/source/W/Whoosh/Whoosh-2.6.0.zip', 'local':'Whoosh-2.6.0.zip', 'install' : {'method':'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 345 | 30 |
'WIKITOOLS' : { 'setup': 'wikitools', 'url': 'https://github.com/alexz-enwp/wikitools/archive/1.2.tar.gz', 'local': 'wikitools-1.2.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
361
a1b85604132c
upgrade rdflib to correct unicode bugs
ymh <ymh.work@gmail.com>
parents:
346
diff
changeset
|
31 |
'ISODATE' : {'setup': 'isodate', 'url': 'http://pypi.python.org/packages/source/i/isodate/isodate-0.5.1.tar.gz', 'local': 'isodate-0.5.1.tar.gz', 'install' : {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
688
d3ae49dac5e7
update ressources to correct virtualenv creation
ymh <ymh.work@gmail.com>
parents:
686
diff
changeset
|
32 |
'RDFLIB' : { 'setup': 'rdflib', 'url': 'https://github.com/RDFLib/rdflib/archive/4.2.2.tar.gz', 'local': 'rdflib-4.2.2.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
33 |
'SPARQLWRAPPER' : { 'setup': 'SPARQLWrapper', 'url': 'https://github.com/RDFLib/sparqlwrapper/archive/1.6.4.tar.gz', 'local' : 'SPARQLWrapper-1.6.4.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 545 | 34 |
'REQUESTS' : { 'setup': 'requests', 'url': 'https://github.com/kennethreitz/requests/archive/v2.6.0.tar.gz', 'local' : 'requests-2.6.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
35 |
'ELASTICSEARCH' : { 'setup': 'elasticsearch', 'url': 'https://github.com/elasticsearch/elasticsearch-py/archive/1.4.0.tar.gz', 'local' : 'elasticsearch-1.4.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
| 345 | 36 |
'PYPARSING' : { 'setup': 'pyparsing', 'url': 'https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.3.tar.gz', 'local' : 'pyparsing-2.0.3.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
37 |
'PIL' : { 'setup': 'pil', 'url': 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz', 'local' : 'Imaging-1.1.7.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
38 |
'EASYTHUMBNAIL' : { 'setup': 'easy-thumbnail', 'url': 'https://github.com/SmileyChris/easy-thumbnails/archive/2.2.tar.gz', 'local' : 'easy-thumbnails-2.2.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
| 502 | 39 |
'SIX' : { 'setup': 'six', 'url': 'https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz', 'local' : 'six-1.9.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 345 | 40 |
'SIMPLEJSON' : { 'setup': 'simplejson', 'url': 'https://github.com/simplejson/simplejson/archive/v3.6.5.tar.gz', 'local' : 'simplejson-3.6.5.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
41 |
'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}}, |
|
| 545 | 42 |
'URLLIB3': { 'setup': 'urllib3', 'url':'https://github.com/shazow/urllib3/archive/1.10.2.tar.gz', 'local':"urllib3-1.10.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 442 | 43 |
'PKGCONFIG': { 'setup': 'pkg-config', 'url':'pkg-config-0.28.tar.gz', 'local':"pkg-config-0.28.tar.gz", 'install': {'method': 'install_pkgconfig', 'option_str': None, 'dict_extra_env': None}}, |
44 |
'SQLITE': { 'setup': 'SQLITE', 'url':'sqlite-autoconf-3080701.tar.gz', 'local':"sqlite-autoconf-3080701.tar.gz", 'install': {'method': 'install_sqlite', 'option_str': None, 'dict_extra_env': None}}, |
|
45 |
'UNIXODBC': { 'setup': 'unixODBC', 'url':'unixODBC-2.3.2.tar.gz', 'local':"unixODBC-2.3.2.tar.gz", 'install': {'method': 'install_unixODBC', 'option_str': None, 'dict_extra_env': None}}, |
|
46 |
'RAPTOR2': { 'setup': 'raptor2', 'url':'raptor2-2.0.15.tar.gz', 'local':"raptor2-2.0.15.tar.gz", 'install': {'method': 'install_raptor2', 'option_str': None, 'dict_extra_env': None}}, |
|
47 |
'RASQAL': { 'setup': 'rasqal', 'url':'rasqal-0.9.32.tar.gz', 'local':"rasqal-0.9.32.tar.gz", 'install': {'method': 'install_rasqal', 'option_str': None, 'dict_extra_env': None}}, |
|
48 |
'REDLAND': { 'setup': 'redland', 'url':'redland-1.0.17.tar.gz', 'local':"redland-1.0.17.tar.gz", 'install': {'method': 'install_redland', 'option_str': None, 'dict_extra_env': None}}, |
|
49 |
'REDLAND_BINDINGS': { 'setup': 'redland_bindings', 'url':'redland-bindings-1.0.17.1.tar.gz', 'local':"redland-bindings-1.0.17.1.tar.gz", 'install': {'method': 'install_redland_bindings', 'option_str': None, 'dict_extra_env': None}}, |
|
| 443 | 50 |
'UNIDECODE': { 'setup': 'unidecode', 'url':'https://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.17.tar.gz', 'local':"Unidecode-0.04.17.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
625
cc263b8278ba
upgrade celery lib to support django 1.8
ymh <ymh.work@gmail.com>
parents:
613
diff
changeset
|
51 |
'PYTZ': { 'setup': 'pytz', 'url':'https://pypi.python.org/packages/source/p/pytz/pytz-2015.4.tar.bz2', 'local':"pytz-2015.4.tar.bz2", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
686
385e3a12ee27
Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
674
diff
changeset
|
52 |
'KOMBU': { 'setup': 'kombu', 'url':'https://github.com/celery/kombu/archive/v4.1.0.tar.gz', 'local':"kombu-4.1.0.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
385e3a12ee27
Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
674
diff
changeset
|
53 |
'AMQP': { 'setup': 'amqp', 'url':'https://github.com/celery/py-amqp/archive/v2.2.2.tar.gz', 'local':"amqp-2.2.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 492 | 54 |
'ANYJSON': { 'setup': 'anyjson', 'url':'https://bitbucket.org/runeh/anyjson/get/0.3.3.tar.gz', 'local':"anyjson-0.3.3.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
686
385e3a12ee27
Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
674
diff
changeset
|
55 |
'BILLIARD': { 'setup': 'billiard', 'url':'https://github.com/celery/billiard/archive/v3.5.0.3.tar.gz', 'local':"billiard-3.5.0.3.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
385e3a12ee27
Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
674
diff
changeset
|
56 |
'CELERY': { 'setup': 'celery', 'url':'https://github.com/celery/celery/archive/v4.1.0.tar.gz', 'local':"celery-4.1.0.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 493 | 57 |
'APPCONF': { 'setup': 'django-appconf', 'url':'https://github.com/jezdez/django-appconf/archive/v1.0.1.tar.gz', 'local':"django-appconf-1.0.1.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
58 |
'CELERY-EMAIL': { 'setup': 'django-celery-email', 'url':'https://github.com/pmclanahan/django-celery-email/archive/1.1.0.tar.gz', 'local':"django-celery-email-1.1.0.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
| 494 | 59 |
'DJANGO-ENVELOPE': { 'setup': 'django-envelope', 'url':'https://github.com/zsiciarz/django-envelope/archive/1.0.0.tar.gz', 'local':'django-envelope-1.0.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 534 | 60 |
'DJANGO-HONEYPOT': { 'setup': 'django-honeypot', 'url':'https://github.com/sunlightlabs/django-honeypot/archive/0.4.0.tar.gz', 'local':'django-honeypot-0.4.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 530 | 61 |
'CSSSELECT': { 'setup': 'cssselect', 'url':'https://github.com/SimonSapin/cssselect/archive/v0.9.1.tar.gz', 'local':'cssselect-0.9.1.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
62 |
'CSSUTILS': { 'setup': 'cssutils', 'url':'https://bitbucket.org/cthedot/cssutils/get/v1.0.tar.gz', 'local':'cssutils-1.0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
63 |
'PREMAILER': { 'setup': 'premailer', 'url':'https://pypi.python.org/packages/source/p/premailer/premailer-2.8.3.tar.gz', 'local':'premailer-2.8.3.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
| 545 | 64 |
'SQLALCHEMY': { 'setup': 'SQLAlchemy', 'url':'https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.9.9.tar.gz', 'local':'SQLAlchemy-0.9.9.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
65 |
'JEDI': { 'setup': 'jedi', 'url':'https://github.com/davidhalter/jedi/archive/v0.8.1.tar.gz', 'local':'jedi-0.8.1-final0.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
|
688
d3ae49dac5e7
update ressources to correct virtualenv creation
ymh <ymh.work@gmail.com>
parents:
686
diff
changeset
|
66 |
'VINE': { 'setup': 'vine', 'url':'https://github.com/celery/vine/archive/v1.1.4.tar.gz', 'local':'vine-1.1.4.tar.gz', 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
| 0 | 67 |
} |
68 |
||
| 442 | 69 |
|
70 |
||
| 0 | 71 |
if system_str == 'Windows': |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
72 |
|
| 0 | 73 |
URLS.update({ |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
74 |
'PSYCOPG2': {'setup': 'psycopg2','url': 'psycopg2-2.0.14.win32-py2.6-pg8.4.3-release.zip', 'local':"psycopg2-2.0.14.win32-py2.6-pg8.4.3-release.zip", 'install': {'method': 'install_psycopg2', 'option_str': None, 'dict_extra_env': None}}, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
75 |
'PIL': {'setup': 'pil', 'url': 'http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.6.exe', 'local':"PIL-1.1.7.win32-py2.6.exe", 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
76 |
'LXML': {'setup': 'lxml', 'url': 'http://pypi.python.org/packages/2.6/l/lxml/lxml-2.2.2-py2.6-win32.egg', 'local':"lxml-2.2.2-py2.6-win32.egg", 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
77 |
'PYYAML' : { 'setup': 'PyYAML', 'url': 'http://pyyaml.org/download/pyyaml/PyYAML-3.09.win32-py2.6.exe', 'local': 'PyYAML-3.09.win32-py2.6.exe', 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
| 10 | 78 |
'PYSTEMMER' : { 'setup': 'pystemmer', 'url': 'PyStemmer_compiled_for_pc.zip', 'local': 'PyStemmer_compiled_for_pc.zip'}, |
| 0 | 79 |
}) |
80 |
else: |
|
| 345 | 81 |
if system_str == "Darwin": |
82 |
lxml_options = {'STATIC_DEPS': 'true', 'LIBXML2_VERSION': '2.9.2', 'LIBXSLT_VERSION': '1.1.28', 'LIBICONV_VERSION': '1.14'} |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
83 |
else: |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
84 |
lxml_options = None |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
85 |
|
| 0 | 86 |
URLS.update({ |
|
688
d3ae49dac5e7
update ressources to correct virtualenv creation
ymh <ymh.work@gmail.com>
parents:
686
diff
changeset
|
87 |
'PSYCOPG2': {'setup': 'psycopg2','url': 'http://initd.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-2.7.4.tar.gz', 'local':"psycopg2-2.7.4.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': None}}, |
|
686
385e3a12ee27
Containerization and various corrections to make it work
ymh <ymh.work@gmail.com>
parents:
674
diff
changeset
|
88 |
'PILLOW': {'setup': 'pillow', 'url': 'https://github.com/python-pillow/Pillow/archive/5.0.0.tar.gz', 'local':"Pillow-5.0.0.tar.gz", 'install': {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}}, |
| 545 | 89 |
'LXML': {'setup': 'lxml', 'url':"lxml-3.4.2.tar.gz", 'local':"lxml-3.4.2.tar.gz", 'install': {'method': 'pip', 'option_str': None, 'dict_extra_env': lxml_options}}, |
| 345 | 90 |
'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}}, |
| 0 | 91 |
}) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
92 |
|
| 0 | 93 |
|
94 |
class ResourcesEnv(object): |
|
95 |
||
| 345 | 96 |
def __init__(self, src_base, run_base, urls, normal_installs): |
| 0 | 97 |
self.src_base = src_base |
| 345 | 98 |
self.run_base = run_base |
| 0 | 99 |
self.URLS = {} |
100 |
self.__init_url(urls) |
|
101 |
self.NORMAL_INSTALL = normal_installs |
|
102 |
||
103 |
def get_src_base_path(self, fpath): |
|
104 |
return os.path.abspath(os.path.join(self.src_base, fpath)).replace("\\","/") |
|
| 345 | 105 |
|
106 |
def get_run_res_base_path(self, fpath): |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
107 |
return os.path.abspath(os.path.join(self.run_base, 'res', fpath)).replace("\\","/") |
|
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
108 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
109 |
def __add_package_def(self, key, dict): |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
110 |
self.URLS[key] = dict |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
111 |
|
| 0 | 112 |
def __init_url(self, urls): |
113 |
for key, url_dict in urls.items(): |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
114 |
url_dict_copy = url_dict.copy() |
| 345 | 115 |
if url_dict.get('install', {}).get('method','pip') == 'pip-req': |
116 |
get_base_path = self.get_run_res_base_path |
|
117 |
else: |
|
118 |
get_base_path = self.get_src_base_path |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
119 |
if not url_dict['url'].startswith("http://"): |
| 345 | 120 |
url_dict_copy['url'] = get_base_path(url_dict['url']) |
121 |
url_dict_copy['local'] = get_base_path(url_dict['local']) |
|
122 |
||
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
123 |
self.__add_package_def(key, url_dict_copy ) |
| 0 | 124 |
|
125 |
def ensure_dir(dir, logger): |
|
| 345 | 126 |
logger.notify('Check directory %s' % dir) |
| 0 | 127 |
if not os.path.exists(dir): |
128 |
logger.notify('Creating directory %s' % dir) |
|
129 |
os.makedirs(dir) |
|
130 |
||
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
131 |
def extend_parser(parser): |
| 0 | 132 |
parser.add_option( |
133 |
'--index-url', |
|
134 |
metavar='INDEX_URL', |
|
135 |
dest='index_url', |
|
136 |
default='http://pypi.python.org/simple/', |
|
137 |
help='base URL of Python Package Index') |
|
138 |
parser.add_option( |
|
139 |
'--type-install', |
|
140 |
metavar='type_install', |
|
141 |
dest='type_install', |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
142 |
help='type install : local, url, setup - default : local') |
| 0 | 143 |
parser.add_option( |
144 |
'--ignore-packages', |
|
145 |
metavar='ignore_packages', |
|
146 |
dest='ignore_packages', |
|
147 |
default=None, |
|
| 442 | 148 |
help='list of comma separated keys for package to ignore') |
149 |
parser.add_option( |
|
150 |
'--no-clear', |
|
151 |
metavar='do not clear env', |
|
152 |
dest='clear', |
|
153 |
default=True, |
|
154 |
action='store_false', |
|
155 |
help='do not clear env') |
|
156 |
||
157 |
||
| 0 | 158 |
|
159 |
def install_psycopg2(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop): |
|
160 |
psycopg2_src = os.path.join(src_dir,"psycopg2.zip") |
|
161 |
shutil.copy(res_env.URLS['PSYCOPG2'][res_source_key], psycopg2_src) |
|
162 |
#extract psycopg2 |
|
163 |
zf = zipfile.ZipFile(psycopg2_src) |
|
164 |
psycopg2_base_path = os.path.join(src_dir,"psycopg2") |
|
165 |
zf.extractall(psycopg2_base_path) |
|
166 |
zf.close() |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
167 |
|
| 0 | 168 |
psycopg2_src_path = os.path.join(psycopg2_base_path, os.listdir(psycopg2_base_path)[0]) |
169 |
shutil.copytree(os.path.join(psycopg2_src_path, 'psycopg2'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'psycopg2'))) |
|
| 345 | 170 |
shutil.copy(os.path.join(psycopg2_src_path, 'psycopg2-2.4.5-py2.7.egg-info'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages', 'site-packages'))) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
171 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
172 |
|
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
173 |
|
| 442 | 174 |
def gen_install_comp_lib(lib_name, lib_key, configure_options=[], configure_env={}): |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
175 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
176 |
def install_lib(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop): |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
177 |
lib_src = os.path.join(src_dir,lib_name+".tar.gz") |
| 345 | 178 |
logger.notify("Copy %s to %s " % (res_env.URLS[lib_key][res_source_key],lib_src)) |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
179 |
shutil.copy(res_env.URLS[lib_key][res_source_key], lib_src) |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
180 |
tf = tarfile.open(lib_src,'r:gz') |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
181 |
lib_base_path = os.path.join(src_dir, lib_name) |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
182 |
logger.notify("Extract %s to %s " % (lib_name,lib_base_path)) |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
183 |
tf.extractall(lib_base_path) |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
184 |
tf.close() |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
185 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
186 |
lib_src_path = os.path.join(lib_base_path, os.listdir(lib_base_path)[0]) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
187 |
|
|
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
188 |
|
| 442 | 189 |
context_map = { |
190 |
'option_str' : option_str, |
|
191 |
'home_dir': os.path.abspath(home_dir), |
|
192 |
'lib_dir': os.path.abspath(lib_dir), |
|
193 |
'tmp_dir': os.path.abspath(tmp_dir), |
|
194 |
'src_dir': os.path.abspath(src_dir), |
|
195 |
} |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
196 |
|
| 442 | 197 |
configure_options_trans = map(lambda s: s % context_map, configure_options) |
198 |
configure_env_trans = {k: s % context_map for k,s in configure_env.items()} |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
199 |
|
| 345 | 200 |
logger.notify(lib_name + " configure in " + lib_src_path) |
| 442 | 201 |
call_subprocess(['./configure', '--prefix='+os.path.abspath(home_dir)] + configure_options_trans, |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
202 |
cwd=os.path.abspath(lib_src_path), |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
203 |
filter_stdout=filter_python_develop, |
| 442 | 204 |
show_stdout=True, |
205 |
extra_env=configure_env_trans |
|
206 |
) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
207 |
|
| 345 | 208 |
logger.notify(lib_name + " make in " + lib_src_path) |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
209 |
call_subprocess(['make'], |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
210 |
cwd=os.path.abspath(lib_src_path), |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
211 |
filter_stdout=filter_python_develop, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
212 |
show_stdout=True) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
213 |
|
| 345 | 214 |
logger.notify(lib_name + "make install in " + lib_src_path) |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
215 |
call_subprocess(['make', 'install'], |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
216 |
cwd=os.path.abspath(lib_src_path), |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
217 |
filter_stdout=filter_python_develop, |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
218 |
show_stdout=True) |
| 345 | 219 |
return install_lib |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
220 |
|
| 442 | 221 |
install_libjpeg = gen_install_comp_lib("libjpeg", "LIBJPEG", ['--enable-shared'], {}) |
222 |
install_zlib = gen_install_comp_lib("zlib", "ZLIB", [], {}) |
|
223 |
install_pkgconfig = gen_install_comp_lib("pkg-config", "PKGCONFIG", ['--with-internal-glib'], {}) |
|
224 |
install_sqlite = gen_install_comp_lib("sqlite", "SQLITE", [], {}) |
|
225 |
install_unixODBC = gen_install_comp_lib("unixODBC", "UNIXODBC", ['--enable-gui=no'], {}) |
|
226 |
redland_base_env = { |
|
227 |
'PKG_CONFIG': "%(home_dir)s/bin/pkg-config", |
|
228 |
'PKG_CONFIG_LIBDIR': "%(home_dir)s/lib/pkgconfig", |
|
229 |
} |
|
230 |
install_raptor2 = gen_install_comp_lib('raptor2', 'RAPTOR2', [], redland_base_env) |
|
231 |
install_rasqal = gen_install_comp_lib('rasqal', "RASQAL", [], redland_base_env) |
|
232 |
install_redland = gen_install_comp_lib('redland', 'REDLAND', [], dict(redland_base_env.items() + {'CFLAGS':'-I%(home_dir)s/include'}.items())) |
|
|
450
5bf2dffe3685
correct virtualenv creation for linux
ymh <ymh.work@gmail.com>
parents:
443
diff
changeset
|
233 |
python_ld_flags = '-L'+os.path.abspath(os.path.join(os.path.dirname(os.__file__),'..'))+' -lpython'+".".join(map(str,sys.version_info[0:2])) |
|
5bf2dffe3685
correct virtualenv creation for linux
ymh <ymh.work@gmail.com>
parents:
443
diff
changeset
|
234 |
if sys.platform == 'darwin': |
|
5bf2dffe3685
correct virtualenv creation for linux
ymh <ymh.work@gmail.com>
parents:
443
diff
changeset
|
235 |
python_ld_flags += ' -Wl,-dylib' |
|
5bf2dffe3685
correct virtualenv creation for linux
ymh <ymh.work@gmail.com>
parents:
443
diff
changeset
|
236 |
elif 'linux' in sys.platform: |
| 452 | 237 |
python_ld_flags += ' -nostartfiles -Wl,-shared' |
|
450
5bf2dffe3685
correct virtualenv creation for linux
ymh <ymh.work@gmail.com>
parents:
443
diff
changeset
|
238 |
install_redland_bindings = gen_install_comp_lib('redland-bindings', "REDLAND_BINDINGS", ['--with-python=%(home_dir)s/bin/python', '--with-python-ldflags='+python_ld_flags], redland_base_env) |
| 0 | 239 |
|
| 10 | 240 |
def install_pystemmer(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop): |
241 |
print "install PYSTEMMER from " + res_env.URLS['PYSTEMMER'][res_source_key] |
|
242 |
pystemmer_src = os.path.join(src_dir,"pystemmer.zip") |
|
243 |
shutil.copy(res_env.URLS['PYSTEMMER'][res_source_key], pystemmer_src) |
|
244 |
#extract pystemmer |
|
245 |
zf = zipfile.ZipFile(pystemmer_src) |
|
246 |
pystemmer_base_path = os.path.join(src_dir,"pystemmer") |
|
247 |
zf.extractall(pystemmer_base_path) |
|
248 |
zf.close() |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
249 |
|
| 10 | 250 |
shutil.copy(os.path.join(pystemmer_base_path, 'Stemmer.pyd'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages'))) |
251 |
shutil.copy(os.path.join(pystemmer_base_path, 'PyStemmer-1.0.1-py2.6.egg-info'), os.path.abspath(os.path.join(home_dir, 'Lib/site-packages'))) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
252 |
|
| 345 | 253 |
#osx_extra_env = {'ARCHFLAGS': '-Wno-error=unused-command-line-argument-hard-error-in-future', 'CFLAGS': '-Qunused-arguments', 'CPPFLAGS': '-Qunused-arguments'} |
254 |
osx_extra_env = {} |
|
| 2 | 255 |
|
| 345 | 256 |
def lib_generate_install_methods(path_locations, src_base, run_base, Logger, call_subprocess, normal_installs, options_to_add=None, urls= None): |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
257 |
|
| 0 | 258 |
all_urls = URLS.copy() |
259 |
if urls is not None: |
|
260 |
all_urls.update(urls) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
261 |
|
| 345 | 262 |
res_env = ResourcesEnv(src_base, run_base, all_urls, normal_installs) |
| 0 | 263 |
|
264 |
def filter_python_develop(line): |
|
265 |
if not line.strip(): |
|
266 |
return Logger.DEBUG |
|
267 |
for prefix in ['Searching for', 'Reading ', 'Best match: ', 'Processing ', |
|
268 |
'Moving ', 'Adding ', 'running ', 'writing ', 'Creating ', |
|
269 |
'creating ', 'Copying ']: |
|
270 |
if line.startswith(prefix): |
|
271 |
return Logger.DEBUG |
|
272 |
return Logger.NOTIFY |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
273 |
|
|
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
274 |
|
| 345 | 275 |
def normal_install(key, res_path, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess): |
276 |
logger.notify("Install %s from %s with %s" % (key,res_path,method)) |
|
| 0 | 277 |
if method == 'pip': |
278 |
if sys.platform == 'win32': |
|
| 345 | 279 |
args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', res_path] |
| 0 | 280 |
else: |
| 345 | 281 |
args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', res_path] |
| 0 | 282 |
if option_str : |
| 345 | 283 |
args.append(option_str) |
284 |
if res_source_key == 'local': |
|
285 |
if extra_env is None: |
|
286 |
extra_env = {} |
|
287 |
args.insert(2, '-f') |
|
288 |
args.insert(3, res_env.get_src_base_path("")) |
|
289 |
args.insert(4, '--no-index') |
|
| 674 | 290 |
args.insert(5, '--no-cache-dir') |
| 345 | 291 |
logger.notify("Install %s from %s with %s args %s " % (key,res_path,method, repr(args))) |
292 |
call_subprocess(args, |
|
293 |
cwd=os.path.abspath(tmp_dir), |
|
294 |
filter_stdout=filter_python_develop, |
|
295 |
show_stdout=True, |
|
296 |
extra_env=extra_env) |
|
297 |
if method == 'pip-req': |
|
298 |
if sys.platform == 'win32': |
|
299 |
args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'pip')), 'install', '-r', res_path] |
|
300 |
else: |
|
301 |
args = [os.path.abspath(os.path.join(home_dir, 'bin', 'pip')), 'install', '-r', res_path] |
|
302 |
if option_str : |
|
303 |
args.append(option_str) |
|
304 |
if res_source_key == 'local': |
|
305 |
if extra_env is None: |
|
306 |
extra_env = {} |
|
307 |
args.insert(2, '-f') |
|
308 |
args.insert(3, res_env.get_src_base_path("")) |
|
309 |
args.insert(4, '--no-index') |
|
| 674 | 310 |
args.insert(5, '--no-cache-dir') |
| 345 | 311 |
logger.notify("Install %s from %s with %s args %s " % (key,res_path,method, repr(args))) |
| 0 | 312 |
call_subprocess(args, |
313 |
cwd=os.path.abspath(tmp_dir), |
|
314 |
filter_stdout=filter_python_develop, |
|
315 |
show_stdout=True, |
|
316 |
extra_env=extra_env) |
|
317 |
else: |
|
318 |
if sys.platform == 'win32': |
|
| 345 | 319 |
args = [os.path.abspath(os.path.join(home_dir, 'Scripts', 'easy_install')), res_path] |
| 0 | 320 |
else: |
| 345 | 321 |
args = [os.path.abspath(os.path.join(home_dir, 'bin', 'easy_install')), res_path] |
| 0 | 322 |
if option_str : |
323 |
args.insert(1,option_str) |
|
324 |
call_subprocess(args, |
|
325 |
cwd=os.path.abspath(tmp_dir), |
|
326 |
filter_stdout=filter_python_develop, |
|
327 |
show_stdout=True, |
|
| 442 | 328 |
extra_env=extra_env) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
329 |
|
|
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
330 |
|
| 0 | 331 |
def after_install(options, home_dir): |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
332 |
|
| 0 | 333 |
global logger |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
334 |
|
| 0 | 335 |
verbosity = options.verbose - options.quiet |
336 |
logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)]) |
|
337 |
||
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
338 |
|
| 0 | 339 |
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) |
340 |
base_dir = os.path.dirname(home_dir) |
|
341 |
src_dir = os.path.join(home_dir, 'src') |
|
342 |
tmp_dir = os.path.join(home_dir, 'tmp') |
|
343 |
ensure_dir(src_dir, logger) |
|
344 |
ensure_dir(tmp_dir, logger) |
|
345 |
system_str = platform.system() |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
346 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
347 |
res_source_key = getattr(options, 'type_install') if hasattr(options, 'type_install') else 'local' #.get('type_install', 'local') |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
348 |
if res_source_key is None: |
| 345 | 349 |
res_source_key = 'local' |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
350 |
|
| 0 | 351 |
ignore_packages = [] |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
352 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
353 |
if system_str == 'Windows': |
| 345 | 354 |
default_install_options = {'method': 'easy_install', 'option_str': None, 'dict_extra_env': {}} |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
355 |
else: |
| 345 | 356 |
default_install_options = {'method': 'pip', 'option_str': None, 'dict_extra_env': {}} |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
357 |
|
| 0 | 358 |
if options.ignore_packages : |
359 |
ignore_packages = options.ignore_packages.split(",") |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
360 |
|
| 0 | 361 |
logger.indent += 2 |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
362 |
try: |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
363 |
for key in res_env.NORMAL_INSTALL: |
| 345 | 364 |
install_options = None |
365 |
if isinstance(key, dict): |
|
366 |
install_options = key.get('install', default_install_options) |
|
367 |
install_options['method'] = 'pip-req' |
|
368 |
res_path = res_env.get_run_res_base_path(key['requirement']) |
|
369 |
else: |
|
370 |
if key not in res_env.URLS: |
|
371 |
logger.notify("%s not found in def : passing" % (key,)) |
|
372 |
install_options = res_env.URLS[key].get('install', None) |
|
373 |
res_path = res_env.URLS[key][res_source_key] |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
374 |
if install_options is None: |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
375 |
install_options = default_install_options |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
376 |
method = install_options.get('method', default_install_options['method']) |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
377 |
option_str = install_options.get('option_str', default_install_options['option_str']) |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
378 |
extra_env = install_options.get('dict_extra_env', default_install_options['dict_extra_env']) |
| 345 | 379 |
if not extra_env: |
380 |
extra_env = {} |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
381 |
|
| 345 | 382 |
if 'TMPDIR' not in extra_env: |
383 |
extra_env['TMPDIR'] = os.path.abspath(tmp_dir) |
|
384 |
if system_str == 'Darwin': |
|
385 |
for flag_key, flag_value in iter(osx_extra_env.items()): |
|
386 |
flags = extra_env.get(flag_key, '') |
|
387 |
if flag_value not in flags: |
|
388 |
#flags += " -Wno-error=unused-command-line-argument-hard-error-in-future" |
|
389 |
flags += " "+flag_value |
|
390 |
extra_env[flag_key] = flags.strip() |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
391 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
392 |
#isinstance(lst, (list, tuple)) |
| 0 | 393 |
if key not in ignore_packages: |
| 345 | 394 |
logger.notify("install %s with method %s" % (key, repr(method))) |
| 0 | 395 |
if callable(method): |
396 |
method(option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
397 |
elif method in globals() and callable(globals()[method]) and method not in ['pip', 'easy_install']: |
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
398 |
globals()[method](option_str, extra_env, res_source_key, home_dir, lib_dir, tmp_dir, src_dir, res_env, logger, call_subprocess, filter_python_develop) |
| 0 | 399 |
else: |
| 345 | 400 |
normal_install(key, res_path, method, option_str, extra_env, res_source_key, home_dir, tmp_dir, res_env, logger, call_subprocess) |
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
401 |
|
| 0 | 402 |
logger.notify("Clear source dir") |
403 |
shutil.rmtree(src_dir) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
404 |
|
| 0 | 405 |
finally: |
406 |
logger.indent -= 2 |
|
407 |
script_dir = join(base_dir, bin_dir) |
|
408 |
logger.notify('Run "%s Package" to install new packages that provide builds' |
|
409 |
% join(script_dir, 'easy_install')) |
|
|
660
04255afd160e
display errors in registration form. Add check for email unicity. slightly change registration message, upgrade django-registration-redux
ymh <ymh.work@gmail.com>
parents:
627
diff
changeset
|
410 |
|
|
243
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
411 |
def adjust_options(options, args): |
|
1f2840354865
correct filter on tag completion to avoid tags that are not translated
ymh <ymh.work@gmail.com>
parents:
176
diff
changeset
|
412 |
if not options_to_add: |
| 345 | 413 |
return |
| 442 | 414 |
for opt,opt_val in options_to_add.items(): |
| 345 | 415 |
#if not hasattr(options,test_opt) or getattr(options, test_opt) is None: |
| 442 | 416 |
setattr(options, opt, opt_val) |
| 0 | 417 |
|
418 |
return adjust_options, extend_parser, after_install |