Date: Monday, April 24, 2023 @ 16:02:09
  Author: dvzrv
Revision: 1448528

upgpkg: python-zope-component 6.0-1: Upgrade to 6.0 and rebuild against Python 
3.11.

Use pytest on a local installed tmp location in check() instead of
zope.testrunner directly as (due to circular dep) it always tries to run against
the system-wide installed location instead (ignoring PYTHONPATH).
Consolidate dependencies and sort them alphabetically.

Modified:
  python-zope-component/trunk/PKGBUILD

----------+
 PKGBUILD |   57 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 47 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-24 16:01:27 UTC (rev 1448527)
+++ PKGBUILD    2023-04-24 16:02:09 UTC (rev 1448528)
@@ -2,19 +2,45 @@
 # Contributor: Simon Hanna <simon dot hanna AT serve-me DOT info>
 
 pkgname=python-zope-component
-pkgver=5.1.0
-pkgrel=4
+pkgver=6.0
+pkgrel=1
 pkgdesc="Represents the core of the Zope Component Architecture"
 arch=('any')
 url="https://github.com/zopefoundation/zope.component";
 license=('ZPL')
-depends=('python-setuptools' 'python-zope-deferredimport' 
'python-zope-deprecation'
-         'python-zope-event' 'python-zope-hookable' 'python-zope-interface')
-makedepends=('python-build' 'python-installer' 'python-wheel')
-checkdepends=('python-zope-testrunner' 'python-persistent' 
'python-zope-location'
-              'python-zope-proxy' 'python-zope-security' 
'python-zope-configuration' 'python-zope-i18nmessageid')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/zopefoundation/zope.component/archive/$pkgver.tar.gz";)
-sha512sums=('6fac757f13dbffc6d1b8aa7bef7d196b59d70f7aa78a4a5ed7260179e263819e6bb9b82cb9cf7e31ab3d33c7d49fdb32ecbbcfe2a76696e7ebbd8c1dbb38b987')
+depends=(
+  'python'
+  'python-setuptools'
+  'python-zope-event'
+  'python-zope-hookable'
+  'python-zope-interface'
+)
+makedepends=(
+  'python-build'
+  'python-installer'
+  'python-wheel'
+)
+checkdepends=(
+  'python-persistent'
+  'python-pytest'
+  'python-zope-configuration'
+  'python-zope-i18nmessageid'
+  'python-zope-location'
+  'python-zope-proxy'
+  'python-zope-security'
+  'python-zope-testrunner'
+)
+optdepends=(
+  'python-persistent: for persistent registry'
+  'python-zope-configuration: for zcml'
+  'python-zope-i18nmessageid: for zcml'
+  'python-zope-location: for security'
+  'python-zope-proxy: for security'
+  'python-zope-security: for security'
+)
+source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz")
+sha512sums=('0f27ce6a901d780d0ff35718698b140d8f4763fed14f95a483ce984e55e25b54a35c5dfde9205dbf8436e96b6f3ecb4b560a46cf5bc8ccd3875b859796b0c1e9')
+b2sums=('b5c0e1f6326c74e28b9534b50d7fba65215ad6786679e4dc2a340a22b7ab45c45e8f692141c1d48d100f407fcdb4dd4a3e8a120890dbed5f77a5fbd2d2243c96')
 
 build() {
   cd zope.component-$pkgver
@@ -23,7 +49,18 @@
 
 check() {
   cd zope.component-$pkgver
-  PYTHONPATH="$PWD/build/lib:$PYTHONPATH" python -m zope.testrunner 
--test-path=src
+
+  local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+  local pytest_options=(
+    -vv
+    # (blanket) ignore tests that fail due to different exposed interface
+    --ignore 
"$(pwd)/test_dir/$site_packages/zope/component/tests/test_interface.py"
+  )
+
+  # install to temporary location, as importlib is used
+  python -m installer --destdir=test_dir dist/*.whl
+  export PYTHONPATH="$(pwd)/test_dir/$site_packages:$PYTHONPATH"
+  pytest "${pytest_options[@]}" "$(pwd)/test_dir/$site_packages"
 }
 
 package() {

Reply via email to