From 4e33202ac14ffca575423252dc9983f190e720f5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 19:18:42 -0400 Subject: [PATCH 1/4] ilot/authentik: enable check --- ilot/authentik/APKBUILD | 62 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index 074ec7f..6054f06 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Antoine Martin (ayakael) pkgname=authentik pkgver=2024.8.2 -pkgrel=0 +pkgrel=1 pkgdesc="An open-source Identity Provider focused on flexibility and versatility" url="https://github.com/goauthentik/authentik" # s390x: missing py3-celery py3-flower and py3-kombu @@ -153,14 +153,23 @@ depends=" py3-yarl py3-zope-interface py3-zxcvbn - redis + valkey uvicorn " makedepends="go npm" # checkdepends scooped up by poetry due to number -checkdepends="poetry py3-coverage" +checkdepends=" + poetry + py3-coverage + py3-pytest + py3-pytest-django + py3-pytest-randomly + py3-pytest-timeout + py3-freezegun + py3-boto3 + py3-requests-mock + " # tests disabled for now -options="!check" install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install" source=" $pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz @@ -204,6 +213,51 @@ build() { npm run build } +check() { + msg "Starting postgresql" + export POSTGRES_DB=authentik + export POSTGRES_USER=authentik + export POSTGRES_PASSWORD="EK-5jnKfjrGRm<77" + export AUTHENTIK_POSTGRESQL__TEST__NAME=authentik + + rm -Rf "$srcdir"/tmp + initdb -D "$srcdir"/tmp + postgres -D "$srcdir"/tmp --unix-socket-directories="$srcdir" > "$srcdir"/tmp/psql.log 2>&1 & + valkey-server > "$srcdir"/tmp/valkey.log 2>&1 & + trap "pkill valkey-server; pkill postgresql" EXIT + sleep 5 + psql -h "$srcdir" -d postgres -c "CREATE ROLE $POSTGRES_USER PASSWORD '$POSTGRES_PASSWORD' INHERIT LOGIN;" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE test_$POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + + # .github/actions/setup/action.yml: Generate config + csrf + python3 -c " +from authentik.lib.generators import generate_id +from yaml import safe_dump + +with open(\"local.env.yml\", \"w\") as _config: + safe_dump( + { + \"log_level\": \"debug\", + \"secret_key\": generate_id(), + \"csrf\": { \"trusted_origins\": ['https://*']}, + }, + _config, + default_flow_style=False, + ) +" + python -m lifecycle.migrate + + # no selenium package + pip install selenium drf_jsonschema_serializer pdoc --break-system-packages + + make test || FAIL=true + + if [ "$FAIL" = "true" ]; then + return 1 + fi +} + package() { msg "Packaging $pkgname" mkdir -p "$pkgdir"/usr/share/webapps/authentik/web From ce65b0f9f1a74eb4d634f01f074014ee554c75e5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 19:19:05 -0400 Subject: [PATCH 2/4] ilot/py3-sentry-sdk: new aport --- ilot/py3-sentry-sdk/APKBUILD | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ilot/py3-sentry-sdk/APKBUILD diff --git a/ilot/py3-sentry-sdk/APKBUILD b/ilot/py3-sentry-sdk/APKBUILD new file mode 100644 index 0000000..3162a03 --- /dev/null +++ b/ilot/py3-sentry-sdk/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: Francesco Colista +# Maintainer: Francesco Colista +pkgname=py3-sentry-sdk +pkgver=2.14.0 +pkgrel=0 +pkgdesc="The new Python SDK for Sentry.io" +url="https://sentry.io/for/python/" +arch="noarch" +license="BSD-2-Clause" +depends=" + py3-certifi + py3-urllib3 + " +makedepends=" + py3-gpep517 + py3-setuptools + py3-wheel + " +checkdepends=" + py3-executing + py3-jsonschema + py3-pytest-asyncio + py3-pytest-forked + py3-pytest-localserver + py3-pytest-xdist + py3-responses + py3-werkzeug + " +subpackages="$pkgname-pyc" +source="$pkgname-$pkgver.tar.gz::https://github.com/getsentry/sentry-python/archive/$pkgver.tar.gz" +builddir="$srcdir"/sentry-python-$pkgver +options="!check" # a bunch of deprecation-warning failures and improper shutdown.. seems to need net + +build() { + 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 + # gcp: pip install + # test_socket/test_requests: needs net + # wsgi: weird list errors + .testenv/bin/python3 -m pytest -n auto -p no:warnings \ + --deselect tests/integrations/gcp/test_gcp.py \ + --deselect tests/integrations/socket/test_socket.py \ + --deselect tests/integrations/requests/test_requests.py \ + --deselect tests/integrations/wsgi/test_wsgi.py +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +8667c3496cdbd6b3055f8046abcf3faa8afbda04e0551787222d44c7736deea95722251c266c21730a73afd57d4b7447ec17408672c3217af35103bba6f4b513 py3-sentry-sdk-2.14.0.tar.gz +" From 5c667e9ef115d4529a050b873541d78a162f8760 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 19:18:42 -0400 Subject: [PATCH 3/4] ilot/authentik: enable check --- ilot/authentik/APKBUILD | 63 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/ilot/authentik/APKBUILD b/ilot/authentik/APKBUILD index 074ec7f..084207e 100644 --- a/ilot/authentik/APKBUILD +++ b/ilot/authentik/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Antoine Martin (ayakael) pkgname=authentik pkgver=2024.8.2 -pkgrel=0 +pkgrel=1 pkgdesc="An open-source Identity Provider focused on flexibility and versatility" url="https://github.com/goauthentik/authentik" # s390x: missing py3-celery py3-flower and py3-kombu @@ -153,14 +153,23 @@ depends=" py3-yarl py3-zope-interface py3-zxcvbn - redis + valkey uvicorn " makedepends="go npm" # checkdepends scooped up by poetry due to number -checkdepends="poetry py3-coverage" +checkdepends=" + pip + py3-coverage + py3-pytest + py3-pytest-django + py3-pytest-randomly + py3-pytest-timeout + py3-freezegun + py3-boto3 + py3-requests-mock + " # tests disabled for now -options="!check" install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-install" source=" $pkgname-$pkgver.tar.gz::https://github.com/goauthentik/authentik/archive/refs/tags/version/$pkgver.tar.gz @@ -204,6 +213,52 @@ build() { npm run build } +check() { + msg "Starting postgresql" + export POSTGRES_DB=authentik + export POSTGRES_USER=authentik + export POSTGRES_PASSWORD="EK-5jnKfjrGRm<77" + export AUTHENTIK_POSTGRESQL__TEST__NAME=authentik + + rm -Rf "$srcdir"/tmp + initdb -D "$srcdir"/tmp + postgres -D "$srcdir"/tmp --unix-socket-directories="$srcdir" > "$srcdir"/tmp/psql.log 2>&1 & + valkey-server > "$srcdir"/tmp/valkey.log 2>&1 & + trap "pkill valkey-server; pkill postgresql" EXIT + sleep 5 + psql -h "$srcdir" -d postgres -c "CREATE ROLE $POSTGRES_USER PASSWORD '$POSTGRES_PASSWORD' INHERIT LOGIN;" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + psql -h "$srcdir" -d postgres -c "CREATE DATABASE test_$POSTGRES_DB OWNER $POSTGRES_USER ENCODING 'UTF-8';" + + # .github/actions/setup/action.yml: Generate config + csrf + python3 -c " +from authentik.lib.generators import generate_id +from yaml import safe_dump + +with open(\"local.env.yml\", \"w\") as _config: + safe_dump( + { + \"log_level\": \"debug\", + \"secret_key\": generate_id(), + \"csrf\": { \"trusted_origins\": ['https://*']}, + }, + _config, + default_flow_style=False, + ) +" + python -m lifecycle.migrate + + # no selenium package + pip install selenium drf_jsonschema_serializer pdoc --break-system-packages + + make test || FAIL=true + make go-test || FAIL=true + + if [ "$FAIL" = "true" ]; then + return 1 + fi +} + package() { msg "Packaging $pkgname" mkdir -p "$pkgdir"/usr/share/webapps/authentik/web From f3e9e0d4b520704ecc41bc8ecc6489df70675804 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 19 Sep 2024 19:19:05 -0400 Subject: [PATCH 4/4] ilot/py3-sentry-sdk: new aport --- ilot/py3-sentry-sdk/APKBUILD | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ilot/py3-sentry-sdk/APKBUILD diff --git a/ilot/py3-sentry-sdk/APKBUILD b/ilot/py3-sentry-sdk/APKBUILD new file mode 100644 index 0000000..3162a03 --- /dev/null +++ b/ilot/py3-sentry-sdk/APKBUILD @@ -0,0 +1,60 @@ +# Contributor: Francesco Colista +# Maintainer: Francesco Colista +pkgname=py3-sentry-sdk +pkgver=2.14.0 +pkgrel=0 +pkgdesc="The new Python SDK for Sentry.io" +url="https://sentry.io/for/python/" +arch="noarch" +license="BSD-2-Clause" +depends=" + py3-certifi + py3-urllib3 + " +makedepends=" + py3-gpep517 + py3-setuptools + py3-wheel + " +checkdepends=" + py3-executing + py3-jsonschema + py3-pytest-asyncio + py3-pytest-forked + py3-pytest-localserver + py3-pytest-xdist + py3-responses + py3-werkzeug + " +subpackages="$pkgname-pyc" +source="$pkgname-$pkgver.tar.gz::https://github.com/getsentry/sentry-python/archive/$pkgver.tar.gz" +builddir="$srcdir"/sentry-python-$pkgver +options="!check" # a bunch of deprecation-warning failures and improper shutdown.. seems to need net + +build() { + 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 + # gcp: pip install + # test_socket/test_requests: needs net + # wsgi: weird list errors + .testenv/bin/python3 -m pytest -n auto -p no:warnings \ + --deselect tests/integrations/gcp/test_gcp.py \ + --deselect tests/integrations/socket/test_socket.py \ + --deselect tests/integrations/requests/test_requests.py \ + --deselect tests/integrations/wsgi/test_wsgi.py +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +8667c3496cdbd6b3055f8046abcf3faa8afbda04e0551787222d44c7736deea95722251c266c21730a73afd57d4b7447ec17408672c3217af35103bba6f4b513 py3-sentry-sdk-2.14.0.tar.gz +"