Version 0.1.7 0.1.7
authorThierry Florac <tflorac@ulthar.net>
Sun, 14 Jan 2018 12:44:07 +0100
changeset 39 25d3419c3733
parent 38 40e74c0dca57
child 40 8d54446fe172
Version 0.1.7
bootstrap.py
buildout.cfg
docs/HISTORY.txt
setup.py
src/pyams_content_es.egg-info/PKG-INFO
src/pyams_content_es/locales/fr/LC_MESSAGES/pyams_content_es.mo
src/pyams_content_es/locales/fr/LC_MESSAGES/pyams_content_es.po
src/pyams_content_es/locales/pyams_content_es.pot
--- a/bootstrap.py	Sun Jan 14 12:43:47 2018 +0100
+++ b/bootstrap.py	Sun Jan 14 12:44:07 2018 +0100
@@ -25,7 +25,10 @@
 
 from optparse import OptionParser
 
-tmpeggs = tempfile.mkdtemp()
+__version__ = '2015-07-01'
+# See zc.buildout's changelog if this version is up to date.
+
+tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')
 
 usage = '''\
 [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
@@ -35,18 +38,19 @@
 Simply run this script in a directory containing a buildout.cfg, using the
 Python that you want bin/buildout to use.
 
-Note that by using --find-links to point to local resources, you can keep 
+Note that by using --find-links to point to local resources, you can keep
 this script from going over the network.
 '''
 
 parser = OptionParser(usage=usage)
