You are not logged in.

#1 2024-02-11 20:01:06

nixIT
Member
Registered: 2010-01-13
Posts: 528

python-duckdb errors out on install

hello all,
I'm trying to install python-duckdb, and I received the error mentioned in the aur https://aur.archlinux.org/packages/python-duckdb , and proceeded to downgrade setuptools-scm as recommended for the install to work, however, the downgrade did not help, and I receive a new error:

>    File "/home/nixit/.cache/yay/duckdb/src/duckdb-0.9.2/tools/pythonpkg/.eggs/setuptools_scm-6.4.2-py3.11.egg/setuptools_scm/__init__.py", line 106, in _version_missing
>      raise LookupError(
>  LookupError: setuptools-scm was unable to detect version for /home/nixit/.cache/yay/duckdb/src/duckdb-0.9.2.
>
>  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
>
>  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
>  ==> ERROR: A failure occurred in build().
>      Aborting...

any tips on getting python-duckdb installed?

EDIT:  the reason my setup tools is on 6.4.2, I tried everything from current (8.x) down to 6.4.2, including 7.1.1.
EDIT 2: removed [solved] as latest update to python-duckdb is causing the same issue as before solving.

cheers,
--nixit

Last edited by nixIT (2024-02-16 16:56:51)


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#2 2024-02-12 09:17:18

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: python-duckdb errors out on install

Please try applying the diff below which worked for me in a clean chroot:

diff --git a/PKGBUILD b/PKGBUILD
index 4b13ba4..0ca67e7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -32,6 +32,7 @@ source=("$pkgbase-$pkgver.tar.gz::https://github.com/duckdb/duckdb/archive/refs/
 b2sums=('201273e168607d01c8475b8b524bb1cd898ea59333c4f7fee73686915632153fc6a5673ec00a0cca87f1121e1dd99ebf81dca1e6a4cb8c2d4a20807b74782f6c')
 
 prepare() {
+  sed -i 's/<7.0.0//' "$pkgbase-$pkgver/tools/pythonpkg/setup.py"
   cmake \
     -S "$pkgbase-$pkgver" \
     -B build \
@@ -42,7 +43,7 @@ prepare() {
 build() {
   cmake --build build
 
-  python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" build
+  SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" build
 }
 
 package_duckdb() {
@@ -69,7 +70,7 @@ package_python-duckdb() {
   conflicts=("python-duckdb-git")
 
   # library
-  python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" install --root="$pkgdir" --optimize=1 --skip-build
+  SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" install --root="$pkgdir" --optimize=1 --skip-build
 
   # license
   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" "$pkgbase-$pkgver/LICENSE"

Offline

#3 2024-02-12 18:55:26

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

loqs wrote:

Please try applying the diff below which worked for me in a clean chroot:

diff --git a/PKGBUILD b/PKGBUILD
index 4b13ba4..0ca67e7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -32,6 +32,7 @@ source=("$pkgbase-$pkgver.tar.gz::https://github.com/duckdb/duckdb/archive/refs/
 b2sums=('201273e168607d01c8475b8b524bb1cd898ea59333c4f7fee73686915632153fc6a5673ec00a0cca87f1121e1dd99ebf81dca1e6a4cb8c2d4a20807b74782f6c')
 
 prepare() {
+  sed -i 's/<7.0.0//' "$pkgbase-$pkgver/tools/pythonpkg/setup.py"
   cmake \
     -S "$pkgbase-$pkgver" \
     -B build \
@@ -42,7 +43,7 @@ prepare() {
 build() {
   cmake --build build
 
-  python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" build
+  SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" build
 }
 
 package_duckdb() {
@@ -69,7 +70,7 @@ package_python-duckdb() {
   conflicts=("python-duckdb-git")
 
   # library
-  python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" install --root="$pkgdir" --optimize=1 --skip-build
+  SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver python "$pkgbase-$pkgver/tools/pythonpkg/setup.py" install --root="$pkgdir" --optimize=1 --skip-build
 
   # license
   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" "$pkgbase-$pkgver/LICENSE"

thanx for the info. I took a look at applying patches and such https://wiki.archlinux.org/title/Patching_packages, and apparently how to do it is going over my head this week. a bit beyond my knowledge scope sad

let me look further into "how to apply patches and install" them.

thanx
-nixit

Last edited by nixIT (2024-02-12 19:01:23)


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#4 2024-02-12 19:03:15

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: python-duckdb errors out on install

To help apply the diff I uploaded it to a pastebin.  Then you can use:

git clone https://aur.archlinux.org/duckdb.git # fetch PKGBUILD from AUR
cd duckdb
curl -o PKGBUILD.diff http://0x0.st/Hd40.diff # Download patch
git apply -v PKGBUILD.diff # Apply the patch
makepkg -rsi # build package

Offline

#5 2024-02-13 14:44:07

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

loqs wrote:

To help apply the diff I uploaded it to a pastebin.  Then you can use:

git clone https://aur.archlinux.org/duckdb.git # fetch PKGBUILD from AUR
cd duckdb
curl -o PKGBUILD.diff http://0x0.st/Hd40.diff # Download patch
git apply -v PKGBUILD.diff # Apply the patch
makepkg -rsi # build package

much gratitude!  thank you , worked like a champ!
resolving.


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#6 2024-02-16 16:56:03

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

@loqs,
I see there is an update to python-duckdb, and it errored out, with a similar error as before your patch. do you know if this patch will work with this updated version of python-duckdb?

thnx
--nixit


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#7 2024-02-16 20:12:05

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: python-duckdb errors out on install

I am getting a completely different error

[ 79%] repository
[ 79%] Building CXX object extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/src/prof_recent.cpp.o
Usage: scripts/create_local_extension_repo.py <duckdb_version> <duckdb_platform_out> <path/to/duckdb/build> <path/to/local_repo> <postfix>
make[2]: *** [CMakeFiles/duckdb_local_extension_repo.dir/build.make:71: CMakeFiles/duckdb_local_extension_repo] Error 1
make[1]: *** [CMakeFiles/Makefile2:3594: CMakeFiles/duckdb_local_extension_repo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Please try this updated diff http://0x0.st/HnM3.diff
Edit:
Updated diff http://0x0.st/HnSi.diff this truncates the failing script to 0 which causes python to immediately return when it executes the empty file.

Last edited by loqs (2024-02-16 22:36:49)

Offline

#8 2024-02-16 23:14:30

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

loqs wrote:

I am getting a completely different error

[ 79%] repository
[ 79%] Building CXX object extension/jemalloc/jemalloc/CMakeFiles/jemalloc.dir/src/prof_recent.cpp.o
Usage: scripts/create_local_extension_repo.py <duckdb_version> <duckdb_platform_out> <path/to/duckdb/build> <path/to/local_repo> <postfix>
make[2]: *** [CMakeFiles/duckdb_local_extension_repo.dir/build.make:71: CMakeFiles/duckdb_local_extension_repo] Error 1
make[1]: *** [CMakeFiles/Makefile2:3594: CMakeFiles/duckdb_local_extension_repo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Please try this updated diff http://0x0.st/HnM3.diff
Edit:
Updated diff http://0x0.st/HnSi.diff this truncates the failing script to 0 which causes python to immediately return when it executes the empty file.

wow... thanx,

this is the error I got after makepkg

==> Retrieving sources...
  -> Downloading duckdb-0.10.0.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 75.3M    0 75.3M    0     0  10.1M      0 --:--:--  0:00:07 --:--:-- 5795k
==> ERROR: test.patch was not found in the build directory and is not a URL.
==> Removing installed dependencies...
checking dependencies...

ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#9 2024-02-16 23:31:35

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: python-duckdb errors out on install

git reset --hard # undo HnM3.diff

Then try the diff in my edit to post #8 http://0x0.st/HnSi.diff that does not need to use a patch.

Offline

#10 2024-02-17 03:25:45

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

loqs wrote:
git reset --hard # undo HnM3.diff

Then try the diff in my edit to post #8 http://0x0.st/HnSi.diff that does not need to use a patch.

worked like a champ!

thank you!


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

#11 2024-02-17 11:31:11

loqs
Member
Registered: 2014-03-06
Posts: 17,436

Re: python-duckdb errors out on install

Please keep reporting the issue on the python-duckdb AUR package page.  Also try pointing to this thread and to Python_package_guidelines#setuptools_or_distutils where the issue is documented along with the fix I provided for the issue.  The PKGBUILD can also now switch to Python_package_guidelines#Standards_based_(PEP_517) with the 0.10.0 release which I also did.

Offline

#12 2024-02-17 14:53:26

nixIT
Member
Registered: 2010-01-13
Posts: 528

Re: python-duckdb errors out on install

@loqs,
thank you, I will take a look at those links, and report the link in the aur.

enjoy the rest of your weekend.


ASRock X570 PG VELOCITA AM4 AMD X570  | AMD Ryzen 5900x | 128GB G.SKILL RipjawsV  | ASRock Radeon RX 6700 XT Challenger D

Offline

Board footer

Powered by FluxBB