Search Criteria
Package Details: python-safetensors 0.5.3-1
Package Actions
Git Clone URL: | https://aur.archlinux.org/python-safetensors.git (read-only, click to copy) |
---|---|
Package Base: | python-safetensors |
Description: | Simple, safe way to store and distribute tensors |
Upstream URL: | https://github.com/huggingface/safetensors |
Licenses: | Apache-2.0 |
Submitter: | Henry-ZHR |
Maintainer: | envolution |
Last Packager: | envolution |
Votes: | 7 |
Popularity: | 0.34 |
First Submitted: | 2023-01-08 09:54 (UTC) |
Last Updated: | 2025-03-11 02:41 (UTC) |
Dependencies (28)
- python (python37AUR, python311AUR, python310AUR)
- python-build (make)
- python-installer (make)
- python-maturin (python-maturin-gitAUR) (make)
- python-setuptools-rust (make)
- python-wheel (make)
- flake8 (check)
- python-black (python-black-gitAUR) (check)
- python-click (check)
- python-flaxAUR (check)
- python-h5py (python-h5py-gitAUR, python-h5py-openmpi) (check)
- python-huggingface-hub (python-huggingface-hub-gitAUR) (check)
- python-hypothesis (check)
- python-isort (check)
- python-jaxAUR (python-jax-binAUR) (check)
- python-jaxlibAUR (python-jax-rocmAUR, python-jaxlib-binAUR, python-jaxlib-cudaAUR) (check)
- python-numpy (python-numpy-gitAUR, python-numpy1AUR, python-numpy-mkl-binAUR, python-numpy-mkl-tbbAUR, python-numpy-mklAUR) (check)
- python-pytest (check)
- python-pytest-benchmark (check)
- python-pytorch (python-pytorch-cxx11abiAUR, python-pytorch-cxx11abi-optAUR, python-pytorch-cxx11abi-cudaAUR, python-pytorch-cxx11abi-opt-cudaAUR, python-pytorch-cxx11abi-rocmAUR, python-pytorch-cxx11abi-opt-rocmAUR, python-pytorch-cuda, python-pytorch-opt, python-pytorch-opt-cuda, python-pytorch-opt-rocm, python-pytorch-rocm) (check)
- python-tensorflow (python-tensorflow-cuda-keplerAUR, python-tensorflow-computecppAUR, python-tensorflow-rocmAUR, python-tensorflow-opt-rocmAUR, python-tensorflow-cuda, python-tensorflow-opt, python-tensorflow-opt-cuda) (check)
- python-flaxAUR (optional)
- python-jaxAUR (python-jax-binAUR) (optional)
- python-jaxlibAUR (python-jax-rocmAUR, python-jaxlib-binAUR, python-jaxlib-cudaAUR) (optional)
- python-numpy (python-numpy-gitAUR, python-numpy1AUR, python-numpy-mkl-binAUR, python-numpy-mkl-tbbAUR, python-numpy-mklAUR) (optional)
- python-paddlepaddleAUR (python-paddlepaddle-gitAUR, python-paddlepaddle-cuda-gitAUR, python-paddlepaddle-cudaAUR) (optional)
- python-pytorch (python-pytorch-cxx11abiAUR, python-pytorch-cxx11abi-optAUR, python-pytorch-cxx11abi-cudaAUR, python-pytorch-cxx11abi-opt-cudaAUR, python-pytorch-cxx11abi-rocmAUR, python-pytorch-cxx11abi-opt-rocmAUR, python-pytorch-cuda, python-pytorch-opt, python-pytorch-opt-cuda, python-pytorch-opt-rocm, python-pytorch-rocm) (optional)
- python-tensorflow (python-tensorflow-cuda-keplerAUR, python-tensorflow-computecppAUR, python-tensorflow-rocmAUR, python-tensorflow-opt-rocmAUR, python-tensorflow-cuda, python-tensorflow-opt, python-tensorflow-opt-cuda) (optional)
Latest Comments
« First ‹ Previous 1 2 3 4 Next › Last »
mane.andrea commented on 2023-12-09 03:42 (UTC)
Sorry for the delay. I overlooked the notification. Will work on an updated PKGBUILD asap
daskol commented on 2023-12-09 02:41 (UTC)
In my optinion, the best solution is not put any
.gitignore
with glob pattern in AUR repo since there is no actual need in blacklisting files at all.@h3ss I believe that it'd be better to create an empty directory
.git
at$srcdir/safetensors-$pkgver
rather than patching orsed
'ing (see ignore::WalkBuilder). Anyway, we should create an issue in PyO3/maturin. It is stupid that it traverses out of repo root. What about submodules? Why I should tweak include/ignore filters inpyproject.toml
? Weird.@xiota There is the same issue with
python-tokenziers
.h3ss commented on 2023-12-05 03:34 (UTC)
The problem is that the AUR package includes a
.gitignore
file, and thematurin
build backend will ignore anything specified in any.gitignore
file in the path.See: - Wheels for mixed Python/Rust project does not include Python source code #885
The contents of the AUR
.gitignore
are:That first line is the problem, it basically excludes everything from inclusion (except what the Rust part of the build creates apparently).
I have been able to get around this by editing the
src/safetensors-0.4.0/bindings/python/pyproject.toml
file. Specifically, by adding this under the[tool.maturin]
section:See: - Maturin User Guide - Configuration - Specifically the
include
partWhen this is done, the resulting .whl file reliably contains the needed Python source files.
So, how can we get around this in the PKGBUILD? By using
sed
to add theinclude
line to thepyproject.toml
in thebuild()
function:After adding that
sed
line, the package reliably passes all checks and builds.@mane.andrea Can we get this or something equivalent incorporated into the PKGBUILD? I'm confident this should fix this longstanding issue.
PhotonX commented on 2023-11-26 18:14 (UTC) (edited on 2023-11-26 18:15 (UTC) by PhotonX)
I'm getting the check() errors as well. I don't understand what the underlying problem is, though. One of the errors is, exemlarily:
So it searches for
safe_open
from... itself? I think, I have all the necessary dependencies installed, but none of them provides this...t3nzor commented on 2023-11-20 02:22 (UTC) (edited on 2023-11-20 02:22 (UTC) by t3nzor)
The built package doesn't seem to install the Python bindings, only the shared library. I was able to work around this as follows:
makepkg -si --nocheck
sudo cp src/safetensors-0.4.0/bindings/python/py_src/safetensors/* /usr/lib/python3.11/site-packages/safetensors
65a commented on 2023-11-18 02:52 (UTC) (edited on 2023-11-18 02:59 (UTC) by 65a)
@phoenix17, I'm glad it works for you, but it doesn't work for me. The result is still failing to import safetensors.torch or crashing in the check() (this depends on which machine I use?!), using a clean git clone of the AUR source then makepkg -si on multiple machines. Here is one failure log: https://pastebin.com/mppuQw0H
phoenix17 commented on 2023-11-16 20:07 (UTC)
In case this helps someone, I was able to build/install this manually via
makepkg -si
without making any changes to the build script here: https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=python-safetensorsI can confirm it also worked with
python-transformers
package on the aur and pytorch (https://archlinux.org/packages/extra/x86_64/python-pytorch/)pulsarGuy commented on 2023-11-16 04:00 (UTC) (edited on 2023-11-16 04:03 (UTC) by pulsarGuy)
I wound up in @tomsod's situation, and their solution worked for me. Skipping checks did allow the package to be installed, but attempting to import it within python failed. Removing
--wheel
caused the checks to be successful, the package to be installed, and allowed importing within python. Unfortunately, I do not use torch, so I can't comment on that aspect.65a commented on 2023-11-14 02:13 (UTC)
This package doesn't properly provide
safetensors.torch
import. If I follow @tomsod's advice, I can't even importsafetensors
. I suspect it's something betweensrc
andpy-src
directories, but I don't understand python packaging well enough to understand why this is isn't working (PKGBUILD changes look reasonable, but maybe something new is needed to support an upstream change? idk)Tomsod commented on 2023-11-08 04:10 (UTC) (edited on 2023-11-08 04:10 (UTC) by Tomsod)
Tests failed for me too, so I skipped them, but the build package didn't work either. Turns out the
--wheel
option inbuild()
somehow prevents these files from being installed. Without it, everything seems to work fine.« First ‹ Previous 1 2 3 4 Next › Last »