-parser.add_option("-v", "--version", help="use a specific zc.buildout version")
-
+parser.add_option("--version",
+                  action="store_true", default=False,
+                  help=("Return bootstrap.py version."))
 parser.add_option("-t", "--accept-buildout-test-releases",
                   dest='accept_buildout_test_releases',
                   action="store_true", default=False,
-                  help=("Normally, if you do not specify a --version, the "
-                        "bootstrap script and buildout gets the newest "
+                  help=("Normally, if you do not specify a --buildout-version, "
+                        "the bootstrap script and buildout gets the newest "
                         "*final* versions of zc.buildout and its recipes and "
                         "extensions for you.  If you use this flag, "
                         "bootstrap and buildout will get the newest releases "
@@ -59,36 +63,57 @@
 parser.add_option("--allow-site-packages",
                   action="store_true", default=False,
                   help=("Let bootstrap.py use existing site packages"))
-
+parser.add_option("--buildout-version",
+                  help="Use a specific zc.buildout version")
+parser.add_option("--setuptools-version",
+                  help="Use a specific setuptools version")
+parser.add_option("--setuptools-to-dir",
+                  help=("Allow for re-use of existing directory of "
+                        "setuptools versions"))
 
 options, args = parser.parse_args()
+if options.version:
+    print("bootstrap.py version %s" % __version__)
+    sys.exit(0)
+
 
 ######################################################################
 # load/install setuptools
 
 try:
-    if options.allow_site_packages:
-        import setuptools
-        import pkg_resources
     from urllib.request import urlopen
 except ImportError:
     from urllib2 import urlopen
 
 ez = {}
-exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
+if os.path.exists('ez_setup.py'):
+    exec(open('ez_setup.py').read(), ez)
+else:
+    exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
 
 if not options.allow_site_packages:
     # ez_setup imports site, which adds site packages
-    # this will remove them from the path to ensure that incompatible versions 
+    # this will remove them from the path to ensure that incompatible versions
     # of setuptools are not in the path
     import site
-    # inside a virtualenv, there is no 'getsitepackages'. 
+    # inside a virtualenv, there is no 'getsitepackages'.
     # We can't remove these reliably
     if hasattr(site, 'getsitepackages'):
         for sitepackage_path in site.getsitepackages():
-            sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
+            # Strip all site-packages directories from sys.path that
+            # are not sys.prefix; this is because on Windows
+            # sys.prefix is a site-package directory.
+            if sitepackage_path != sys.prefix:
+                sys.path[:] = [x for x in sys.path
+                               if sitepackage_path not in x]
 
 setup_args = dict(to_dir=tmpeggs, download_delay=0)
+
+if options.setuptools_version is not None:
+    setup_args['version'] = options.setuptools_version
+if options.setuptools_to_dir is not None:
+    setup_args['to_dir'] = options.setuptools_to_dir
+
 ez['use_setuptools'](**setup_args)
 import setuptools
 import pkg_resources
@@ -104,7 +129,12 @@
 
 ws = pkg_resources.working_set
 
+setuptools_path = ws.find(
+    pkg_resources.Requirement.parse('setuptools')).location
+
+# Fix sys.path here as easy_install.pth added before PYTHONPATH
 cmd = [sys.executable, '-c',
+       'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
        'from setuptools.command.easy_install import main; main()',
        '-mZqNxd', tmpeggs]
 
@@ -117,21 +147,23 @@
 if find_links:
     cmd.extend(['-f', find_links])
 
-setuptools_path = ws.find(
-    pkg_resources.Requirement.parse('setuptools')).location
-
 requirement = 'zc.buildout'
-version = options.version
+version = options.buildout_version
 if version is None and not options.accept_buildout_test_releases:
     # Figure out the most recent final version of zc.buildout.
     import setuptools.package_index
     _final_parts = '*final-', '*final'
 
     def _final_version(parsed_version):
-        for part in parsed_version:
-            if (part[:1] == '*') and (part not in _final_parts):
-                return False
-        return True
+        try:
+            return not parsed_version.is_prerelease
+        except AttributeError:
+            # Older setuptools
+            for part in parsed_version:
+                if (part[:1] == '*') and (part not in _final_parts):
+                    return False
+            return True
+
     index = setuptools.package_index.PackageIndex(
         search_path=[setuptools_path])
     if find_links:
@@ -156,7 +188,7 @@
 cmd.append(requirement)
 
 import subprocess
-if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
+if subprocess.call(cmd) != 0:
     raise Exception(
         "Failed to execute command:\n%s" % repr(cmd)[1:-1])
 
--- a/buildout.cfg	Sun Jan 14 12:43:47 2018 +0100
+++ b/buildout.cfg	Sun Jan 14 12:44:07 2018 +0100
@@ -84,4 +84,4 @@
 eggs = pyams_content_es [test]
 
 [versions]
-pyams_content_es = 0.1.6
+pyams_content_es = 0.1.7
--- a/docs/HISTORY.txt	Sun Jan 14 12:43:47 2018 +0100
+++ b/docs/HISTORY.txt	Sun Jan 14 12:44:07 2018 +0100
@@ -1,6 +1,11 @@
 History
 =======
 
+0.1.7
+-----
+ - use ZODBConnection class instead of ZEOConnection to handle any ZODB storage for content indexer
+ - add Pyramid settings to start indexer process
+
 0.1.6
 -----
  - updated external files and paragraphs index adapters
--- a/setup.py	Sun Jan 14 12:43:47 2018 +0100
+++ b/setup.py	Sun Jan 14 12:44:07 2018 +0100
@@ -22,7 +22,7 @@
 README = os.path.join(DOCS, 'README.txt')
 HISTORY = os.path.join(DOCS, 'HISTORY.txt')
 
-version = '0.1.6'
+version = '0.1.7'
 long_description = open(README).read() + '\n\n' + open(HISTORY).read()
 
 tests_require = []
--- a/src/pyams_content_es.egg-info/PKG-INFO	Sun Jan 14 12:43:47 2018 +0100
+++ b/src/pyams_content_es.egg-info/PKG-INFO	Sun Jan 14 12:44:07 2018 +0100
@@ -1,11 +1,12 @@
 Metadata-Version: 1.1
 Name: pyams-content-es
-Version: 0.1.6
+Version: 0.1.7
 Summary: PyAMS content interfaces and classes for ElasticSearch indexation
 Home-page: http://hg.ztfy.org/pyams/pyams_content_es
 Author: Thierry Florac
 Author-email: tflorac@ulthar.net
 License: ZPL
+Description-Content-Type: UNKNOWN
 Description: 
         Liste des actions à effectuer
         =============================
@@ -23,6 +24,11 @@
         History
         =======
         
+        0.1.7
+        -----
+         - use ZODBConnection class instead of ZEOConnection to handle any ZODB storage for content indexer
+         - add Pyramid settings to start indexer process
+        
         0.1.6
         -----
          - updated external files and paragraphs index adapters
Binary file src/pyams_content_es/locales/fr/LC_MESSAGES/pyams_content_es.mo has changed
--- a/src/pyams_content_es/locales/fr/LC_MESSAGES/pyams_content_es.po	Sun Jan 14 12:43:47 2018 +0100
+++ b/src/pyams_content_es/locales/fr/LC_MESSAGES/pyams_content_es.po	Sun Jan 14 12:44:07 2018 +0100
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2016-04-21 18:25+0200\n"
+"POT-Creation-Date: 2018-01-11 17:19+0100\n"
 "PO-Revision-Date: 2016-04-21 18:26+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -37,9 +37,9 @@
 msgstr "Tester la connexion"
 
 #: src/pyams_content_es/interfaces/__init__.py:42
-msgid "ZEO connection name"
-msgstr "Connexion ZEO"
+msgid "ZODB connection name"
+msgstr "Connexion ZODB"
 
 #: src/pyams_content_es/interfaces/__init__.py:43
-msgid "Name of ZEO connection utility defining indexer connection"
-msgstr "Nom de la connexion ZEO définissant les paramètres de connexion"
+msgid "Name of ZODB connection defining indexer connection"
+msgstr "Nom de la ZODB définissant les paramètres de connexion"
--- a/src/pyams_content_es/locales/pyams_content_es.pot	Sun Jan 14 12:43:47 2018 +0100
+++ b/src/pyams_content_es/locales/pyams_content_es.pot	Sun Jan 14 12:44:07 2018 +0100
@@ -1,12 +1,12 @@
-# 
+#
 # SOME DESCRIPTIVE TITLE
 # This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2018.
 #, fuzzy
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2016-04-21 18:25+0200\n"
+"POT-Creation-Date: 2018-01-11 17:19+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -37,9 +37,9 @@
 msgstr ""
 
 #: ./src/pyams_content_es/interfaces/__init__.py:42
-msgid "ZEO connection name"
+msgid "ZODB connection name"
 msgstr ""
 
 #: ./src/pyams_content_es/interfaces/__init__.py:43
-msgid "Name of ZEO connection utility defining indexer connection"
+msgid "Name of ZODB connection defining indexer connection"
 msgstr ""