From 278d3bb207e38108434b72218a953f95f74fe8a8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 25 Jul 2015 04:04:46 +0200 Subject: setup.py: Use ssl module for older python version m2crypto fallback was removed in 713ae6ed84. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index dc998d872..da416f4f6 100755 --- a/setup.py +++ b/setup.py @@ -18,9 +18,9 @@ inst_reqs = [ 'python-daemon', ] -# we only need m2crypto on < python2.6 +# Use the backported ssl module on < python2.6 if sys.version_info[:2] < (2, 6): - inst_reqs.append('M2Crypto') + inst_reqs.append('ssl') setup(name="Bcfg2", version=__version__, # Defined in src/lib/Bcfg2/version.py -- cgit v1.2.3-1-g7c22 From c8216e03520e36aa05be36c368c54d750407a579 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 29 Mar 2017 13:28:49 +0200 Subject: doc: Fix note f4dc3f33579584924243ac2e89f6f68ed195ec79 removed half of the note. --- doc/installation/prerequisites.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/installation/prerequisites.txt b/doc/installation/prerequisites.txt index d45599955..e6de2a9f6 100644 --- a/doc/installation/prerequisites.txt +++ b/doc/installation/prerequisites.txt @@ -56,7 +56,8 @@ Bcfg2 Server +-------------------------------+----------+--------------------------------+ | python-gamin or pyinotify | Any | gamin or inotify, python | +-------------------------------+----------+--------------------------------+ -| python-ssl (note | Any | python, backported ssl module | +| python-ssl (this is included | Any | | +| in Python2.6 and later) | | | +-------------------------------+----------+--------------------------------+ | python-setuptools | Any | | +-------------------------------+----------+--------------------------------+ -- cgit v1.2.3-1-g7c22 From dea843aed2d3d82b805baf86843de8dce0bba6b6 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 23 Mar 2017 21:20:28 +0100 Subject: setup.py: Add missing dependency --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index da416f4f6..7a2dc7efd 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ inst_reqs = [ 'lockfile', 'lxml', 'python-daemon', + 'argparse' ] # Use the backported ssl module on < python2.6 -- cgit v1.2.3-1-g7c22 From 083b5dcd6937987ac23e8316c36e793ce78eec47 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 24 Jul 2015 22:42:29 +0200 Subject: travis-ci: Use container-based infrastructure The new travis infrastructure is container-based and does not allow the use of sudo, but travis allows to install whitelisted apt packages (http://docs.travis-ci.com/user/migrating-from-legacy/). --- .travis.yml | 13 +++++++++++++ testsuite/install.sh | 6 ------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b868e83b1..7df53364c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +sudo: false language: python matrix: include: @@ -26,3 +27,15 @@ notifications: channels: - "irc.freenode.org#bcfg2" use_notice: true +addons: + apt: + packages: + - swig + - libxml2-utils + - yum + - libaugeas0 + - augeas-lenses + - libacl1-dev + - libssl-dev + - python-gamin + - python-selinux diff --git a/testsuite/install.sh b/testsuite/install.sh index 4d8778ad7..6f182bc0a 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -2,9 +2,6 @@ # install script for Travis-CI -sudo apt-get update -qq -sudo apt-get install swig libxml2-utils - pip install -r testsuite/requirements.txt PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') @@ -14,9 +11,6 @@ if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" ]]; then fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - sudo apt-get install -y yum libaugeas0 augeas-lenses libacl1-dev libssl-dev \ - python-gamin python-selinux - pip install PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas if [[ ${PYVER:0:1} == "2" ]]; then -- cgit v1.2.3-1-g7c22 From 08f7ebc85d51932635d16c420e99d547d4a7eb81 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 24 Jul 2015 22:44:28 +0200 Subject: travis-ci: Enable cache for pip The new container-based infrastructure allow public projects to use the cache system to speed up the build. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7df53364c..4f96bc5b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,3 +39,8 @@ addons: - libssl-dev - python-gamin - python-selinux +cache: + directories: + - $HOME/.cache/pip +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log -- cgit v1.2.3-1-g7c22 From c5529d8979672d4cf92d4ba54ce01256ca1d0842 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 20 Jul 2016 21:47:17 +0200 Subject: travis-ci: Cache common xml schema files --- .travis.yml | 2 ++ testsuite/Testschema/test_schema.py | 11 ++++++++--- testsuite/install.sh | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f96bc5b8..c8f0c4c71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,5 +42,7 @@ addons: cache: directories: - $HOME/.cache/pip + - $HOME/.cache/xml before_cache: - rm -f $HOME/.cache/pip/log/debug.log + - rm -f $HOME/.cache/xml/catalog.xml diff --git a/testsuite/Testschema/test_schema.py b/testsuite/Testschema/test_schema.py index cd9b74cdf..138468a91 100644 --- a/testsuite/Testschema/test_schema.py +++ b/testsuite/Testschema/test_schema.py @@ -34,13 +34,18 @@ NSMAP = dict(xs=XS) class TestSchemas(Bcfg2TestCase): schema_url = "http://www.w3.org/2001/XMLSchema.xsd" + catalog_file = os.path.expanduser("~/.cache/xml/catalog.xml") @skipUnless(HAS_XMLLINT, "xmllint not installed") def test_valid(self): + env = os.environ.copy() + if os.path.exists(self.catalog_file): + print('Using cached schema files.') + env["SGML_CATALOG_FILES"] = self.catalog_file schemas = [s for s in glob.glob(os.path.join(srcpath, '*.xsd'))] - xmllint = Popen(['xmllint', '--xinclude', '--noout', '--schema', - self.schema_url] + schemas, - stdout=PIPE, stderr=STDOUT) + xmllint = Popen(['xmllint', '--xinclude', '--noout', '--catalogs', + '--schema', self.schema_url] + schemas, + stdout=PIPE, stderr=STDOUT, env=env) print(xmllint.communicate()[0].decode()) self.assertEqual(xmllint.wait(), 0) diff --git a/testsuite/install.sh b/testsuite/install.sh index 6f182bc0a..1c9cc36b9 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -23,3 +23,23 @@ if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then fi fi fi + +# Setup the local xml schema cache +download_schema() { + if [[ ! -e "$1" ]]; then + wget -O "$1" "$2" + fi +} + +mkdir -p "$HOME/.cache/xml/" +download_schema "$HOME/.cache/xml/XMLSchema.xsd" "http://www.w3.org/2001/XMLSchema.xsd" +download_schema "$HOME/.cache/xml/xml.xsd" "http://www.w3.org/2001/xml.xsd" + +cat > "$HOME/.cache/xml/catalog.xml" < + + + + + +EOF -- cgit v1.2.3-1-g7c22 From 4f3cb4335c6d934c34d851efa587c525e6fcd876 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 23 Mar 2017 20:19:34 +0100 Subject: travis-ci: Cache wheels for python deps The python dependencies are only build once to create the wheel and cached using the travis-ci infrastructure. All builds afterwards will be faster because the cached version is used. --- .travis.yml | 1 + testsuite/install.sh | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8f0c4c71..f51637ccd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ addons: cache: directories: - $HOME/.cache/pip + - $HOME/.cache/wheels - $HOME/.cache/xml before_cache: - rm -f $HOME/.cache/pip/log/debug.log diff --git a/testsuite/install.sh b/testsuite/install.sh index 1c9cc36b9..eb569ec56 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -1,25 +1,31 @@ #!/bin/bash -ex # install script for Travis-CI +pip install --upgrade pip -pip install -r testsuite/requirements.txt +pip_wheel() { + pip wheel --find-links="$HOME/.cache/wheels/" --wheel-dir="$HOME/.cache/wheels/" "$@" + pip install --no-index --find-links="$HOME/.cache/wheels/" "$@" +} + +pip_wheel -r testsuite/requirements.txt PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" ]]; then - pip install unittest2 + pip_wheel unittest2 fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - pip install PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas if [[ ${PYVER:0:1} == "2" ]]; then - pip install cheetah m2crypto + pip_wheel cheetah m2crypto if [[ $PYVER != "2.7" ]]; then - pip install 'django<1.7' 'South<0.8' + pip_wheel 'django<1.7' 'South<0.8' else - pip install django + pip_wheel django fi fi fi -- cgit v1.2.3-1-g7c22 From d5f24fed13339d01424c4f7748c239ae33e0b606 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 25 Jul 2015 01:32:05 +0200 Subject: travis-ci: Also run tests with python2.4 and python2.5 --- .travis.yml | 17 ++++++++++----- testsuite/install.sh | 44 +++++++++++++++++++++------------------ testsuite/prepare-python.sh | 8 +++++++ testsuite/requirements-legacy.txt | 13 ++++++++++++ 4 files changed, 57 insertions(+), 25 deletions(-) create mode 100755 testsuite/prepare-python.sh create mode 100644 testsuite/requirements-legacy.txt diff --git a/.travis.yml b/.travis.yml index f51637ccd..6a061b233 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,15 @@ sudo: false language: python matrix: include: + - env: PYTHON=2.4 + - env: PYTHON=2.5 - python: "2.6" - env: WITH_OPTIONAL_DEPS=no TEST_SPHINX=no - - python: "2.6" - env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=no - - python: "2.7_with_system_site_packages" - env: WITH_OPTIONAL_DEPS=no TEST_SPHINX=no + - python: "2.7" - python: "2.7_with_system_site_packages" env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=yes +before_install: + - testsuite/prepare-python.sh + - if test -d "$HOME/custom-virtualenv/"; then source "$HOME/custom-virtualenv/bin/activate"; fi install: - testsuite/install.sh - pip install -e . @@ -29,7 +30,13 @@ notifications: use_notice: true addons: apt: + sources: + - deadsnakes packages: + - python2.4 + - python2.4-dev + - python2.5 + - python2.5-dev - swig - libxml2-utils - yum diff --git a/testsuite/install.sh b/testsuite/install.sh index eb569ec56..13a2e9d01 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -1,31 +1,35 @@ #!/bin/bash -ex # install script for Travis-CI -pip install --upgrade pip - -pip_wheel() { - pip wheel --find-links="$HOME/.cache/wheels/" --wheel-dir="$HOME/.cache/wheels/" "$@" - pip install --no-index --find-links="$HOME/.cache/wheels/" "$@" -} - -pip_wheel -r testsuite/requirements.txt - PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') -if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" ]]; then - pip_wheel unittest2 -fi +if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" && $PYVER != "2.6" ]]; then + pip install -r testsuite/requirements-legacy.txt +else + pip install --upgrade pip + + pip_wheel() { + pip wheel --find-links="$HOME/.cache/wheels/" --wheel-dir="$HOME/.cache/wheels/" "$@" + pip install --no-index --find-links="$HOME/.cache/wheels/" "$@" + } -if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas + pip_wheel -r testsuite/requirements.txt - if [[ ${PYVER:0:1} == "2" ]]; then - pip_wheel cheetah m2crypto + if [[ $PYVER == "2.6" ]]; then + pip_wheel unittest2 + fi - if [[ $PYVER != "2.7" ]]; then - pip_wheel 'django<1.7' 'South<0.8' - else - pip_wheel django + if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas + + if [[ ${PYVER:0:1} == "2" ]]; then + pip_wheel cheetah m2crypto + + if [[ $PYVER != "2.7" ]]; then + pip_wheel 'django<1.7' 'South<0.8' + else + pip_wheel django + fi fi fi fi diff --git a/testsuite/prepare-python.sh b/testsuite/prepare-python.sh new file mode 100755 index 000000000..7b72a6dc4 --- /dev/null +++ b/testsuite/prepare-python.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ -n "$PYTHON" ]; then + echo "Try to use custom python version: $PYTHON" + pip install 'virtualenv<1.8' + mkdir -p "$HOME/custom-virtualenv" + virtualenv -p "python$PYTHON" --use-distribute "$HOME/custom-virtualenv" +fi diff --git a/testsuite/requirements-legacy.txt b/testsuite/requirements-legacy.txt new file mode 100644 index 000000000..87af9cfc6 --- /dev/null +++ b/testsuite/requirements-legacy.txt @@ -0,0 +1,13 @@ +lxml<3.4 +lockfile<0.9 +python-daemon<1.4 +argparse +ssl + +nose +mock<1.1 +unittest2<0.6 +logilab-common==0.53.0 +logilab-astng==0.20.3 +pylint<0.22 +pep8<1.3 -- cgit v1.2.3-1-g7c22 From 73045f451a8cdfb0c48e87e736c3b6a28b22f6fb Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 22 Mar 2017 20:20:40 +0100 Subject: testsuite: Server requires Python2.6 We do not want to run the test for the Server with Python2.4 and Python2.5 and use the nose-exclude plugin to disable the Server tests based on the directory. We do not even want to import the modules of the Server, as it might not be possible anymore (missing dependencies or invalid syntax). nose-exclude-0.2 breaks compatibility with Python2.5 and below (it is using the "with open(..):" syntax), so we have to stick to the last version below. --- .travis.yml | 4 ++-- testsuite/Testsrc/test_code_checks.py | 5 +++-- testsuite/requirements-legacy.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6a061b233..33cd0f022 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ sudo: false language: python matrix: include: - - env: PYTHON=2.4 - - env: PYTHON=2.5 + - env: PYTHON=2.4 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer + - env: PYTHON=2.5 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer - python: "2.6" - python: "2.7" - python: "2.7_with_system_site_packages" diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py index c26d8c139..44c4633a7 100644 --- a/testsuite/Testsrc/test_code_checks.py +++ b/testsuite/Testsrc/test_code_checks.py @@ -79,9 +79,10 @@ no_checks = { "lib/Bcfg2/Server/migrations": ["*.py"], "lib/Bcfg2/Server/south_migrations": ["*.py"], } + if sys.version_info < (2, 6): - # multiprocessing core requires py2.6 - no_checks['lib/Bcfg2/Server'] = ['MultiprocessingCore.py'] + # Server requires python 2.6 + no_checks['lib/Bcfg2'] = ['Server'] try: any diff --git a/testsuite/requirements-legacy.txt b/testsuite/requirements-legacy.txt index 87af9cfc6..7d918cb45 100644 --- a/testsuite/requirements-legacy.txt +++ b/testsuite/requirements-legacy.txt @@ -5,6 +5,7 @@ argparse ssl nose +nose-exclude<0.2 mock<1.1 unittest2<0.6 logilab-common==0.53.0 -- cgit v1.2.3-1-g7c22 From 97a113956f8211a2e718afe98a623cafebc03922 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 21 Jul 2016 04:20:45 +0200 Subject: testsuite: ExceptionMessageChecker support for old python --- testsuite/ext/exception_messages.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/testsuite/ext/exception_messages.py b/testsuite/ext/exception_messages.py index cd3d7112c..5c59916df 100644 --- a/testsuite/ext/exception_messages.py +++ b/testsuite/ext/exception_messages.py @@ -35,10 +35,15 @@ class ExceptionMessageChecker(BaseChecker): priority = -1 def visit_raise(self, node): - if node.exc is None: + exc = None + try: + exc = node.exc + except AttributeError: + exc = node.type + if exc is None: return - if isinstance(node.exc, ast.Name): - raised = safe_infer(node.exc) + if isinstance(exc, ast.Name): + raised = safe_infer(exc) if (isinstance(raised, ast.Class) and raised.name not in self.config.exceptions_without_args): self.add_message('R9901', node=node.exc) -- cgit v1.2.3-1-g7c22 From 2e3ac3bd311ecf4d26032cd029dcc5e92170fe7f Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 28 Jul 2015 17:55:17 +0200 Subject: testsuite: Support for ancient pylint versions For Python2.4 and Python2.5 we need very old pylint versions (0.21.x). So we have to work around some bugs: - This adds some ugly monkey patching to backport some bugfixes from newer pylint versions (that does not support Python2.4 anymore). - Another problem is, that pylint-0.24 changed its message IDs. So this translates the new IDs into the older ones, so that the old pylint can match the disabled messages. - The newer version of pylint support more messages and some of the new messages have to be disabled. The old pylint versions have to silently ignore unknown message ids. - The compatible astng version of the old pylint does not support register_transformer, so we need to build out own variant by monkey patching the ASTNGBuilder. --- testsuite/ext/pylint_compat.py | 275 +++++++++++++++++++++++++++++++++++++++++ testsuite/ext/ssl_protocols.py | 12 +- testsuite/pylintrc.conf | 2 +- 3 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 testsuite/ext/pylint_compat.py diff --git a/testsuite/ext/pylint_compat.py b/testsuite/ext/pylint_compat.py new file mode 100644 index 000000000..8ccfbc89b --- /dev/null +++ b/testsuite/ext/pylint_compat.py @@ -0,0 +1,275 @@ +from pylint.__pkginfo__ import version as pylint_version +from logilab.astng.__pkginfo__ import version as astng_version + +def register(linter): + if pylint_version < '0.24.0': + import pylint.utils + orig_check_message_id = pylint.utils.MessagesHandlerMixIn.check_message_id + def check_message_id(self, msgid): + # translate the new message ids back into the old ones + replacements = {'12': '65', '13': '99'} + new = msgid[1:3] + if new in replacements: + msgid = msgid[0] + replacements[new] + msgid[3:] + return orig_check_message_id(self, msgid) + pylint.utils.MessagesHandlerMixIn.check_message_id = check_message_id + + def ignore(meth, msgid, *args, **kwargs): + # ignore non-existent message ids in disable/enable comments + ignore = ['W1401', 'R0924'] + if msgid in ignore: + return + return meth(msgid, *args, **kwargs) + linter._options_methods['disable'] = lambda *args, **kwargs: ignore(linter.disable, *args, **kwargs) + linter._options_methods['enable'] = lambda *args, **kwargs: ignore(linter.enable, *args, **kwargs) + + if pylint_version < '0.22.0': + import pylint.checkers.exceptions + orig_visit_raise = pylint.checkers.exceptions.ExceptionsChecker.visit_raise + def visit_raise(self, node): + if not hasattr(node, 'type') and hasattr(node, 'exc'): + node.type = node.exc + return orig_visit_raise(self, node) + pylint.checkers.exceptions.ExceptionsChecker.visit_raise = visit_raise + + if astng_version < '0.23': + import logilab.astng.scoped_nodes + from logilab.astng.bases import InferenceContext, InferenceError + + # backport import bug fix (e642ba33ba1bdde04ac9f0c75a25dc40131c55e7) + def ancestors(self, recurs=True, context=None): + yielded = set([self]) + if context is None: + context = InferenceContext() + for stmt in self.bases: + path = set(context.path) + try: + for baseobj in stmt.infer(context): + if not isinstance(baseobj, logilab.astng.scoped_nodes.Class): + # duh ? + continue + if baseobj in yielded: + continue # cf xxx above + yielded.add(baseobj) + yield baseobj + if recurs: + for grandpa in baseobj.ancestors(True, context): + if grandpa in yielded: + continue # cf xxx above + yielded.add(grandpa) + yield grandpa + except InferenceError: + # XXX log error ? + pass + context.path = path + logilab.astng.scoped_nodes.Class.ancestors = ancestors + + # support for classpropery (d110bcf2de4b8bc48e41638cf430f17c5714ffbc) + try: + from logilab.astng.rebuilder import TreeRebuilder + except: + try: + from logilab.astng._nodes_ast import TreeRebuilder + except: + from logilab.astng._nodes_compiler import TreeRebuilder + from logilab.astng import nodes + + orig_visit_function = TreeRebuilder.visit_function + def visit_function(self, node, parent): + newnode = orig_visit_function(self, node, parent) + if newnode.decorators is not None: + for decorator_expr in newnode.decorators.nodes: + if isinstance(decorator_expr, nodes.Name): + if decorator_expr.name == 'classproperty': + newnode.type = 'classmethod' + return newnode + TreeRebuilder.visit_function = visit_function + + if astng_version < '0.22': + from logilab.astng import nodes + from logilab.astng.bases import _infer_stmts, copy_context, path_wrapper, \ + InferenceError, NotFoundError + from logilab.astng._exceptions import ASTNGBuildingException + import logilab.astng.scoped_nodes + from logilab.astng.node_classes import List, DelName + + # backport of 11886551cfdcf969f0a661f8ab63c1fa1a6dd399 with + # a bit revert of af896e299ce5e381a928a77a9c28941cad90a243 + def infer_from(self, context=None, asname=True): + name = context.lookupname + if name is None: + raise InferenceError() + if asname: + name = self.real_name(name) + module = self.do_import_module(self.modname) + try: + context = copy_context(context) + context.lookupname = name + return _infer_stmts(module.getattr(name, ignore_locals=module is self.root()), context) + except NotFoundError: + raise InferenceError(name) + nodes.From.infer = path_wrapper(infer_from) + + def getattr(self, name, context=None, ignore_locals=False): + if name in self.special_attributes: + if name == '__file__': + return [cf(self.file)] + self.locals.get(name, []) + if name == '__path__' and self.package: + return [List()] + self.locals.get(name, []) + return std_special_attributes(self, name) + if not ignore_locals and name in self.locals: + return self.locals[name] + if self.package: + try: + return [self.import_module(name, relative_only=True)] + except (KeyboardInterrupt, SystemExit): + raise + except: + pass + raise NotFoundError(name) + logilab.astng.scoped_nodes.Module.getattr = logilab.astng.scoped_nodes.remove_nodes(getattr, DelName) + + if astng_version < '0.21.1': + # backport of 3d463da455e33e7ddc53a295b6a33db7b9e4288b + from logilab.astng.scoped_nodes import Function + from logilab.astng.rebuilder import RebuildVisitor + from logilab.astng.bases import YES, Instance + + orig_init = Function.__init__ + def init(self, name, doc): + orig_init(self, name, doc) + self.instance_attrs = {} + Function.__init__ = init + + orig_getattr = Function.getattr + def getattr(self, name, context=None): + if name != '__module__' and name in self.instance_attrs: + return self.instance_attrs[name] + return orig_getattr(self, name, context) + Function.getattr = getattr + + def delayed_assattr(self, node): + """visit a AssAttr node -> add name to locals, handle members + definition + """ + try: + frame = node.frame() + for infered in node.expr.infer(): + if infered is YES: + continue + try: + if infered.__class__ is Instance: + infered = infered._proxied + iattrs = infered.instance_attrs + elif isinstance(infered, Instance): + # Const, Tuple, ... we may be wrong, may be not, but + # anyway we don't want to pollute builtin's namespace + continue + elif infered.is_function: + iattrs = infered.instance_attrs + else: + iattrs = infered.locals + except AttributeError: + # XXX log error + #import traceback + #traceback.print_exc() + continue + values = iattrs.setdefault(node.attrname, []) + if node in values: + continue + # get assign in __init__ first XXX useful ? + if frame.name == '__init__' and values and not \ + values[0].frame().name == '__init__': + values.insert(0, node) + else: + values.append(node) + except InferenceError: + pass + RebuildVisitor.delayed_assattr = delayed_assattr + + if astng_version < '0.20.4': + try: + from logilab.astng._nodes_ast import TreeRebuilder, _lineno_parent + except: + from logilab.astng._nodes_compiler import TreeRebuilder + _lineno_parent = (lambda *args: TreeRebuilder._set_infos(None, *args)) + from logilab.astng import nodes + from logilab.astng.bases import NodeNG, Instance + from logilab.astng.mixins import ParentAssignTypeMixin + + class Set(NodeNG, Instance, ParentAssignTypeMixin): + _astng_fields = ('elts',) + elts = None + + def pytype(self): + return '__builtin__.set' + + def itered(self): + return self.elts + + def visit_set(self, node, parent): + newnode = Set() + _lineno_parent(node, newnode, parent) + newnode.elts = [self.visit(child, newnode) for child in node.elts] + newnode.set_line_info(newnode.last_child()) + return newnode + TreeRebuilder.visit_set = visit_set + + def visit_setcomp(self, node, parent): + newnode = nodes.SetComp() + _lineno_parent(node, newnode, parent) + newnode.elt = self.visit(node.elt, newnode) + newnode.generators = [self.visit(child, newnode) + for child in node.generators] + newnode.set_line_info(newnode.last_child()) + return newnode + TreeRebuilder.visit_setcomp = visit_setcomp + + class DictComp(NodeNG): + _astng_fields = ('key', 'value', 'generators') + key = None + value = None + generators = None + + def visit_dictcomp(self, node, parent): + newnode = DictComp() + _lineno_parent(node, newnode, parent) + newnode.key = self.visit(node.key, newnode) + newnode.value = self.visit(node.value, newnode) + newnode.generators = [self.visit(child, newnode) + for child in node.generators] + newnode.set_line_info(newnode.last_child()) + return newnode + TreeRebuilder.visit_dictcomp = visit_dictcomp + + # backport of bfe9e5c53cfb75c3b45ebb5cb8e8902464782c7d + from logilab.astng.node_classes import From + orig_from_init = From.__init__ + def from_init(self, fromname, names, level=0): + orig_from_init(self, fromname or '', names, level) + From.__init__ = from_init + + # partial backport of 6d59ad07d722d01e458aaf8fd14fd7dfc7ebaa6e + from logilab.astng.scoped_nodes import Module + orig_absolute_modname = Module.absolute_modname + def absolute_modname(self, modname, level): + result = orig_absolute_modname(self, modname, level) + if result[-1] == '.': + return result[:-1] + return result + Module.absolute_modname = absolute_modname + + # python2.4 compatibility (no super on old-style classes) + from logilab.astng.bases import Proxy, UnboundMethod + + def unbound_igetattr(self, name, context=None): + if name == 'im_func': + return iter((self._proxied,)) + return Proxy.igetattr(self, name, context) + UnboundMethod.igetattr = unbound_igetattr + + def unbound_getattr(self, name, context=None): + if name == 'im_func': + return [self._proxied] + return Proxy.getattr(self, name, context) + UnboundMethod.getattr = unbound_getattr diff --git a/testsuite/ext/ssl_protocols.py b/testsuite/ext/ssl_protocols.py index 66068d2a9..a56293669 100644 --- a/testsuite/ext/ssl_protocols.py +++ b/testsuite/ext/ssl_protocols.py @@ -1,5 +1,5 @@ try: - from logilab.astng import MANAGER, scoped_nodes, node_classes + from logilab.astng import MANAGER, builder, scoped_nodes, node_classes PYLINT=0 except ImportError: from astroid import MANAGER, scoped_nodes, node_classes @@ -12,6 +12,14 @@ def ssl_transform(module): def register(linter): if PYLINT == 0: - MANAGER.register_transformer(ssl_transform) + if hasattr(MANAGER, 'register_transformer'): + MANAGER.register_transformer(ssl_transform) + else: + safe = builder.ASTNGBuilder.string_build + def _string_build(self, data, modname='', path=None): + if modname == 'ssl': + data += '\n\nPROTOCOL_SSLv23 = 0\nPROTOCOL_TLSv1 = 0' + return safe(self, data, modname, path) + builder.ASTNGBuilder.string_build = _string_build else: MANAGER.register_transform(scoped_nodes.Module, ssl_transform) diff --git a/testsuite/pylintrc.conf b/testsuite/pylintrc.conf index 50ece77db..ce7e407df 100644 --- a/testsuite/pylintrc.conf +++ b/testsuite/pylintrc.conf @@ -19,7 +19,7 @@ persistent=no # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins=ext.exception_messages,ext.ssl_protocols +load-plugins=ext.exception_messages,ext.ssl_protocols,ext.pylint_compat [MESSAGES CONTROL] -- cgit v1.2.3-1-g7c22 From a1135d1eaaca9bd07c587ddbd0ce9faa04601216 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 22 Mar 2017 20:34:56 +0100 Subject: travis-ci: Only install packages if required The build dependencies for the optional dependencies should only be installed if we like to test with optional dependencies. To keep the .travis.yml clean we use yaml anchors and references. --- .travis.yml | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33cd0f022..17d3bf58c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,42 @@ sudo: false language: python + +packages: &build_deps_optional + - swig + - libxml2-utils + - yum + - libaugeas0 + - augeas-lenses + - libacl1-dev + - libssl-dev + matrix: include: - env: PYTHON=2.4 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer + addons: + apt: + sources: [deadsnakes] + packages: [python2.4, python2.4-dev] - env: PYTHON=2.5 NOSE_EXCLUDE_DIRS=testsuite/Testsrc/Testlib/TestServer + addons: + apt: + sources: [deadsnakes] + packages: [python2.5, python2.5-dev, libbluetooth-dev] + - python: "2.6" + - python: "2.6" + env: WITH_OPTIONAL_DEPS=yes + addons: + apt: + packages: *build_deps_optional + - python: "2.7" - python: "2.7_with_system_site_packages" env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=yes + addons: + apt: + packages: [*build_deps_optional, python-gamin, python-selinux] + before_install: - testsuite/prepare-python.sh - if test -d "$HOME/custom-virtualenv/"; then source "$HOME/custom-virtualenv/bin/activate"; fi @@ -18,39 +47,25 @@ script: - nosetests testsuite after_failure: - pip freeze + branches: except: - maint-1.2 - 1.1.0-stable + notifications: email: chris.a.st.pierre@gmail.com irc: channels: - "irc.freenode.org#bcfg2" use_notice: true -addons: - apt: - sources: - - deadsnakes - packages: - - python2.4 - - python2.4-dev - - python2.5 - - python2.5-dev - - swig - - libxml2-utils - - yum - - libaugeas0 - - augeas-lenses - - libacl1-dev - - libssl-dev - - python-gamin - - python-selinux + cache: directories: - $HOME/.cache/pip - $HOME/.cache/wheels - $HOME/.cache/xml + before_cache: - rm -f $HOME/.cache/pip/log/debug.log - rm -f $HOME/.cache/xml/catalog.xml -- cgit v1.2.3-1-g7c22 From 306c3dc42b55d6f3925d144c84aae00dbf4439ab Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 22 Mar 2017 20:43:18 +0100 Subject: testsuite: No doc test is the default For the doc test all (optional) dependencies have to be installed, so the doc test is only usefull in a few special test environments. --- testsuite/Testsrc/test_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/Testsrc/test_doc.py b/testsuite/Testsrc/test_doc.py index 93c8d1bb4..d105254c5 100644 --- a/testsuite/Testsrc/test_doc.py +++ b/testsuite/Testsrc/test_doc.py @@ -20,7 +20,7 @@ except ImportError: HAS_SPHINX = False -TEST_SPHINX = bool(os.environ.get('TEST_SPHINX', 'yes') != 'no') +TEST_SPHINX = bool(os.environ.get('TEST_SPHINX', 'no') != 'no') class DocTest(Bcfg2TestCase): -- cgit v1.2.3-1-g7c22 From 97fb0411763063d5f6163618e5aab2f3700f630f Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 25 Jul 2015 03:38:52 +0200 Subject: Fix errros with old pylint/pep8 For Python2.4 we need older version of pylint and pep8, that finds some more errors: - On python2.4 _ast is not available and pylint uses compiler.ast, that seems to have some problems with the line numbers if a comment is following the pylint disable marker. - In python2.4 there is no xml.etree. But we can ignore this error because Client.XML tries to find a suitable library. - Some small formatting issues. --- src/lib/Bcfg2/Client/Tools/APT.py | 18 +++++++++--------- src/lib/Bcfg2/Client/Tools/BundleDeps.py | 4 ++-- src/lib/Bcfg2/Client/Tools/Chkconfig.py | 4 ++-- src/lib/Bcfg2/Client/Tools/DebInit.py | 4 ++-- src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py | 8 ++++---- src/lib/Bcfg2/Client/Tools/RcUpdate.py | 4 ++-- src/lib/Bcfg2/Client/Tools/SYSV.py | 4 ++-- src/lib/Bcfg2/Client/XML.py | 2 +- src/lib/Bcfg2/Client/__init__.py | 4 ++-- src/lib/Bcfg2/DBSettings.py | 11 ++++++----- src/lib/Bcfg2/Logger.py | 7 ++++--- src/lib/Bcfg2/Options/Parser.py | 4 +++- 12 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/lib/Bcfg2/Client/Tools/APT.py b/src/lib/Bcfg2/Client/Tools/APT.py index 9b3dded99..4350f6067 100644 --- a/src/lib/Bcfg2/Client/Tools/APT.py +++ b/src/lib/Bcfg2/Client/Tools/APT.py @@ -42,10 +42,10 @@ class APT(Bcfg2.Client.Tools.Tool): if reqdir not in path_entries: os.environ['PATH'] = os.environ['PATH'] + ':' + reqdir self.pkgcmd = '%s ' % self.aptget + \ - '-o DPkg::Options::=--force-confold ' + \ - '-o DPkg::Options::=--force-confmiss ' + \ - '--reinstall ' + \ - '--force-yes ' + '-o DPkg::Options::=--force-confold ' + \ + '-o DPkg::Options::=--force-confmiss ' + \ + '--reinstall ' + \ + '--force-yes ' if not Bcfg2.Options.setup.debug: self.pkgcmd += '-q=2 ' self.pkgcmd += '-y install %s' @@ -158,8 +158,8 @@ class APT(Bcfg2.Client.Tools.Tool): (entry.attrib['name'])) return False pkgname = entry.get('name') - if pkgname not in self.pkg_cache or \ - not self.pkg_cache[pkgname].is_installed: + if (pkgname not in self.pkg_cache or + not self.pkg_cache[pkgname].is_installed): self.logger.info("Package %s not installed" % (entry.get('name'))) entry.set('current_exists', 'false') return False @@ -183,9 +183,9 @@ class APT(Bcfg2.Client.Tools.Tool): return False else: # version matches - if not Bcfg2.Options.setup.quick \ - and entry.get('verify', 'true') == 'true' \ - and checksums: + if (not Bcfg2.Options.setup.quick and + entry.get('verify', 'true') == 'true' and + checksums): pkgsums = self.VerifyDebsums(entry, modlist) return pkgsums return True diff --git a/src/lib/Bcfg2/Client/Tools/BundleDeps.py b/src/lib/Bcfg2/Client/Tools/BundleDeps.py index aaa090633..c1af3f7f1 100644 --- a/src/lib/Bcfg2/Client/Tools/BundleDeps.py +++ b/src/lib/Bcfg2/Client/Tools/BundleDeps.py @@ -28,7 +28,7 @@ class BundleDeps(Bcfg2.Client.Tools.Tool): bundle_name = entry.get('name') for bundle in self.config.findall('./Bundle/Bundle'): - if bundle.get('name') == bundle_name and \ - bundle not in self.modified: + if (bundle.get('name') == bundle_name and + bundle not in self.modified): self.modified.append(bundle) return dict() diff --git a/src/lib/Bcfg2/Client/Tools/Chkconfig.py b/src/lib/Bcfg2/Client/Tools/Chkconfig.py index b535de191..b1abb376a 100644 --- a/src/lib/Bcfg2/Client/Tools/Chkconfig.py +++ b/src/lib/Bcfg2/Client/Tools/Chkconfig.py @@ -88,8 +88,8 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool): if bootstatus is not None: if bootstatus == 'on': # make sure service is enabled on boot - bootcmd = '/sbin/chkconfig %s %s' % \ - (entry.get('name'), bootstatus) + bootcmd = ('/sbin/chkconfig %s %s' % + (entry.get('name'), bootstatus)) elif bootstatus == 'off': # make sure service is disabled on boot bootcmd = '/sbin/chkconfig %s %s' % (entry.get('name'), diff --git a/src/lib/Bcfg2/Client/Tools/DebInit.py b/src/lib/Bcfg2/Client/Tools/DebInit.py index 53e5e7ec6..35768f0fe 100644 --- a/src/lib/Bcfg2/Client/Tools/DebInit.py +++ b/src/lib/Bcfg2/Client/Tools/DebInit.py @@ -142,8 +142,8 @@ class DebInit(Bcfg2.Client.Tools.SvcTool): # 'disabled' means we don't attempt to modify running svcs return bootcmdrv and seqcmdrv buildmode = Bcfg2.Options.setup.service_mode == 'build' - if (entry.get('status') == 'on' and not buildmode) and \ - entry.get('current_status') == 'off': + if ((entry.get('status') == 'on' and not buildmode) and + entry.get('current_status') == 'off'): svccmdrv = self.start_service(entry) elif (entry.get('status') == 'off' or buildmode) and \ entry.get('current_status') == 'on': diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py b/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py index f4f1ee4bf..ad9a740a6 100644 --- a/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py +++ b/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py @@ -249,8 +249,8 @@ class POSIXAugeas(POSIXTool): for cmd in self.get_commands(entry): try: if not cmd.verify(): - err = "Augeas: Command has not been applied to %s: %s" % \ - (entry.get("name"), cmd) + err = ("Augeas: Command has not been applied to %s: %s" % + (entry.get("name"), cmd)) self.logger.debug(err) entry.set('qtext', "\n".join([entry.get('qtext', ''), err])) @@ -259,8 +259,8 @@ class POSIXAugeas(POSIXTool): else: cmd.command.set("verified", "true") except: # pylint: disable=W0702 - err = "Augeas: Unexpected error verifying %s: %s: %s" % \ - (entry.get("name"), cmd, sys.exc_info()[1]) + err = ("Augeas: Unexpected error verifying %s: %s: %s" % + (entry.get("name"), cmd, sys.exc_info()[1])) self.logger.error(err) entry.set('qtext', "\n".join([entry.get('qtext', ''), err])) rv = False diff --git a/src/lib/Bcfg2/Client/Tools/RcUpdate.py b/src/lib/Bcfg2/Client/Tools/RcUpdate.py index a482dbc00..21257f64b 100644 --- a/src/lib/Bcfg2/Client/Tools/RcUpdate.py +++ b/src/lib/Bcfg2/Client/Tools/RcUpdate.py @@ -102,8 +102,8 @@ class RcUpdate(Bcfg2.Client.Tools.SvcTool): # 'disabled' means we don't attempt to modify running svcs return bootcmdrv buildmode = Bcfg2.Options.setup.service_mode == 'build' - if (entry.get('status') == 'on' and not buildmode) and \ - entry.get('current_status') == 'off': + if ((entry.get('status') == 'on' and not buildmode) and + entry.get('current_status') == 'off'): svccmdrv = self.start_service(entry) elif (entry.get('status') == 'off' or buildmode) and \ entry.get('current_status') == 'on': diff --git a/src/lib/Bcfg2/Client/Tools/SYSV.py b/src/lib/Bcfg2/Client/Tools/SYSV.py index 332638de4..4eea0273f 100644 --- a/src/lib/Bcfg2/Client/Tools/SYSV.py +++ b/src/lib/Bcfg2/Client/Tools/SYSV.py @@ -119,8 +119,8 @@ class SYSV(Bcfg2.Client.Tools.PkgTool): self.logger.debug("Package %s not installed" % entry.get("name")) else: - if Bcfg2.Options.setup.quick or \ - entry.attrib.get('verify', 'true') == 'false': + if (Bcfg2.Options.setup.quick or + entry.attrib.get('verify', 'true') == 'false'): return True rv = self.cmd.run("/usr/sbin/pkgchk -n %s" % entry.get('name')) if rv.success: diff --git a/src/lib/Bcfg2/Client/XML.py b/src/lib/Bcfg2/Client/XML.py index 4ba06abae..93e4facdb 100644 --- a/src/lib/Bcfg2/Client/XML.py +++ b/src/lib/Bcfg2/Client/XML.py @@ -2,7 +2,7 @@ # library will use lxml, then builtin xml.etree, then ElementTree -# pylint: disable=E0611,W0611,W0613,C0103 +# pylint: disable=E0611,E1101,W0611,W0613,C0103 try: from lxml.etree import Element, SubElement, tostring, XMLParser diff --git a/src/lib/Bcfg2/Client/__init__.py b/src/lib/Bcfg2/Client/__init__.py index dc4dfb983..157cc7f65 100644 --- a/src/lib/Bcfg2/Client/__init__.py +++ b/src/lib/Bcfg2/Client/__init__.py @@ -921,8 +921,8 @@ class Client(object): """Generate XML summary of execution statistics.""" states = {} for (item, val) in list(self.states.items()): - if not Bcfg2.Options.setup.only_important or \ - item.get('important', 'false').lower() == 'true': + if (not Bcfg2.Options.setup.only_important or + item.get('important', 'false').lower() == 'true'): states[item] = val feedback = XML.Element("upload-statistics") diff --git a/src/lib/Bcfg2/DBSettings.py b/src/lib/Bcfg2/DBSettings.py index 254dfa4b8..ddcf66b44 100644 --- a/src/lib/Bcfg2/DBSettings.py +++ b/src/lib/Bcfg2/DBSettings.py @@ -21,7 +21,8 @@ try: except ImportError: HAS_SOUTH = False -settings = dict( # pylint: disable=C0103 +# pylint: disable=C0103 +settings = dict( TIME_ZONE=None, TEMPLATE_DEBUG=False, DEBUG=False, @@ -106,8 +107,8 @@ def finalize_django_config(opts=None, silent=False): OPTIONS=opts.db_opts, SCHEMA=opts.db_schema)) - if hasattr(opts, "reporting_db_engine") and \ - opts.reporting_db_engine is not None: + if (hasattr(opts, "reporting_db_engine") and + opts.reporting_db_engine is not None): settings['DATABASES']['Reporting'] = dict( ENGINE="django.db.backends.%s" % opts.reporting_db_engine, NAME=opts.reporting_db_name, @@ -180,9 +181,9 @@ def upgrade_to_django_migrations(database, logger): cursor.cursor.execute('SELECT migration FROM south_migrationhistory') applied_migrations = [name for (name,) in cursor.fetchall()] last_migration = sorted(applied_migrations).pop() + # django.db.DatabaseError is not working here, because we are + # using the low level api to interact directly with the database except: # pylint: disable=W0702 - # django.db.DatabaseError is not working here, because we are - # using the low level api to interact directly with the database logger.debug("No south migration detected for database: %s." % database) diff --git a/src/lib/Bcfg2/Logger.py b/src/lib/Bcfg2/Logger.py index e5f316a18..a26971df4 100644 --- a/src/lib/Bcfg2/Logger.py +++ b/src/lib/Bcfg2/Logger.py @@ -133,10 +133,11 @@ class FragmentingSysLogHandler(logging.handlers.SysLogHandler): logging.WARNING), self.format(reconn))) self.socket.send(msg) + + # If we still fail then drop it. Running + # bcfg2-server as non-root can trigger permission + # denied exceptions. except: # pylint: disable=W0702 - # If we still fail then drop it. Running - # bcfg2-server as non-root can trigger permission - # denied exceptions. pass diff --git a/src/lib/Bcfg2/Options/Parser.py b/src/lib/Bcfg2/Options/Parser.py index ced61c591..51e41850c 100644 --- a/src/lib/Bcfg2/Options/Parser.py +++ b/src/lib/Bcfg2/Options/Parser.py @@ -12,12 +12,14 @@ __all__ = ["setup", "OptionParserException", "Parser", "get_parser", "new_parser"] +# pylint: disable=C0103 #: The repository option. This is specified here (and imported into #: :module:`Bcfg2.Options.Common`) rather than vice-versa due to #: circular imports. -repository = PathOption( # pylint: disable=C0103 +repository = PathOption( '-Q', '--repository', cf=('server', 'repository'), default='/var/lib/bcfg2', help="Server repository path") +# pylint: enable=C0103 #: A module-level :class:`argparse.Namespace` object that stores all -- cgit v1.2.3-1-g7c22 From 63576800349e3db9851b5cf1592517d206148231 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 22 Jul 2016 00:08:21 +0200 Subject: Client: Restore python2.4 compatibility --- src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py b/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py index ad9a740a6..bcd695058 100644 --- a/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py +++ b/src/lib/Bcfg2/Client/Tools/POSIX/Augeas.py @@ -5,6 +5,7 @@ import Bcfg2.Client.XML from augeas import Augeas from Bcfg2.Client.Tools.POSIX.base import POSIXTool from Bcfg2.Client.Tools.POSIX.File import POSIXFile +from Bcfg2.Compat import all # pylint: disable=W0622 class AugeasCommand(object): -- cgit v1.2.3-1-g7c22 From a04736aa8ed732bc4d5fb2a23e3def7d72b3d0b7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 20 Jul 2016 21:19:48 +0200 Subject: Utils: classproperty should use classmethod --- src/lib/Bcfg2/Utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Bcfg2/Utils.py b/src/lib/Bcfg2/Utils.py index 2fdc0c3e0..b043fd11c 100644 --- a/src/lib/Bcfg2/Utils.py +++ b/src/lib/Bcfg2/Utils.py @@ -338,7 +338,7 @@ class classproperty(object): # pylint: disable=C0103 self.getter = getter def __get__(self, instance, owner): - return self.getter(owner) + return classmethod(self.getter).__get__(None, owner)() def is_string(strng, encoding): -- cgit v1.2.3-1-g7c22 From be3d9eb5cad2f09c395b24c55fd9c95c60caf561 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 22 Mar 2017 20:53:12 +0100 Subject: Bcfg2/manage.py: Fix pylint errors --- src/lib/Bcfg2/manage.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/lib/Bcfg2/manage.py b/src/lib/Bcfg2/manage.py index b156deb0f..9675a3db1 100755 --- a/src/lib/Bcfg2/manage.py +++ b/src/lib/Bcfg2/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -import os +""" Wrapper for the django manage.py with the Bcfg2 Opitons parsing. """ + import sys import django import Bcfg2.Options @@ -10,14 +11,21 @@ try: except ImportError: pass -parser = Bcfg2.Options.get_parser() -parser.add_options([Bcfg2.Options.PositionalArgument('django_command', nargs='*')]) -parser.parse() -if __name__ == "__main__": +def main(): + parser = Bcfg2.Options.get_parser() + parser.add_options([ + Bcfg2.Options.PositionalArgument('django_command', nargs='*')]) + parser.parse() + if django.VERSION[0] == 1 and django.VERSION[1] >= 6: from django.core.management import execute_from_command_line - execute_from_command_line(sys.argv[:1] + Bcfg2.Options.setup.django_command) + execute_from_command_line( + sys.argv[:1] + Bcfg2.Options.setup.django_command) else: from django.core.management import execute_manager execute_manager(Bcfg2.DBSettings.settings) + + +if __name__ == "__main__": + main() -- cgit v1.2.3-1-g7c22 From 730ef612d9bbd9fc94a8e5d916831a91af033868 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 22 Mar 2017 21:03:21 +0100 Subject: travis-ci: Show skipped tests For the test environment with all optional dependencies, we want to run all tests. So let's print all skipped tests. --- .travis.yml | 2 ++ testsuite/install.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17d3bf58c..118adc92b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ matrix: addons: apt: packages: *build_deps_optional + script: nosetests --show-skipped testsuite - python: "2.7" - python: "2.7_with_system_site_packages" @@ -36,6 +37,7 @@ matrix: addons: apt: packages: [*build_deps_optional, python-gamin, python-selinux] + script: nosetests --show-skipped testsuite before_install: - testsuite/prepare-python.sh diff --git a/testsuite/install.sh b/testsuite/install.sh index 13a2e9d01..604872a5e 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -20,8 +20,9 @@ else fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy cherrypy python-augeas - + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy \ + cherrypy python-augeas nose-show-skipped + if [[ ${PYVER:0:1} == "2" ]]; then pip_wheel cheetah m2crypto -- cgit v1.2.3-1-g7c22 From 260ed3e5d8895bf74f7433b73c9e7c6e2fa9ee3b Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 23 Mar 2017 21:20:47 +0100 Subject: testsuite: Django should work on Python3, too --- testsuite/install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testsuite/install.sh b/testsuite/install.sh index 604872a5e..076d91a4c 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -25,12 +25,12 @@ else if [[ ${PYVER:0:1} == "2" ]]; then pip_wheel cheetah m2crypto - - if [[ $PYVER != "2.7" ]]; then - pip_wheel 'django<1.7' 'South<0.8' - else - pip_wheel django - fi + fi + + if [[ $PYVER == "2.6" ]]; then + pip_wheel 'django<1.7' 'South<0.8' + else + pip_wheel django fi fi fi -- cgit v1.2.3-1-g7c22 From b456b30113b0f5474f39415df7eaf0b2d08825f8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 28 Mar 2017 17:02:20 +0200 Subject: travis-ci: New python-augeas version requires libaugeas-dev The new python-augeas version builds a "C Foreign Function Interface" for libaugeas and do not load the library with dlopen at runtime anymore. So libaugeas-dev is required as build dependencies. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 118adc92b..dd8c9defd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ packages: &build_deps_optional - swig - libxml2-utils - yum - - libaugeas0 + - libaugeas-dev - augeas-lenses - libacl1-dev - libssl-dev -- cgit v1.2.3-1-g7c22 From adf2d9f060a629071abe325e3b4b882e5893e858 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 29 Mar 2017 13:37:09 +0200 Subject: travis-ci: Use default emails notification address The default email notifications should be sufficient: > By default, a build email is sent to the committer and the author, > but only if they have access to the repository the commit was > pushed to. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dd8c9defd..542ac2337 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,6 @@ branches: - 1.1.0-stable notifications: - email: chris.a.st.pierre@gmail.com irc: channels: - "irc.freenode.org#bcfg2" -- cgit v1.2.3-1-g7c22 From 9c21072a9d10744ef39c3fdc4a5a6a0797401810 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 16 Aug 2017 10:01:21 +0200 Subject: testsuite: Use older mercurial for python2.6 > Mercurial 4.2.2 is the last release to support Python 2.6. > Use this if you need to run Mercurial on old platforms and > you cannot update your Python installation. See also: https://www.mercurial-scm.org/wiki/SupportedPythonVersions --- testsuite/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/install.sh b/testsuite/install.sh index 076d91a4c..1bd214936 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -20,7 +20,7 @@ else fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - pip_wheel PyYAML pyinotify boto pylibacl Jinja2 mercurial guppy \ + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 guppy \ cherrypy python-augeas nose-show-skipped if [[ ${PYVER:0:1} == "2" ]]; then @@ -28,9 +28,9 @@ else fi if [[ $PYVER == "2.6" ]]; then - pip_wheel 'django<1.7' 'South<0.8' + pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' else - pip_wheel django + pip_wheel django mercurial fi fi fi -- cgit v1.2.3-1-g7c22 From 17d83c675874ce7fff32c382b6d47af1628d45fc Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 16:30:32 +0200 Subject: travis-ci: Enable Python3 tests, but allow it to fail --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 542ac2337..12fdddea6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,18 @@ matrix: packages: [*build_deps_optional, python-gamin, python-selinux] script: nosetests --show-skipped testsuite + - python: "3.5" + env: WITH_OPTIONAL_DEPS=yes + addons: + apt: + packages: *build_deps_optional + script: nosetests --show-skipped testsuite + + allow_failures: + - python: "3.5" + + fast_finish: true + before_install: - testsuite/prepare-python.sh - if test -d "$HOME/custom-virtualenv/"; then source "$HOME/custom-virtualenv/bin/activate"; fi -- cgit v1.2.3-1-g7c22 From 57e4c9e500b0c1094548d8a16699117cedb07598 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 16:37:08 +0200 Subject: travis-ci: Simplified test script --- .travis.yml | 5 +---- testsuite/test.sh | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100755 testsuite/test.sh diff --git a/.travis.yml b/.travis.yml index 12fdddea6..4d5d00f4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,6 @@ matrix: addons: apt: packages: *build_deps_optional - script: nosetests --show-skipped testsuite - python: "2.7" - python: "2.7_with_system_site_packages" @@ -37,14 +36,12 @@ matrix: addons: apt: packages: [*build_deps_optional, python-gamin, python-selinux] - script: nosetests --show-skipped testsuite - python: "3.5" env: WITH_OPTIONAL_DEPS=yes addons: apt: packages: *build_deps_optional - script: nosetests --show-skipped testsuite allow_failures: - python: "3.5" @@ -58,7 +55,7 @@ install: - testsuite/install.sh - pip install -e . script: - - nosetests testsuite + - testsuite/test.sh after_failure: - pip freeze diff --git a/testsuite/test.sh b/testsuite/test.sh new file mode 100755 index 000000000..739c3c2b0 --- /dev/null +++ b/testsuite/test.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +NOSE_OPTS="" + +if [ "$WITH_OPTIONAL_DEPS" = "yes" ]; then + NOSE_OPTS="--show-skipped" +fi + +exec nosetests $NOSE_OPTS testsuite -- cgit v1.2.3-1-g7c22 From 870ce516689f55f20ffd569786951ba0311df88a Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 16:47:33 +0200 Subject: testsuite: Requirements for Python3 --- testsuite/install.sh | 5 +++-- testsuite/requirements-26.txt | 9 +++++++++ testsuite/requirements.txt | 9 +++++---- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 testsuite/requirements-26.txt diff --git a/testsuite/install.sh b/testsuite/install.sh index 1bd214936..b8220d217 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -13,10 +13,11 @@ else pip install --no-index --find-links="$HOME/.cache/wheels/" "$@" } - pip_wheel -r testsuite/requirements.txt - if [[ $PYVER == "2.6" ]]; then + pip_wheel -r testsuite/requirements-26.txt pip_wheel unittest2 + else + pip_wheel -r testsuite/requirements.txt fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then diff --git a/testsuite/requirements-26.txt b/testsuite/requirements-26.txt new file mode 100644 index 000000000..f85dc6de4 --- /dev/null +++ b/testsuite/requirements-26.txt @@ -0,0 +1,9 @@ +lxml +python-daemon<2.0.0 +argparse +genshi + +nose +mock +pylint<0.29 +pep8 diff --git a/testsuite/requirements.txt b/testsuite/requirements.txt index 0d8c297aa..80ba8e067 100644 --- a/testsuite/requirements.txt +++ b/testsuite/requirements.txt @@ -1,9 +1,10 @@ lxml +python-daemon +genshi +argparse + nose mock -sphinx<1.5 pylint<0.29 pep8 -python-daemon<2.0.0 -genshi -argparse +sphinx<1.5 -- cgit v1.2.3-1-g7c22 From d4e6925334c2db366dca85bf04b38ecf73a5af70 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 16:51:11 +0200 Subject: travis-ci: Use the new default dist Since 2017-07-18 the default dist is changing to trusty[1]. Just using the new default before the switch. 1: https://blog.travis-ci.com/2017-07-11-trusty-as-default-linux-is-coming --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4d5d00f4a..022201bab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ sudo: false +dist: trusty language: python packages: &build_deps_optional -- cgit v1.2.3-1-g7c22 From 74f37ee90939e3deb811fe4e44c9aeda4180c87e Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 17:09:14 +0200 Subject: testsuite: guppy does not support Python3 --- testsuite/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/install.sh b/testsuite/install.sh index b8220d217..4ea811de0 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -21,11 +21,11 @@ else fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then - pip_wheel PyYAML pyinotify boto pylibacl Jinja2 guppy \ + pip_wheel PyYAML pyinotify boto pylibacl Jinja2 \ cherrypy python-augeas nose-show-skipped if [[ ${PYVER:0:1} == "2" ]]; then - pip_wheel cheetah m2crypto + pip_wheel cheetah m2crypto guppy fi if [[ $PYVER == "2.6" ]]; then -- cgit v1.2.3-1-g7c22 From bba671cf8df8dfadeec926acb7a3d15d07946dc7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 17:11:04 +0200 Subject: testsuite: Use cheetah3 if possible cheetah3 is a fork of cheetah for Python2.7 and Python3. --- testsuite/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/install.sh b/testsuite/install.sh index 4ea811de0..d2fd20acb 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -25,13 +25,13 @@ else cherrypy python-augeas nose-show-skipped if [[ ${PYVER:0:1} == "2" ]]; then - pip_wheel cheetah m2crypto guppy + pip_wheel m2crypto guppy fi if [[ $PYVER == "2.6" ]]; then - pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' + pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' cheetah else - pip_wheel django mercurial + pip_wheel django mercurial cheetah3 fi fi fi -- cgit v1.2.3-1-g7c22 From 47ebf4e59cf84295aa072d909fe3312ff57e305b Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 17:32:22 +0200 Subject: testsuite: Fix building of m2crypto with Python2.6 --- testsuite/install.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/testsuite/install.sh b/testsuite/install.sh index d2fd20acb..758d5bdf8 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -24,13 +24,18 @@ else pip_wheel PyYAML pyinotify boto pylibacl Jinja2 \ cherrypy python-augeas nose-show-skipped - if [[ ${PYVER:0:1} == "2" ]]; then - pip_wheel m2crypto guppy - fi - if [[ $PYVER == "2.6" ]]; then - pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' cheetah + pip install \ + --global-option='build_ext' \ + --global-option='--include-dirs=/usr/include/x86_64-linux-gnu' \ + m2crypto + + pip_wheel 'django<1.7' 'South<0.8' 'mercurial<4.3' cheetah guppy else + if [[ $PYVER == "2.7" ]]; then + pip_wheel m2crypto guppy + fi + pip_wheel django mercurial cheetah3 fi fi -- cgit v1.2.3-1-g7c22 From 92606b5f9f881cf29a7d57210c57fe6ec6dc85e8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 17:37:50 +0200 Subject: testsuite: Fix syntax --- testsuite/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/common.py b/testsuite/common.py index 944471ade..e0ff3ed19 100644 --- a/testsuite/common.py +++ b/testsuite/common.py @@ -167,7 +167,7 @@ class Bcfg2TestCase(TestCase): sys.stderr = cls._stderr if hasattr(TestCase, "assertCountEqual"): - assertItemsEqual = assertCountEqual + assertItemsEqual = TestCase.assertCountEqual def assertXMLEqual(self, el1, el2, msg=None): """ Test that the two XML trees given are equal. """ -- cgit v1.2.3-1-g7c22 From 3b372355f0d8e6799abc29f149ee479a0b89095e Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 18:09:57 +0200 Subject: testsuite: Bump pylint version for Python3 --- testsuite/ext/pylint_compat.py | 7 ++++++- testsuite/ext/ssl_protocols.py | 2 +- testsuite/install.sh | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/testsuite/ext/pylint_compat.py b/testsuite/ext/pylint_compat.py index 8ccfbc89b..5300df8e6 100644 --- a/testsuite/ext/pylint_compat.py +++ b/testsuite/ext/pylint_compat.py @@ -1,5 +1,10 @@ from pylint.__pkginfo__ import version as pylint_version -from logilab.astng.__pkginfo__ import version as astng_version + +try: + from logilab.astng.__pkginfo__ import version as astng_version +except ImportError: + from astroid.__pkginfo__ import version as astng_version + def register(linter): if pylint_version < '0.24.0': diff --git a/testsuite/ext/ssl_protocols.py b/testsuite/ext/ssl_protocols.py index a56293669..f92e3e355 100644 --- a/testsuite/ext/ssl_protocols.py +++ b/testsuite/ext/ssl_protocols.py @@ -8,7 +8,7 @@ except ImportError: def ssl_transform(module): if module.name == 'ssl': for proto in ('SSLv23', 'TLSv1'): - module.locals['PROTOCOL_%s' % proto] = [node_classes.Const()] + module.locals['PROTOCOL_%s' % proto] = [node_classes.Const(0)] def register(linter): if PYLINT == 0: diff --git a/testsuite/install.sh b/testsuite/install.sh index 758d5bdf8..01c5199f2 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -18,6 +18,11 @@ else pip_wheel unittest2 else pip_wheel -r testsuite/requirements.txt + + if [[ ${PYVER:0:1} == "3" ]]; then + # TODO: Move to "requirements.txt" if all the new errors are fixed. + pip_wheel 'pylint>1.4' + fi fi if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then -- cgit v1.2.3-1-g7c22 From e1dad29296e49c574c16c43e6753a4f685056f25 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 18:28:22 +0200 Subject: testsuite: Bump sphinx version https://github.com/sphinx-doc/sphinx/issues/3234 should be fixed now. --- testsuite/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/requirements.txt b/testsuite/requirements.txt index 80ba8e067..665ed961d 100644 --- a/testsuite/requirements.txt +++ b/testsuite/requirements.txt @@ -7,4 +7,4 @@ nose mock pylint<0.29 pep8 -sphinx<1.5 +sphinx -- cgit v1.2.3-1-g7c22 From 0fdabbcb4668d5f70f76c08a6e3216c5542e7457 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 17 Aug 2017 21:32:52 +0200 Subject: travis-ci: Fix "with_system_site_packages" The "with_system_site_packages" virtualenv seems to be missing the pymodules directory containing python modules installed with the python-support debian helper. So we use the default environment and manually add the references to the system-wide python packages. --- .travis.yml | 4 ++-- testsuite/install.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 022201bab..af365b9d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ matrix: packages: *build_deps_optional - python: "2.7" - - python: "2.7_with_system_site_packages" - env: WITH_OPTIONAL_DEPS=yes TEST_SPHINX=yes + - python: "2.7" + env: WITH_OPTIONAL_DEPS=yes WITH_SYSTEM_SITE_PACKAGES=yes TEST_SPHINX=yes addons: apt: packages: [*build_deps_optional, python-gamin, python-selinux] diff --git a/testsuite/install.sh b/testsuite/install.sh index 01c5199f2..af07de0a9 100755 --- a/testsuite/install.sh +++ b/testsuite/install.sh @@ -2,6 +2,7 @@ # install script for Travis-CI PYVER=$(python -c 'import sys;print(".".join(str(v) for v in sys.version_info[0:2]))') +SITE_PACKAGES=$(python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())') if [[ ${PYVER:0:1} == "2" && $PYVER != "2.7" && $PYVER != "2.6" ]]; then pip install -r testsuite/requirements-legacy.txt @@ -46,6 +47,15 @@ else fi fi +# Use system site-packages and pymodules +if [[ "$WITH_SYSTEM_SITE_PACKAGES" == "yes" ]]; then + cat < "$SITE_PACKAGES/system-packages.pth" +/usr/lib/python$PYVER/site-packages/ +/usr/lib/python$PYVER/dist-packages/ +/usr/lib/pymodules/python$PYVER/ +EOF +fi + # Setup the local xml schema cache download_schema() { if [[ ! -e "$1" ]]; then -- cgit v1.2.3-1-g7c22