Jakub Klinkovský pushed to branch main at Arch Linux / Packaging / Packages / 
python-cuda


Commits:
a3194452 by Jakub Klinkovský at 2024-12-14T11:16:44+01:00
Refactor declarations and installation commands

- reformat checkdepends for easier handling
- remove unnecessary (and wrong) get_pyver function
- remove unnecessary braces around bash variables
- improve cd and install commands

- - - - -


1 changed file:

- PKGBUILD


Changes:

=====================================
PKGBUILD
=====================================
@@ -1,3 +1,4 @@
+# Maintainer: Jakub Klinkovský <lahwaacz at archlinux dot org>
 # Maintainer: Konstantin Gizdov <arch at kge dot pw>
 
 _pkgname=cuda
@@ -20,25 +21,27 @@ makedepends=(
   python-versioneer
   python-pyclibrary
 )
-checkdepends=('python-pytest' 'python-pytest-benchmark' 'python-numpy' 
'python-scipy')
+checkdepends=(
+  python-pytest
+  python-pytest-benchmark
+  python-numpy
+  python-scipy
+)
 options=(!emptydirs)
-source=("${pkgbase}::git+https://github.com/NVIDIA/cuda-python#tag=v${pkgver}";)
+source=("$pkgbase::git+https://github.com/NVIDIA/cuda-python#tag=v$pkgver";)
 sha256sums=('1e30ea4dc7c047f48e3a12a74f3b1ce4a6d5ca089652fbd9c0ce63c4ae53f0c5')
 
-get_pyver () {
-    python -c 'import sys; print(str(sys.version_info[0]) + "." + 
str(sys.version_info[1]))'
-}
-
 build() {
-  cd "${srcdir}/${pkgbase}"
+  cd $pkgbase
   python -m build --wheel --no-isolation
 }
 
 check() {
-  cd "${srcdir}/${pkgbase}"
-  echo 'pythonpath = '"${PWD}/build/lib.linux-${CARCH}-$(get_pyver)" >> 
pytest.ini
+  cd $pkgbase
   # cannot run tests in chroot
-  # python -m pytest --import-mode=importlib
+  #python -m venv --system-site-packages test-env
+  #test-env/bin/python -m installer dist/*.whl
+  #test-env/bin/python -m pytest
 }
 
 package_python-cuda() {
@@ -49,18 +52,18 @@ package_python-cuda() {
     NVIDIA-MODULE
   )
 
-  cd "${srcdir}/${pkgname}"
+  cd $pkgbase
 
-  install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
-  python -m installer --destdir="${pkgdir}" dist/*.whl
+  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
+  python -m installer --destdir="$pkgdir" dist/*.whl
 }
 
 package_python-cuda-docs() {
   pkgdesc+=" - documentation"
 
-  cd "${srcdir}/${pkgbase}"
+  cd $pkgbase
 
-  install -d -m755 "${pkgdir}/usr/share/doc/${pkgname}"
-  cp -a docs/* "${pkgdir}/usr/share/doc/${pkgname}"
-  install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+  install -vdm 755 "${pkgdir}/usr/share/doc/$pkgname"
+  cp -va docs/* "$pkgdir/usr/share/doc/$pkgname"
+  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
 }



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

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


Reply via email to