Package Details: python-flake8-quotes 3.3.2-1

Git Clone URL: https://aur.archlinux.org/python-flake8-quotes.git (read-only, click to copy)
Package Base: python-flake8-quotes
Description: Flake8 lint for quotes
Upstream URL: https://github.com/zheller/flake8-quotes
Licenses: MIT
Submitter: acxz
Maintainer: dmitmel
Last Packager: dmitmel
Votes: 2
Popularity: 0.000000
First Submitted: 2020-05-30 22:42 (UTC)
Last Updated: 2023-02-09 08:20 (UTC)

Latest Comments

1 2 Next › Last »

gesh commented on 2024-03-26 20:45 (UTC) (edited on 2024-03-26 20:46 (UTC) by gesh)

OK, found a workaround:

check() {
    cd "$_pkgname-$pkgver"
    PYTHONPATH=src:"$PYTHONPATH" python -m pytest test
}

gesh commented on 2024-03-26 20:05 (UTC)

For some reason, it appears python setup.py test manages to run flake8 with our package plugged in, whereas python -m {py,unit}test both run it in a clean environment. I've disabled the offending test in the below -- have run out of patience trying to massage it into success.

diff --git a/PKGBUILD b/PKGBUILD
index 8723a35..a40d4a5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,24 +4,31 @@
 pkgname=python-flake8-quotes
 _pkgname=flake8-quotes
 pkgver=3.3.2
-pkgrel=1
+pkgrel=2
 pkgdesc="Flake8 lint for quotes"
 arch=('any')
 url="https://github.com/zheller/${_pkgname}"
 license=('MIT')
 depends=('flake8')
-makedepends=('python-setuptools')
+checkdepends=('python-pytest')
+makedepends=(python-build python-installer python-wheel python-setuptools)
 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/zheller/${_pkgname}/archive/${pkgver}.tar.gz")
 sha256sums=('884d027b6126b6216bdb9fa95a9841c4f07f600569a4a41f3d0cdbf71afe6bcb')

 build() {
-    cd "${_pkgname}-${pkgver}"
-    python setup.py build
+    cd "$_pkgname-$pkgver"
+    python -m build --wheel --no-isolation
+}
+
+check() {
+    cd "$_pkgname-$pkgver"
+    # needs the package to be installed to run
+    python -m pytest -k 'not test_stdin'
 }

 package() {
-    cd "${_pkgname}-${pkgver}"
-    python setup.py install --root="${pkgdir}" --optimize=1
+    cd "$_pkgname-$pkgver"
+    python -m installer --destdir="$pkgdir" dist/*.whl

     install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
 }

gesh commented on 2024-03-26 17:54 (UTC)

And indeed, checking it in this way reveals my implementation of check() is wrong, though I don't know why. But python setup.py test differs in behaviour from python -m unittest

gesh commented on 2024-03-26 17:39 (UTC)

You are correct, my bad. Yeah, PEP517 only controls the invocation of the build process, but at the end of the day you still need the the build backend, in this case python-setuptools. Nice catch!

dmitmel commented on 2024-03-26 16:52 (UTC)

gesh: Shouldn't python-setuptools be present in the dependencies as well?

gesh commented on 2024-03-26 16:43 (UTC)

This is what I had in mind:

diff --git a/PKGBUILD b/PKGBUILD
index 8723a35..97a314d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,24 +4,29 @@
 pkgname=python-flake8-quotes
 _pkgname=flake8-quotes
 pkgver=3.3.2
-pkgrel=1
+pkgrel=2
 pkgdesc="Flake8 lint for quotes"
 arch=('any')
 url="https://github.com/zheller/${_pkgname}"
 license=('MIT')
 depends=('flake8')
-makedepends=('python-setuptools')
+makedepends=(python-build python-installer python-wheel)
 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/zheller/${_pkgname}/archive/${pkgver}.tar.gz")
 sha256sums=('884d027b6126b6216bdb9fa95a9841c4f07f600569a4a41f3d0cdbf71afe6bcb')

 build() {
-    cd "${_pkgname}-${pkgver}"
-    python setup.py build
+    cd "$_pkgname-$pkgver"
+    python -m build --wheel --no-isolation
+}
+
+check() {
+    cd "$_pkgname-$pkgver"
+    python -m unittest
 }

 package() {
-    cd "${_pkgname}-${pkgver}"
-    python setup.py install --root="${pkgdir}" --optimize=1
+    cd "$_pkgname-$pkgver"
+    python -m installer --destdir="$pkgdir" dist/*.whl

     install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
 }

gesh commented on 2024-03-25 21:40 (UTC)

https://wiki.archlinux.org/title/Python_packaging_guidelines#Standards_based_(PEP_517)

Python decided to change the way they recommend installing packages a short while back, and so even if the project doesn't have a pyproject.toml the instructions from the wiki should be followed - that is, using

makedepends=(python-build python-installer python-wheel)

build() {
    cd $_name-$pkgver
    python -m build --wheel --no-isolation
}

package() {
    cd $_name-$pkgver
    python -m installer --destdir="$pkgdir" dist/*.whl
}

dmitmel commented on 2024-03-25 18:48 (UTC)

gesh: Unsure what you mean. Is this a common practice in AUR packaging?

gesh commented on 2024-03-25 13:24 (UTC)

Please update to PEP517 installs -- directly invoking setup.py is deprecated nowadays.

RubenKelevra commented on 2023-02-09 00:03 (UTC) (edited on 2023-02-09 00:11 (UTC) by RubenKelevra)

Works fine if

makedepends=(python python-setuptools)

are added.