Skip to content

Pattern Python

m-wells edited this page Feb 21, 2026 · 2 revisions

Python Packages

Example: keeper-commander

Python packages follow Arch Python packaging guidelines, using python-build and python-installer.

Template

arch=('any')
depends=('python' 'python-requests' 'python-click' ...)
makedepends=('python-build' 'python-installer' 'python-setuptools')

source=("https://files.pythonhosted.org/packages/source/p/package/package-${pkgver}.tar.gz")
# or from GitHub:
source=("$pkgname-$pkgver.tar.gz::https://github.com/org/repo/archive/v$pkgver.tar.gz")

build() {
    cd "package-$pkgver"
    python -m build --wheel --no-isolation
}

package() {
    cd "package-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Characteristics

  • arch=('any') for pure Python, arch=('x86_64') if native extensions
  • All runtime deps listed explicitly in depends=()
  • Dependencies must exist as Arch packages (official repos or AUR)
  • Built from source using PEP 517 build system

Dependency Resolution

CI uses yay to resolve dependencies from both official repos and AUR. See CI-CD for details.

Version Checking

# scripts/packages/example.sh
check_pypi "example" "pypi-package-name"

Clone this wiki locally