-
Notifications
You must be signed in to change notification settings - Fork 11.5k
gguf-py : avoid requiring PySide6 for packaged scripts #13036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
gguf-py : avoid requiring PySide6 for packaged scripts #13036
Conversation
- nix : add pyside6 as a python dependency to include it in *-extra shells
Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90?narHash=sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS%2Bb4tfNFCwE%3D' (2024-11-01) → 'github:hercules-ci/flake-parts/c621e8422220273271f52058f618c94e405bb0f5?narHash=sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY%3D' (2025-04-01) • Updated input 'flake-parts/nixpkgs-lib': 'https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz?narHash=sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s%3D' (2024-11-01) → 'github:nix-community/nixpkgs.lib/e4822aea2a6d1cdd36653c134cacfd64c97ff4fa?narHash=sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc%3D' (2025-03-30) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367?narHash=sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w%3D' (2024-11-19) → 'github:NixOS/nixpkgs/b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef?narHash=sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU%3D' (2025-04-17)
Interesting, so this is clearly a problem with the way the entrypoints are all made from the same
Hmmm, yeah, let's hope so. |
So, to answer my own question, I just tried emptying [tool.poetry.scripts]
gguf-convert-endian = "gguf.scripts.gguf_convert_endian:main"
gguf-dump = "gguf.scripts.gguf_dump:main"
gguf-set-metadata = "gguf.scripts.gguf_set_metadata:main"
gguf-new-metadata = "gguf.scripts.gguf_new_metadata:main"
gguf-editor-gui = "gguf.scripts.gguf_editor_gui:main" Built and installed the package and problem seems to be solved, know why it wasn't done like this to begin with? |
@compilade Looking at the commit history I think it sort of just evolved into this without any serious consideration as to why, I think clearing Let me know if you need me to tag the release later. |
…eded Implicit namespaces are supported since Python 3.3 (https://peps.python.org/pep-0420/), and the entrypoints in pyproject.toml can directly refer to the main functions.
@CISC I went ahead and changed I've tested the scripts after building, and they work fine even when |
I'm using Nix devShells for my development, most often with
nix develop .#default-extra
.Problem
I wanted to use
gguf-dump
with some model using the wrapper which that devShell puts in the$PATH
, and was greeted withThat should not be a fatal error, since
gguf-dump
doesn't require that module.This is a problem likely introduced in #12930.
Note that this problem also happens when using
pip install gguf
in a venv.Changes
gguf-py/gguf/scripts/__init__.py
and directly refer to themain
functions of the scripts as their entrypoint inpyproject.toml
(as suggested in gguf-py : avoid requiring PySide6 for packaged scripts #13036 (comment))__init__.py
can be safely removed from that directory since https://peps.python.org/pep-0420/ (Python 3.3). (and it's not really imported anywhere anymore anyway)pyside6
to the python dependencies included in*-extra
devShells*-extra
devShellsgguf_editor_gui
is^6.9
, and6.9.0
is relatively recent (and not in the previous version of nixpkgs inflake.lock
)Make sure to read the contributing guidelines before submitting a PR