You are not logged in.

#1 2021-02-16 19:23:23

daniel_shub
Member
Registered: 2012-06-21
Posts: 58

[SOLVED] Problem building AUR Python packages in a clean chroot

I am running into the same error when trying to build 3 different AUR Python packages in a clean chroot. The packages are

https://aur.archlinux.org/packages/pyth … io-ffmpeg/
https://aur.archlinux.org/packages/python-freetype-py/
https://aur.archlinux.org/packages/python-pyosf/

Basically the build process complains that it cannot find python-pip (and then python-wheel). If I install these as dependencies, everything builds fine. That said, I think using pip means it skips the checksums, so that is probably not the right answer.

I posted a comment on the python-imageio-ffmpeg package page and the maintainer patched the source setup.cfg file to remove a dependency on the pip version (> 19). That might be the solution, but it seems if the software authors add a dependency, it might be a real dependency.

I then tried to apply that idea to the other two packages, but cannot find a dependency on the pip version. So maybe the error is the same for the 3 packages, but the causes are different.

The issue might be related to this https://bbs.archlinux.org/viewtopic.php?id=262572, but I am not sure.

Any ideas?

Last edited by daniel_shub (2021-02-17 15:13:26)

Offline

#2 2021-02-16 20:30:03

loqs
Member
Registered: 2014-03-06
Posts: 12,966

Re: [SOLVED] Problem building AUR Python packages in a clean chroot

python-pyosf lists pytest-runner in setup.py https://github.com/psychopy/pyosf/blob/ … tup.py#L43

diff --git a/PKGBUILD b/PKGBUILD
index 1d08cac..f33cc59 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,6 +13,12 @@ arch=('any')
 source=("$url/archive/v$pkgver.tar.gz")
 md5sums=('5afac9a27e869f274dba276fe00fdecc')
 
+prepare() {
+  cd "$srcdir/$_pkgname-$pkgver"
+  sed -i "s/'pytest-runner', //" setup.py
+
+}
+
 build() {
   cd "$srcdir/$_pkgname-$pkgver"
   python setup.py build

Have not looked at python-freetype-py yet.
Edit:
https://github.com/rougier/freetype-py/issues/128

diff --git a/PKGBUILD b/PKGBUILD
index 7d92467..9a35763 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,6 +14,12 @@ makedepends=('python-setuptools' 'python-setuptools-scm')
 source=("https://files.pythonhosted.org/packages/source/f/$_pkgname/$_pkgname-$pkgver.zip")
 sha1sums=('d7ad11b5ac66b8fd1f270f1640d5a065b197eeae')
 
+prepare() {
+  cd "$srcdir/$_pkgname-$pkgver"
+  sed -i 's/setuptools_scm\[toml\]/setuptools_scm/' setup.py
+
+}
+
 build() {
   cd "$srcdir/$_pkgname-$pkgver"
   python setup.py build

As it is built from a tarball can setuptools_scm be removed completely?

Last edited by loqs (2021-02-16 20:54:51)

Offline

#3 2021-02-17 04:29:42

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,924

Re: [SOLVED] Problem building AUR Python packages in a clean chroot

daniel_shub wrote:

I posted a comment on the python-imageio-ffmpeg package page and the maintainer patched the source setup.cfg file to remove a dependency on the pip version (> 19). That might be the solution, but it seems if the software authors add a dependency, it might be a real dependency.

There's zero good reason for any package to ever setup_requires on pip. If you look upstream, they added this because people using old versions of pip to install the project were getting the source code instead of prebuilt wheels since their really old versions of pip didn't recognize the available wheels.

Upstream's... "solution"... to this was to add a make dependency on pip in order to use versions constraints. Completely nuts.

loqs wrote:

As it is built from a tarball can setuptools_scm be removed completely?

setuptools_scm is the thing that retrieves version info from the PyPI sdist special files, when using a tarball.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2021-02-17 08:14:09

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,087
Website

Re: [SOLVED] Problem building AUR Python packages in a clean chroot

eschwartz wrote:

setuptools_scm is the thing that retrieves version info from the PyPI sdist special files, when using a tarball.

Not quite. It retrieves the version information from SCM data, as the name suggests, i.e. git tags.
See also: https://bbs.archlinux.org/viewtopic.php?id=262572

Last edited by schard (2021-02-17 08:15:18)

Offline

#5 2021-02-17 12:02:41

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,924

Re: [SOLVED] Problem building AUR Python packages in a clean chroot

schard wrote:
eschwartz wrote:

setuptools_scm is the thing that retrieves version info from the PyPI sdist special files, when using a tarball.

Not quite. It retrieves the version information from SCM data, as the name suggests, i.e. git tags.
See also: https://bbs.archlinux.org/viewtopic.php?id=262572

That's utterly impossible in the case under discussion, which is "when using a tarball"...

Because yes, you very much do need the setup_requires on setuptools_scm "when using a tarball", because "when using a tarball" it will not find any git tags and therefore it will "retrieve version info from the PyPI sdist special files", whereas without setuptools_scm there would be no version at all, neither in a git repo nor "when using a tarball", and not having a required metadata field is an error.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2021-02-17 15:13:11

daniel_shub
Member
Registered: 2012-06-21
Posts: 58

Re: [SOLVED] Problem building AUR Python packages in a clean chroot

Thanks everyone, especially loqs for the patches. I don't know enough about Python to have ever tracked down the root cause of the problem. As usual the Arch community comes through.

Offline

Board footer

Powered by FluxBB