We (Arch Linux) decided to stop relying on PyPI source tarballs for our python packages (when possible), you can read the rationales from the related RFC. We now advise our package maintainers to rely upon sources directly from the upstream projects instead. For instance, relying on GitHub’s auto-generated source tarball would be a good choice here regarding our guidelines.
There’s no need to cd to $srcdir in the different functions (prepare(), build(), check(), package()) as they are already executed from there.
The ln -sf dance in build() is pretty unusual and futile. You could simply cd "${_pkgname}-${pkgver}" directly in such case.
You defined python-pytest as a check dependency but the PKGBUILD doesn’t run tests. You should either introduce a check() function to run said tests or, alternatively, drop the checkdepends array to avoid installing unused dependencies during the building process.
There’s no need to install the Apache-2.0 license under /usr/share/licenses/${pkgname} as this license is already provided by our “generic” licenses package (which is part of every Arch installation). See this Wiki chapter for more details.
This is a minor detail, but your PKGBUILDs lack some “style” consistency (e.g. sometimes arrays are quoted, sometimes not; variables are sometimes quoted, sometimes not; variables are sometimes in the form of $var, sometimes in the form of ${var}). While we do not suggest one style over another, I personally prefer using the same one consistently over the whole PKGBUILD.
Here is my personal “refinement” suggestion for the ansible-creator PKGBUILD, according to the above points (same could be applied to ansible-navigator and ansible-dev-environment):
successfully tested / built in a clean chroot
# Maintainer: Alexander Jacocks <alexander@redhat.com>
pkgname=ansible-creator
pkgver=25.5.0
pkgrel=1
pkgdesc="A CLI tool for scaffolding all your Ansible Content."
arch=('any')
url="https://github.com/ansible/ansible-creator"
license=('Apache-2.0')
depends=('python' 'python-jsonschema' 'python-onigurumacffi' 'ansible-core' 'ansible-runner' 'podman')
makedepends=('python-build' 'python-installer' 'python-pip' 'python-setuptools' 'python-setuptools-scm' 'python-wheel')
optdepends=('ansible: check official ansible collections')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('f2cbd89021611463e26884ea179dd62c7a0e02c224e0fd21c38e8405be6f1506')
build() {
cd "${pkgname}-${pkgver}"
export SETUPTOOLS_SCM_PRETEND_VERSION="${pkgver}"
python -m build --wheel --no-isolation
}
package() {
cd "${pkgname}-${pkgver}"
python -m installer --destdir="${pkgdir}" dist/*.whl
}
Again, your PKGBUILDs look good overall and my suggestions are mostly about minor improvements.
I hope that helps!