1 # Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
3 pkgname=python-cfn-lint
4 # https://github.com/aws-cloudformation/cfn-lint/blob/main/CHANGELOG.md
6 # curl https://api.github.com/repos/aws-cloudformation/cfn-lint/git/ref/tags/v$pkgver | jq -r .object.sha
7 _tag=cf0c7e1771c0242fe886862214d886219eeeffd3
9 pkgdesc='CloudFormation Linter'
11 url='https://github.com/aws-cloudformation/cfn-lint'
12 license=('custom:MIT No Attribution')
13 depends=(python python-yaml python-aws-sam-translator
14 python-jsonpatch python-jsonschema python-networkx
15 python-junit-xml python-jschema-to-python python-sarif-om
16 python-sympy python-regex)
17 makedepends=(git python-build python-installer python-setuptools python-wheel)
18 checkdepends=(python-pydot)
20 'python-pydot: for building graphs from templates'
22 source=("git+https://github.com/aws-cloudformation/cfn-lint.git#tag=$_tag")
27 git describe --tags | sed 's/^v//'
32 python -m build --wheel --no-isolation
38 # Tests in test/integration need the cfn-lint binary
39 python -m installer --destdir="$PWD/tmp_install" dist/*.whl
41 export PYTHONPATH="$PWD/src"
42 export PATH="$PATH:$PWD/tmp_install/usr/bin"
43 # Using unittest following upstream. `test/unit/module/core/test_run_cli.py`
44 # fails if run after `test/unit/module/test_api.py`, which is the case for pytest.
45 # The conflict among tests exist after https://github.com/aws-cloudformation/cfn-lint/pull/2646,
46 # where the new runner.transform() pollutes environment variables via transform.transform_template()
47 python -m unittest discover test
52 python -m installer --destdir="$pkgdir" dist/*.whl
54 install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname