From ddcd833b5ae47594b5ab3f64b3558ae4b17b6c1e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 12:52:02 -0400 Subject: [PATCH] ilot/py3-scramp: new aport --- ilot/py3-scramp/APKBUILD | 39 +++++++++++++++++++++ ilot/py3-scramp/use-local-version-src.patch | 36 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 ilot/py3-scramp/APKBUILD create mode 100644 ilot/py3-scramp/use-local-version-src.patch diff --git a/ilot/py3-scramp/APKBUILD b/ilot/py3-scramp/APKBUILD new file mode 100644 index 0000000..916b7a1 --- /dev/null +++ b/ilot/py3-scramp/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: Antoine Martin (ayakael) +# Maintainer: Antoine Martin (ayakael) +pkgname=py3-scramp +#_pkgreal is used by apkbuild-pypi to find modules at PyPI +_pkgreal=scramp +pkgver=1.4.5 +pkgrel=0 +pkgdesc="Python implementation of the SCRAM protocol" +url="https://pypi.python.org/project/scramp" +arch="noarch" +license="MIT" +depends="py3-asn1crypto" +checkdepends="py3-pytest py3-passlib py3-pytest-mock" +makedepends="py3-setuptools py3-gpep517 py3-wheel py3-hatchling" +source="$pkgname-$pkgver.tar.gz::https://github.com/tlocke/scramp/archive/refs/tags/$pkgver.tar.gz" +builddir="$srcdir/$_pkgreal-$pkgver" +subpackages="$pkgname-pyc" + +build() { + echo "__version__ = \"$pkgver\"" > _version.py + gpep517 build-wheel \ + --wheel-dir .dist \ + --output-fd 3 3>&1 >&2 +} + +check() { + python3 -m venv --clear --without-pip --system-site-packages .testenv + .testenv/bin/python3 -m installer .dist/*.whl + .testenv/bin/python3 -m pytest -v +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +070bf5b92f45bd506cb0f6aeb4ff7fccfff9092b69bed20338a2cfdf84f5587b9162fa1ffb84db8c98ea5f3e008f34db5848690d857110e1d037bb15d2a95d58 py3-scramp-1.4.5.tar.gz +" diff --git a/ilot/py3-scramp/use-local-version-src.patch b/ilot/py3-scramp/use-local-version-src.patch new file mode 100644 index 0000000..4ad0785 --- /dev/null +++ b/ilot/py3-scramp/use-local-version-src.patch @@ -0,0 +1,36 @@ +diff --git a/pyproject.toml.orig b/pyproject.toml +index d79fac8..09bea8c 100644 +--- a/pyproject.toml.orig ++++ b/pyproject.toml +@@ -1,5 +1,5 @@ + [build-system] +-requires = ["hatchling", "versioningit"] ++requires = ["hatchling", "setuptools_scm"] + build-backend = "hatchling.build" + + [project] +@@ -30,18 +30,15 @@ dependencies = [ + ] + dynamic = ["version"] + ++[tool.setuptools_scm] ++write_to = "_version.py" ++ ++[tool.hatch.version] ++path = "_version.py" ++ + [project.urls] + Homepage = "https://github.com/tlocke/scramp" + +-[tool.hatch.version] +-source = "versioningit" +- +-[tool.versioningit] +- +-[tool.versioningit.vcs] +-method = "git" +-default-tag = "0.0.0" +- + [tool.flake8] + application-names = ["scramp"] + ignore = ["E203", "W503"]