[arch-commits] Commit in python-tokenize-rt/trunk (PKGBUILD)

Daniel M. Capella polyzen at gemini.archlinux.org
Tue Sep 6 20:33:09 UTC 2022


    Date: Tuesday, September 6, 2022 @ 20:33:08
  Author: polyzen
Revision: 1294956

upgpkg: python-tokenize-rt 4.2.1-4: Use PEP 517

Modified:
  python-tokenize-rt/trunk/PKGBUILD

----------+
 PKGBUILD |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-09-06 20:33:02 UTC (rev 1294955)
+++ PKGBUILD	2022-09-06 20:33:08 UTC (rev 1294956)
@@ -3,13 +3,14 @@
 _name=tokenize-rt
 pkgname=python-tokenize-rt
 pkgver=4.2.1
-pkgrel=3
+pkgrel=4
 pkgdesc='Wrapper around the stdlib `tokenize` which roundtrips'
 arch=('any')
 url=https://github.com/asottile/tokenize-rt
 license=('MIT')
 depends=('python')
-makedepends=('python-setuptools')
+makedepends=('python-build' 'python-installer' 'python-setuptools'
+             'python-wheel')
 checkdepends=('python-pytest')
 source=("$url/archive/v$pkgver/$_name-$pkgver.tar.gz")
 b2sums=('b8cee02bbb9bb559a92645d8230abc29a58f100b9d03a496106bf9301ff2fa6b47e472970dc71203c61a7d1d3b95f6bb88ef8da15641c509efd10a7711e85d2b')
@@ -16,18 +17,23 @@
 
 build() {
   cd $_name-$pkgver
-  python setup.py build
+  python -m build --wheel --skip-dependency-check --no-isolation
 }
 
 check() {
   cd $_name-$pkgver
   python -m venv --system-site-packages test-env
-  test-env/bin/python setup.py install --optimize=1 --skip-build
+  test-env/bin/python -m installer dist/*.whl
   test-env/bin/python -m pytest
 }
 
 package() {
   cd $_name-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
-  install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE
+  python -m installer --destdir="$pkgdir" dist/*.whl
+
+  # Symlink license file
+  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+  install -d "$pkgdir"/usr/share/licenses/$pkgname
+  ln -s "$site_packages"/tokenize_rt-$pkgver.dist-info/LICENSE \
+    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }



More information about the arch-commits mailing list