You are not logged in.

#1 2023-11-07 03:39:44

DrejT
Member
Registered: 2023-10-08
Posts: 6

tests failing for python-sqlalchemy inside PKGBUILD

pkgname=python-sqlalchemy
pkgver=2.0.23
pkgrel=3
arch=('x86_64')
url="https://www.sqlalchemy.org/"
license=('MIT')
pkgdesc='Python SQL toolkit and Object Relational Mapper'
depends=('python' 'git' 'cython')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'mypy')
checkdepends=('python-pytest-runner' 'python-pytest-xdist' 'python-mypy_extensions')
source=("https://pypi.io/packages/source/S/SQLAlchemy/SQLAlchemy-$pkgver.tar.gz")
validpgpkeys=()
sha256sums=('c1bda93cbbe4aa2aa0aa8655c5aeda505cd219ff3e8da91d1d329e143e4aff69')

build() {
  cd "$srcdir"/SQLAlchemy-$pkgver
  python -m build --wheel --no-isolation
}

package() {
  cd SQLAlchemy-$pkgver
  echo "pkgdir is $pkgdir"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -D -m644 LICENSE \
	  "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

check() {
   cd "$srcdir"/SQLAlchemy-$pkgver
   PYTHONPATH=build/lib pytest
}

I have written this PKGBUILD for sqlalchemy and just wanted to verify if the installation was successful
I did an install in a clean chroot by doing

makechrootpkg -c -r $CHROOT -- --skippgpcheck

Also, the tests are failing for me at 99% with NoModuleFoundError
no module named sqlalchemy was found

screenshots:
https://ibb.co/6bB2hMp
https://ibb.co/z5SbRtv
https://ibb.co/y5hgPLw
https://ibb.co/YTwQKXX

logs:
https://pastebin.com/8mzELces

so how do i correct the errors?
And, how do i verify that the package installation was successful?

edit:
1)changed title and added screenshots
2) added logs

Last edited by DrejT (2023-11-07 06:17:30)

Offline

#2 2023-11-07 03:51:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: tests failing for python-sqlalchemy inside PKGBUILD

Please edit your post to give the thread a title actually representing the topic i.e., at least include the package you want to discuss.  A bit of the error message would be good in the title too if you want help with that.

But you'll also need to also post the complete output in your post.  Do not paraphrase error messages.

Last edited by Trilby (2023-11-07 03:55:02)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-11-07 11:05:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,102

Re: tests failing for python-sqlalchemy inside PKGBUILD

This appears to be the cause of the test failure

  File "/build/python-sqlalchemy/src/SQLAlchemy-2.0.23/lib/sqlalchemy/testing/assertions.py", line 283, in eq_
    assert a == b, msg or "%r != %r" % (a, b)
AssertionError: 1 != 0
assert 1 == 0

No idea how to solve that, sorry.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2023-11-07 15:08:43

loqs
Member
Registered: 2014-03-06
Posts: 18,928

Re: tests failing for python-sqlalchemy inside PKGBUILD

I would suggest contacting upstream sqlalchemy.

I produced the same test failures in a clean chroot when updating the current python-sqlalchemy to 2.0.23:

diff --git a/PKGBUILD b/PKGBUILD
index bb728e0..7613c84 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,25 +3,24 @@
 # Contributor: Sébastien Luttringer <seblu@aur.archlinux.org>
 
 pkgname=python-sqlalchemy
-pkgver=1.4.44
-pkgrel=2
+pkgver=2.0.23
+pkgrel=1
 arch=('x86_64')
 url="https://www.sqlalchemy.org/"
 license=('MIT')
 pkgdesc='Python SQL toolkit and Object Relational Mapper'
 depends=('python' 'python-greenlet')
 optdepends=('python-psycopg2: connect to PostgreSQL database')
-makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
+makedepends=('cython' 'python-build' 'python-installer' 'python-wheel')
 checkdepends=('python-pytest-runner' 'python-pytest-xdist')
-source=("https://pypi.io/packages/source/S/SQLAlchemy/SQLAlchemy-$pkgver.tar.gz"{,.asc})
-validpgpkeys=('83AF7ACE251C13E6BB7DEFBD330239C1C4DAFEE1')
-sha512sums=('ba4e022f7af77cdf099b59a7af088852d7d4e0b4c6d632a63d244f501ff0b76837e601de63619f219fe50e6d526cd13415c4e623a6127afb0a2f24b87a4c3ece'
-            'SKIP')
+source=("https://pypi.io/packages/source/S/SQLAlchemy/SQLAlchemy-$pkgver.tar.gz")
+#validpgpkeys=('83AF7ACE251C13E6BB7DEFBD330239C1C4DAFEE1')
+sha512sums=('4d79e25c48c2d4400b8cf1bf4f7066912f06c05b8dfceeec1a215e03fffa7efce5882bb5058538ddfe127ad35bab7fc9aa314ffdedc81f3b97fde9207d7dd1f7')
 
-prepare() {
-  sed -i '/warnings.filterwarnings("error", category=DeprecationWarning)/a \    warnings.filterwarnings("ignore", category=DeprecationWarning, message="Creating a LegacyVersion has been deprecated and will be removed in the next major release")' \
-      SQLAlchemy-$pkgver/lib/sqlalchemy/testing/warnings.py
-}
+#prepare() {
+#  sed -i '/warnings.filterwarnings("error", category=DeprecationWarning)/a \    warnings.filterwarnings("ignore", category=DeprecationWarning, message="Creating a LegacyVersion has been deprecated and will be removed in the next major release")' \
+#      SQLAlchemy-$pkgver/lib/sqlalchemy/testing/warnings.py
+#}
 
 build() {
   cd "$srcdir"/SQLAlchemy-$pkgver

Offline

#5 2023-11-07 17:42:32

yochananmarqos
Member
Registered: 2020-02-05
Posts: 222

Re: tests failing for python-sqlalchemy inside PKGBUILD

This works and does not require mypy:


PYTHONPATH=build/lib.linux-x86_64-cpython-311 python -s -m pytest -c pyproject.toml -n2 -q --nomemory --notimingintensive --nomypy test

See the pyproject.toml

Offline

Board footer

Powered by FluxBB