upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ansible-lint / repos / community-any / PKGBUILD
blobc5e11cac037dcecaf4c8190a4e3853f7f8eef00f
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Maintainer: Frederik Schwan <freswa at archlinux dot org>
3 # Contributor: Sander Boom <sanderboom@gmail.com>
5 pkgname=ansible-lint
6 # past 6.15.0 because upstream broke ansible-lint with ansible-compat changes:
7 # https://github.com/ansible/ansible-lint/issues/3393
8 _commit=2fca3fed958702a2b40dd454511ea1b9f624c740
9 pkgver=6.15.0.r45.g2fca3fe
10 pkgrel=2
11 pkgdesc="Checks playbooks for practices and behaviour that could potentially be improved."
12 arch=('any')
13 url="https://github.com/ansible/ansible-lint"
14 license=('GPL3')
15 depends=(python ansible-core git yamllint
16   python-{ansible-compat,black,enrich,filelock,jsonschema,pyaml,packaging,rich,ruamel-yaml,wcmatch})
17 makedepends=(git python-{build,installer,setuptools,setuptools-scm,wheel})
18 checkdepends=(mypy python-jmespath python-pylint python-pytest python-pytest-mock)
19 optdepends=('ansible: check official ansible collections')
20 source=(git+https://github.com/ansible/ansible-lint.git#commit=$_commit
21         disable_version_check.patch)
22 b2sums=('SKIP'
23         '98294f267ca693c0bc3921f8e076d674a219a891502cd31a0af789bc0b1447b53834b9c85853a134f6bc1ac384f31cb174cba2d55fbcc1636cae9bd3c0bd8f84')
25 prepare() {
26   cd ${pkgname}
27   # stop ansible-lint from calling home every 24h to check for a new version
28   patch -Np1 < "${srcdir}"/disable_version_check.patch
29   # use pkg version
30   #sed -i "s/dynamic = \[\"version\"\]/version = \"${pkgver}\"/" pyproject.toml
31   rm .git_archival.txt
34 pkgver() {
35   cd $pkgname
36   git describe --tags --long --abbrev=7 | sed 's/^v//g;s/\([^-]*-g\)/r\1/;s/-/./g'
39 build() {
40   cd ${pkgname}
41   python -m build --wheel --skip-dependency-check --no-isolation
44 check() {
45   cd $pkgname
46   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
47   local pytest_options=(
48     -vv
49     --ignore test/test_schemas.py  # requires deprecated spdx
50     # don't run tests against venvs and hardcoded locations
51     --deselect 'test/test_eco.py::test_eco[bootstrap]'
52     --deselect 'test/test_eco.py::test_eco[cisco.nxos]'
53     --deselect 'test/test_eco.py::test_eco[colsystem]'
54     --deselect 'test/test_eco.py::test_eco[debops]'
55     --deselect 'test/test_eco.py::test_eco[docker-rootless]'
56     --deselect 'test/test_eco.py::test_eco[hardening]'
57     --deselect 'test/test_eco.py::test_eco[mysql]'
58     --deselect 'test/test_main.py::test_call_from_outside_venv[normal]'
59     --deselect 'test/test_main.py::test_call_from_outside_venv[isolated]'
60     --deselect 'test/test_rules_collection.py::test_rules_id_format'
61     --deselect 'test/test_main.py::test_get_version_warning[v1.2.2-True-pre-release-1]'
62     --deselect 'test/test_main.py::test_get_version_warning[v1.2.3-False--1]'
63     --deselect 'test/test_main.py::test_get_version_warning[v1.2.4-True-new release-2]'
64    )
66   # install to temporary location, as importlib is used
67   python -m installer --destdir=test_dir dist/*.whl
68   export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
69   export PATH="$PWD/test_dir/usr/bin:$PATH"
70   pytest "${pytest_options[@]}" test/
73 package() {
74   cd ${pkgname}
75   python -m installer --destdir="${pkgdir}" dist/*.whl