archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-cfn-lint / repos / community-any / PKGBUILD
blob15d6df86f73c1c321097665ae767d2fe7fa0efb6
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
5 pkgver=0.77.4
6 # curl https://api.github.com/repos/aws-cloudformation/cfn-lint/git/ref/tags/v$pkgver | jq -r .object.sha
7 _tag=cf0c7e1771c0242fe886862214d886219eeeffd3
8 pkgrel=1
9 pkgdesc='CloudFormation Linter'
10 arch=(any)
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)
19 optdepends=(
20   'python-pydot: for building graphs from templates'
22 source=("git+https://github.com/aws-cloudformation/cfn-lint.git#tag=$_tag")
23 sha256sums=('SKIP')
25 pkgver() {
26   cd cfn-lint
27   git describe --tags | sed 's/^v//'
30 build() {
31   cd cfn-lint
32   python -m build --wheel --no-isolation
35 check() {
36   cd cfn-lint
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
50 package() {
51   cd cfn-lint
52   python -m installer --destdir="$pkgdir" dist/*.whl
54   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname