Carl Smedstad pushed to branch main at Arch Linux / Packaging / Packages / 
python-fastparquet


Commits:
cab4954e by Carl Smedstad at 2024-08-20T21:14:14+02:00
upgpkg: 2024.5.0-3: Improve test setup

Instead of

- moving the test directory,
- setting PYTHONPATH,
- and invoking pytest with --import-mode=importlib,

move the test suite to the temporary installation and run it from there.

- - - - -


2 changed files:

- .SRCINFO
- PKGBUILD


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,7 +1,7 @@
 pkgbase = python-fastparquet
        pkgdesc = A Python implementation of the Parquet columnar file format
        pkgver = 2024.5.0
-       pkgrel = 2
+       pkgrel = 3
        url = https://github.com/dask/fastparquet
        arch = x86_64
        license = Apache-2.0


=====================================
PKGBUILD
=====================================
@@ -4,7 +4,7 @@
 pkgname=python-fastparquet
 _pkgname=${pkgname#python-}
 pkgver=2024.5.0
-pkgrel=2
+pkgrel=3
 pkgdesc="A Python implementation of the Parquet columnar file format"
 arch=(x86_64)
 url="https://github.com/dask/fastparquet";
@@ -31,34 +31,21 @@ checkdepends=(python-pytest)
 source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
 sha256sums=('7fb745a78e4a5772e3cc5f3c8aba487374cda1d3007e7878805a8c2a0d40652e')
 
-_archive="$_pkgname-$pkgver"
-
-prepare() {
-  cd "$_archive"
-
-  # Move tests out of the package, will not work with the tmp_install method
-  # in check() otherwise.
-  mv fastparquet/test/ tests/
-}
-
 build() {
-  cd "$_archive"
-
+  cd "$_pkgname-$pkgver"
   export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
-  python -m build --wheel --no-isolation --skip-dependency-check
+  python -m build --wheel --no-isolation
 }
 
 check() {
-  cd "$_archive"
-
+  cd "$_pkgname-$pkgver"
   python -m installer --destdir=tmp_install dist/*.whl
   local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
-  export PYTHONPATH="$PWD/tmp_install/$site_packages:."
-  pytest --import-mode=importlib
+  cp -r fastparquet/test test-data "$PWD/tmp_install/$site_packages"
+  (cd "$PWD/tmp_install/$site_packages" && pytest)
 }
 
 package() {
-  cd "$_archive"
-
+  cd "$_pkgname-$pkgver"
   python -m installer --destdir="$pkgdir" dist/*.whl
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-fastparquet/-/commit/cab4954e0f2134c84196816cf8e6c992e092cd15

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/python-fastparquet/-/commit/cab4954e0f2134c84196816cf8e6c992e092cd15
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to