[arch-commits] Commit in molecule-vagrant/trunk (105.patch PKGBUILD)
David Runge
dvzrv at gemini.archlinux.org
Tue Feb 8 09:43:36 UTC 2022
Date: Tuesday, February 8, 2022 @ 09:43:36
Author: dvzrv
Revision: 1129124
upgpkg: molecule-vagrant 1.0.0-1: Upgrade to 1.0.0.
Remove unneeded patch.
Simplify quoting in file.
Switch to PEP517 based build/install.
Run non-functional test in check().
Install license file.
Update maintainer info.
Modified:
molecule-vagrant/trunk/PKGBUILD
Deleted:
molecule-vagrant/trunk/105.patch
-----------+
105.patch | 151 ------------------------------------------------------------
PKGBUILD | 61 +++++++++++-------------
2 files changed, 30 insertions(+), 182 deletions(-)
Deleted: 105.patch
===================================================================
--- 105.patch 2022-02-08 09:43:31 UTC (rev 1129123)
+++ 105.patch 2022-02-08 09:43:36 UTC (rev 1129124)
@@ -1,151 +0,0 @@
-From 2d481a3e8d52a0ba9f7be7834571766178b0e806 Mon Sep 17 00:00:00 2001
-From: Arnaud Patard <apatard at hupstream.com>
-Date: Sat, 15 May 2021 20:59:40 +0200
-Subject: [PATCH 1/2] molecule_vagrant/test/functional: Add scenario for
- networking
-
-There's currently no test case for networking, which seems a bad
-idea, so add one.
-The verifier playbook is minimal: it's only checking that there
-are 3 interfaces (lo, management network, private network).
-
-Signed-off-by: Arnaud Patard <apatard at hupstream.com>
----
- .github/workflows/tox.yml | 8 +++----
- molecule_vagrant/test/functional/test_func.py | 3 ++-
- .../scenarios/molecule/network/converge.yml | 11 +++++++++
- .../scenarios/molecule/network/molecule.yml | 23 +++++++++++++++++++
- .../scenarios/molecule/network/verify.yml | 10 ++++++++
- 5 files changed, 50 insertions(+), 5 deletions(-)
- create mode 100644 molecule_vagrant/test/scenarios/molecule/network/converge.yml
- create mode 100644 molecule_vagrant/test/scenarios/molecule/network/molecule.yml
- create mode 100644 molecule_vagrant/test/scenarios/molecule/network/verify.yml
-
-diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml
-index f2ffb9d..5b4fb53 100644
---- a/.github/workflows/tox.yml
-+++ b/.github/workflows/tox.yml
-@@ -26,13 +26,13 @@ jobs:
- include:
- - tox_env: lint
- - tox_env: py36
-- PREFIX: PYTEST_REQPASS=5
-+ PREFIX: PYTEST_REQPASS=6
- - tox_env: py36-devel
-- PREFIX: PYTEST_REQPASS=5
-+ PREFIX: PYTEST_REQPASS=6
- - tox_env: py39
-- PREFIX: PYTEST_REQPASS=5
-+ PREFIX: PYTEST_REQPASS=6
- - tox_env: py39-devel
-- PREFIX: PYTEST_REQPASS=5
-+ PREFIX: PYTEST_REQPASS=6
- - tox_env: packaging
-
- steps:
-diff --git a/molecule_vagrant/test/functional/test_func.py b/molecule_vagrant/test/functional/test_func.py
-index 3b21fa9..826b9eb 100644
---- a/molecule_vagrant/test/functional/test_func.py
-+++ b/molecule_vagrant/test/functional/test_func.py
-@@ -71,7 +71,8 @@ def test_command_init_scenario(temp_dir):
-
-
- @pytest.mark.parametrize(
-- "scenario", [("vagrant_root"), ("config_options"), ("provider_config_options")]
-+ "scenario",
-+ [("vagrant_root"), ("config_options"), ("provider_config_options"), ("network")],
- )
- def test_vagrant_root(temp_dir, scenario):
-
-diff --git a/molecule_vagrant/test/scenarios/molecule/network/converge.yml b/molecule_vagrant/test/scenarios/molecule/network/converge.yml
-new file mode 100644
-index 0000000..cd8ecfb
---- /dev/null
-+++ b/molecule_vagrant/test/scenarios/molecule/network/converge.yml
-@@ -0,0 +1,11 @@
-+---
-+- name: Converge
-+ hosts: all
-+ gather_facts: false
-+ become: true
-+ tasks:
-+ - name: sample task # noqa 305
-+ shell:
-+ cmd: uname
-+ warn: false
-+ changed_when: false
-diff --git a/molecule_vagrant/test/scenarios/molecule/network/molecule.yml b/molecule_vagrant/test/scenarios/molecule/network/molecule.yml
-new file mode 100644
-index 0000000..983fcc8
---- /dev/null
-+++ b/molecule_vagrant/test/scenarios/molecule/network/molecule.yml
-@@ -0,0 +1,23 @@
-+---
-+dependency:
-+ name: galaxy
-+driver:
-+ name: vagrant
-+ provider:
-+ name: libvirt
-+platforms:
-+ - name: instance
-+ box: ${TESTBOX:-centos/7}
-+ provider_options:
-+ driver: ${VIRT_DRIVER:-kvm}
-+ # using session with network leads to troubles
-+ qemu_use_session: false
-+ provision: true
-+ interfaces:
-+ - network_name: private_network
-+ type: dhcp
-+ auto_config: true
-+provisioner:
-+ name: ansible
-+verifier:
-+ name: ansible
-diff --git a/molecule_vagrant/test/scenarios/molecule/network/verify.yml b/molecule_vagrant/test/scenarios/molecule/network/verify.yml
-new file mode 100644
-index 0000000..cc68b75
---- /dev/null
-+++ b/molecule_vagrant/test/scenarios/molecule/network/verify.yml
-@@ -0,0 +1,10 @@
-+---
-+- hosts: all
-+ gather_facts: true
-+ gather_subset:
-+ - network
-+ tasks:
-+ - name: Check that there are 3 interfaces
-+ assert:
-+ that:
-+ - "{{ ansible_interfaces | length == 3 }}"
-
-From c3ed4d5f0ee892651233b15c5b485d15ee539497 Mon Sep 17 00:00:00 2001
-From: Arnaud Patard <apatard at hupstream.com>
-Date: Sat, 15 May 2021 21:02:29 +0200
-Subject: [PATCH 2/2] molecule_vagrant/modules/vagrant.py: Fix network template
-
-In the changes introduced by the commit Vagrant yaml removal
-(0c1aed1fb550), the network definition in the jinja template
-got the loop iterator variable wrong. Use the right one.
-
-Fixes: #104
-
-Signed-off-by: Arnaud Patard <apatard at hupstream.com>
----
- molecule_vagrant/modules/vagrant.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/molecule_vagrant/modules/vagrant.py b/molecule_vagrant/modules/vagrant.py
-index 22f205d..532d11b 100644
---- a/molecule_vagrant/modules/vagrant.py
-+++ b/molecule_vagrant/modules/vagrant.py
-@@ -219,7 +219,7 @@
- # Network
- ##
- {% for n in instance.networks %}
-- c.vm.network "{{ network.name }}", {{ dict2args(network.options) }}
-+ c.vm.network "{{ n.name }}", {{ dict2args(n.options) }}
- {% endfor %}
-
- ##
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-02-08 09:43:31 UTC (rev 1129123)
+++ PKGBUILD 2022-02-08 09:43:36 UTC (rev 1129124)
@@ -1,44 +1,43 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
# Maintainer: Ike Devolder <ike DOT devolder AT gmail DOT com>
# Contributor: Marc Straube <email at marcstraube.de>
pkgname=molecule-vagrant
-_module_name=molecule_vagrant
-pkgver=0.6.3
-pkgrel=3
+pkgver=1.0.0
+pkgrel=1
pkgdesc="Molecule Vangrant Driver"
-arch=('any')
+arch=(any)
url="https://github.com/ansible-community/molecule-vagrant"
-license=('MIT')
-depends=('python' 'ansible' 'molecule' 'python-pyaml' 'python-vagrant')
-makedepends=('python-setuptools' 'python-setuptools-scm' 'molecule'
-'python-vagrant' 'python-pyaml' 'python-pip')
-source=(
- "${pkgname}-${pkgver}.tar.gz::https://github.com/ansible-community/molecule-vagrant/archive/${pkgver}.tar.gz"
- '105.patch'
-)
-sha512sums=('09165da30b6d678084760f8bf8ae552a5ece255b98e1cc86e76a9294bcbf720c951641208fad34d926ef3b1a97a0f65d181982ffed6f058413d2bf0846ea846e'
- '566eca8d182b50658804b145d793eb4c9182c9499439f63a0a2bd94d13b1908ce084f25e5506f8690bdc7993b06384bf97df91ac5b3f0ea7a3042b328edb107d')
+license=(MIT)
+depends=(molecule python-jinja python-selinux python-yaml python-vagrant)
+makedepends=(python-build python-install python-setuptools
+python-setuptools-scm python-setuptools-scm-git-archive python-toml python-wheel)
+checkdepends=(ansible python-filelock python-pytest)
+source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/${pkgname}/${pkgname}-${pkgver}.tar.gz")
+sha512sums=('de55cea15c5df876b21f91f7f27b6de88896ea301a9e7c240a82abfaaea44d09a6ea85941a5ff3a84cb28991c77e344f9c2aa27f852f652c98e70f51787c8ca5')
+b2sums=('6267554e55717ecde97b062867f4a72691ffd912155fe05d7f50f61682b46ed955c26789819af1e3c386dea4f89e606810c19a65212859ac6d75a491c3ef927d')
-prepare() {
- cd ${pkgname}-${pkgver}
- echo "Version: ${pkgver}" > PKG-INFO
- patch -p1 -i "$srcdir/105.patch"
+build() {
+ cd $pkgname-$pkgver
+ python -m build --wheel --skip-dependency-check --no-isolation
}
-build() {
- cd ${pkgname}-${pkgver}
- python setup.py build
+check() {
+ cd $pkgname-$pkgver
+ local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+ local _test_dir="${PWD}/test_dir"
+
+ # install to test location
+ mkdir -vp "${_test_dir}"
+ python -m install --optimize=1 --destdir="$_test_dir" dist/*.whl
+
+ export PYTHONPATH="${_test_dir}/${_site_packages}:${PYTHONPATH}"
+ # ignore tests that require running molecule
+ pytest -v "${_test_dir}/${_site_packages}/molecule_vagrant/test/" --ignore "${_test_dir}/${_site_packages}/molecule_vagrant/test/functional/" -c /dev/null
}
-#check() {
-# cd ${pkgname}-${pkgver}
-# python setup.py test
-#}
-
package() {
- pylibpath="$(dirname "$(python-config --configdir)")"
- cd ${pkgname}-${pkgver}
- python setup.py install -O1 --root="${pkgdir}" --skip-build
- cp -R ${_module_name}/cookiecutter "${pkgdir}${pylibpath}/site-packages/${_module_name}"
- cp -R ${_module_name}/playbooks "${pkgdir}${pylibpath}/site-packages/${_module_name}"
+ cd $pkgname-$pkgver
+ python -m install --optimize=1 --destdir="$pkgdir" dist/*.whl
+ install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
More information about the arch-commits
mailing list