archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / molecule-plugins / trunk / PKGBUILD
blob62b2e29747ea85b2d6346f925239504a99c64bfd
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgname=molecule-plugins
4 pkgver=23.4.1
5 pkgrel=3
6 pkgdesc="Collection of molecule plugins"
7 arch=(any)
8 url="https://github.com/ansible-community/molecule-plugins"
9 license=(MIT)
10 depends=(
11   molecule
12   python
13   python-boto3  # for ec2 driver
14   python-cryptography  # for ec2 driver
15   python-docker
16   python-packaging  # required for podman driver
17   python-requests
18   python-selinux
20 makedepends=(
21   python-build
22   python-installer
23   python-setuptools
24   python-setuptools-scm
25   python-wheel
27 checkdepends=(
28   podman
29   python-filelock
30   python-google-auth
31   python-google-api-python-client
32   python-pexpect
33   python-pycryptodome
34   python-pytest
35   python-pytest-helpers-namespace
36   python-vagrant
37   vagrant
39 optdepends=(
40   'python-pycryptodome: for GCE playbooks'
41   'python-google-auth: for GCE playbooks'
42   'python-google-api-python-client: for GCE playbooks'
43   'python-vagrant: for vagrant module'
45 conflicts=(
46   molecule-containers
47   molecule-docker
48   molecule-podman
49   molecule-vagrant
51 replaces=(
52   molecule-containers
53   molecule-docker
54   molecule-podman
55   molecule-vagrant
57 source=(
58   https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz
59   $pkgname-23.4.1-molecule_internals.patch
61 sha512sums=('5c158e278318402006f9f86f4143dac27d0cf6e95912963414e9c06720f9b5572240a6b6ddaccbd2872bb594144215a4a5ec434f4414e692fb72a3d97de175d3'
62             '11822fbd65ba7ccc796e454c015fe765a811e82bd89dc0727201cd45495907df3f808be967d73f45473c073816f9db5c072f32dbcab807229d7c7cf82de9101c')
63 b2sums=('e0261d189e55b0705ff2e967620146dd6ef0bc4182a6e87d5ffdaf8e1298dc0bc9e9bb188669300b63cf692f822ad6b0d4c8038fc1cff6afbf7f79b61dfbc184'
64         '62bb11057e5c429229a033ca8911b836817c456270077469decf608c9c9927c425e1c647a54f5370b4cabb644cfb0a1e44e0166b6a4f21912ce4e430f6b56a8f')
66 prepare() {
67   # fix issues with vagrant plugin using molecule internals that are now gone:
68   # https://github.com/ansible-community/molecule-plugins/pull/142
69   # https://bugs.archlinux.org/task/78447
70   patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-23.4.1-molecule_internals.patch
73 build() {
74   cd $pkgname-$pkgver
75   python -m build --wheel --no-isolation
78 check() {
79   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
80   local pytest_options=(
81     --deselect test/azure/functional/test_azure.py::test_command_init_scenario
82     --deselect test/containers/functional/test_containers.py::test_command_init_scenario
83     --deselect test/podman/test_func.py::test_command_init_scenario
84     --deselect test/podman/test_func.py::test_sample
85     --deselect test/podman/test_func.py::test_dockerfile
86     --deselect test/vagrant/functional/test_func.py::test_command_init_scenario
87     --deselect test/vagrant/functional/test_func.py::test_invalid_settings
88     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[vagrant_root]
89     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[config_options]
90     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[provider_config_options]
91     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[default]
92     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[default-compat]
93     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[network]
94     --deselect test/vagrant/functional/test_func.py::test_vagrant_root[hostname]
95     --deselect test/vagrant/functional/test_func.py::test_multi_node
96     -vv
97   )
99   cd $pkgname-$pkgver
100   # install to temporary location, as importlib is used
101   python -m installer --destdir=test_dir dist/*.whl
102   export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
103   # skip tests that would fail because of missing interpreters: https://github.com/pdm-project/pdm/issues/1175
104   pytest "${pytest_options[@]}"
107 package() {
108   cd $pkgname-$pkgver
109   python -m installer --destdir="$pkgdir" dist/*.whl
110   install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
111   install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
112   install -vDm 644 doc/ec2/*.rst  -t "$pkgdir/usr/share/doc/$pkgname/ec2"
113   install -vDm 644 doc/vagrant/*.rst  -t "$pkgdir/usr/share/doc/$pkgname/vagrant"