[arch-commits] Commit in molecule/repos/community-any (3 files)

Ike Devolder idevolder at archlinux.org
Tue May 26 14:54:19 UTC 2020


    Date: Tuesday, May 26, 2020 @ 14:54:19
  Author: idevolder
Revision: 635108

archrelease: copy trunk to community-any

Added:
  molecule/repos/community-any/64b8b7608513bd4aceb6e58f3bdbd775913064da.patch
    (from rev 635107, molecule/trunk/64b8b7608513bd4aceb6e58f3bdbd775913064da.patch)
  molecule/repos/community-any/PKGBUILD
    (from rev 635107, molecule/trunk/PKGBUILD)
Deleted:
  molecule/repos/community-any/PKGBUILD

------------------------------------------------+
 64b8b7608513bd4aceb6e58f3bdbd775913064da.patch |   71 +++++++++++
 PKGBUILD                                       |  142 +++++++++++------------
 2 files changed, 144 insertions(+), 69 deletions(-)

Copied: molecule/repos/community-any/64b8b7608513bd4aceb6e58f3bdbd775913064da.patch (from rev 635107, molecule/trunk/64b8b7608513bd4aceb6e58f3bdbd775913064da.patch)
===================================================================
--- 64b8b7608513bd4aceb6e58f3bdbd775913064da.patch	                        (rev 0)
+++ 64b8b7608513bd4aceb6e58f3bdbd775913064da.patch	2020-05-26 14:54:19 UTC (rev 635108)
@@ -0,0 +1,71 @@
+From 64b8b7608513bd4aceb6e58f3bdbd775913064da Mon Sep 17 00:00:00 2001
+From: Arnaud Patard <apatard at hupstream.com>
+Date: Wed, 29 Apr 2020 16:44:58 +0200
+Subject: [PATCH] Fix environment handling for sh.py >= 1.13
+
+Since sh.py 1.13, a new check on the environment variables has been added
+with commit https://github.com/amoffat/sh/commit/5b274778fb4be647bbb95f9bec14153f186bcc1f.
+
+This leads to failures in the testsuite since the code is passing
+os.environ, which is not a dict().
+
+It's also breaking MOLECULE_ENV_FILE handling with errors like (from the testsuite):
+
+E           TypeError: Invalid special arguments:
+E
+E             'env': value None of env key 'MOLECULE_ENV_FILE' must be a str
+
+so:
+- use dict() to convert os.environ to a dict in _rebake_command(),
+- use str() when defining MOLECULE_ENV_FILE to make sure self.env_file is a string.
+
+To avoid any other surprise with 1.14 or newer, I've changed the sh.py requirement
+to < 1.14. The requirement is not 1.13 but 1.13.1 to get the fix for sh.py bug #520
+(https://github.com/amoffat/sh/issues/520).
+
+Signed-off-by: Arnaud Patard <apatard at hupstream.com>
+---
+ molecule/config.py        | 2 +-
+ molecule/test/conftest.py | 2 +-
+ setup.cfg                 | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/molecule/config.py b/molecule/config.py
+index 86b92acde..9d25f2c40 100644
+--- a/molecule/config.py
++++ b/molecule/config.py
+@@ -169,7 +169,7 @@ def env(self):
+         return {
+             "MOLECULE_DEBUG": str(self.debug),
+             "MOLECULE_FILE": self.config_file,
+-            "MOLECULE_ENV_FILE": self.env_file,
++            "MOLECULE_ENV_FILE": str(self.env_file),
+             "MOLECULE_STATE_FILE": self.state.state_file,
+             "MOLECULE_INVENTORY_FILE": self.provisioner.inventory_file,
+             "MOLECULE_EPHEMERAL_DIRECTORY": self.scenario.ephemeral_directory,
+diff --git a/molecule/test/conftest.py b/molecule/test/conftest.py
+index 23f53dc8d..649bdbd64 100644
+--- a/molecule/test/conftest.py
++++ b/molecule/test/conftest.py
+@@ -45,7 +45,7 @@ def run_command(cmd, env=os.environ, log=True):
+ 
+ 
+ def _rebake_command(cmd, env, out=LOG.out, err=LOG.error):
+-    return cmd.bake(_env=env, _out=out, _err=err)
++    return cmd.bake(_env=dict(env), _out=out, _err=err)
+ 
+ 
+ def is_subset(subset, superset):
+diff --git a/setup.cfg b/setup.cfg
+index db8631792..ddc213c3d 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -77,7 +77,7 @@ install_requires =
+ 	pexpect >= 4.6.0, < 5
+ 	pluggy >= 0.7.1, < 1.0
+ 	PyYAML >= 5.1, < 6
+-	sh >= 1.12.14, < 1.13
++	sh >= 1.13.1, < 1.14
+ 	tabulate >= 0.8.4
+ 	tree-format >= 0.1.2
+ 	yamllint >= 1.15.0, < 2

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-05-26 14:54:13 UTC (rev 635107)
+++ PKGBUILD	2020-05-26 14:54:19 UTC (rev 635108)
@@ -1,69 +0,0 @@
-# Maintainer: David Runge <dvzrv at archlinux.org>
-
-pkgname=molecule
-pkgver=3.0.4
-pkgrel=2
-pkgdesc="Aids in the development and testing of Ansible roles"
-arch=('any')
-url="https://github.com/ansible-community/molecule"
-license=('MIT')
-depends=('ansible' 'python-cerberus' 'python-click' 'python-click-completion'
-'python-click-help-colors' 'python-colorama' 'python-cookiecutter'
-'python-gilt' 'python-jinja' 'python-paramiko' 'python-pexpect' 'python-pluggy'
-'python-selinux' 'python-sh' 'python-six' 'python-tabulate'
-'python-tree-format' 'python-yaml' 'yamllint')
-makedepends=('python-setuptools-scm' 'python-simplejson')
-# TODO: potentially add 'python-shade'
-checkdepends=('docker' 'python-ansi2html' 'python-docker' 'python-mock'
-'python-pytest' 'python-pytest-cov' 'python-pytest-helpers-namespace'
-'python-pytest-html' 'python-pytest-mock' 'python-pytest-sugar'
-'python-pytest-verbose-parametrize' 'python-pytest-xdist' 'python-testinfra')
-optdepends=('docker: for the docker driver'
-            'molecule-vagrant: for the vagrant driver'
-            'podman: for the podman driver'
-            'python-pywinrm: for Windows support'
-            'python-testinfra: for the testinfra verifier')
-source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz")
-sha512sums=('84420677d62aea7e4a3570b97884d85c48a0fe1d94ccdecc400e962a37d772c37bb64b569ac9c2f6e1b034f85758554ff1e16a2a9d5a42120d27d54d8691bdc0')
-
-prepare() {
-  cd "$pkgname-$pkgver"
-  # python-pre-commit is absolutely not a runtime dependency
-  sed -e '/pre-commit/d' -i setup.cfg
-}
-
-build() {
-  cd "$pkgname-$pkgver"
-  python setup.py build
-}
-
-check() {
-  cd "$pkgname-$pkgver"
-  # installing into test location, so pytest can pick up the executable
-  mkdir -vp test_dir
-  python setup.py install --skip-build \
-    --optimize=1 \
-    --prefix=/usr \
-    --root="test_dir"
-  local python_version="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
-  export PYTHONPATH="${PWD}/test_dir/usr/lib/python${python_version}/site-packages/:${PYTHONPATH}"
-  export PATH="${PWD}/test_dir/usr/bin:${PATH}"
-  # do not run tests that require interaction with the docker daemon
-  pytest -v \
-         --ignore='molecule/test/functional/docker/' \
-         --ignore='molecule/test/functional/test_command.py' \
-         -k 'not test_execute \
-             and not test_execute_bakes \
-             and not test_execute_bakes_with_ansible_args \
-             and not test_executes_cathces_and_exits_return_code_with_stdout'
-}
-
-package() {
-  cd "$pkgname-$pkgver"
-  python setup.py install --skip-build \
-    --optimize=1 \
-    --prefix=/usr \
-    --root="${pkgdir}"
-  install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
-  install -vDm 644 {AUTHORS,CHANGELOG,CONTRIBUTING,README}.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
-}

Copied: molecule/repos/community-any/PKGBUILD (from rev 635107, molecule/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-05-26 14:54:19 UTC (rev 635108)
@@ -0,0 +1,73 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+pkgname=molecule
+pkgver=3.0.4
+pkgrel=3
+pkgdesc="Aids in the development and testing of Ansible roles"
+arch=('any')
+url="https://github.com/ansible-community/molecule"
+license=('MIT')
+depends=('ansible' 'python-cerberus' 'python-click' 'python-click-completion'
+'python-click-help-colors' 'python-colorama' 'python-cookiecutter'
+'python-gilt' 'python-jinja' 'python-paramiko' 'python-pexpect' 'python-pluggy'
+'python-selinux' 'python-sh' 'python-six' 'python-tabulate'
+'python-tree-format' 'python-yaml' 'yamllint')
+makedepends=('python-setuptools-scm' 'python-simplejson')
+# TODO: potentially add 'python-shade'
+checkdepends=('docker' 'python-ansi2html' 'python-docker' 'python-mock'
+'python-pytest' 'python-pytest-cov' 'python-pytest-helpers-namespace'
+'python-pytest-html' 'python-pytest-mock' 'python-pytest-sugar'
+'python-pytest-verbose-parametrize' 'python-pytest-xdist' 'python-testinfra')
+optdepends=('docker: for the docker driver'
+            'molecule-vagrant: for the vagrant driver'
+            'podman: for the podman driver'
+            'python-pywinrm: for Windows support'
+            'python-testinfra: for the testinfra verifier')
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+        "64b8b7608513bd4aceb6e58f3bdbd775913064da.patch")
+sha512sums=('84420677d62aea7e4a3570b97884d85c48a0fe1d94ccdecc400e962a37d772c37bb64b569ac9c2f6e1b034f85758554ff1e16a2a9d5a42120d27d54d8691bdc0'
+            '6b3bcfde754ad54439e1adab1457b95afcf7b7850047df9405b98bd1a592f00e06568e6e2ea792efe3e275e31bc5d94b74497b1de2b55f42ddeab6e017b52a1e')
+
+prepare() {
+  cd "$pkgname-$pkgver"
+  # python-pre-commit is absolutely not a runtime dependency
+  sed -e '/pre-commit/d' -i setup.cfg
+  # increase python-sh requirement
+  patch -p1 -i "$srcdir/64b8b7608513bd4aceb6e58f3bdbd775913064da.patch"
+}
+
+build() {
+  cd "$pkgname-$pkgver"
+  python setup.py build
+}
+
+check() {
+  cd "$pkgname-$pkgver"
+  # installing into test location, so pytest can pick up the executable
+  mkdir -vp test_dir
+  python setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="test_dir"
+  local python_version="$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')"
+  export PYTHONPATH="${PWD}/test_dir/usr/lib/python${python_version}/site-packages/:${PYTHONPATH}"
+  export PATH="${PWD}/test_dir/usr/bin:${PATH}"
+  # do not run tests that require interaction with the docker daemon
+  pytest -v \
+         --ignore='molecule/test/functional/docker/' \
+         --ignore='molecule/test/functional/test_command.py' \
+         -k 'not test_execute \
+             and not test_execute_bakes \
+             and not test_execute_bakes_with_ansible_args \
+             and not test_executes_cathces_and_exits_return_code_with_stdout'
+}
+
+package() {
+  cd "$pkgname-$pkgver"
+  python setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
+  install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+  install -vDm 644 {AUTHORS,CHANGELOG,CONTRIBUTING,README}.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
+}



More information about the arch-commits mailing list