Skip to content

feat: migrate to PEP 621 and add uv support#21907

Merged
danbev merged 6 commits into
ggml-org:masterfrom
dhdaines:poetry_migrate
May 6, 2026
Merged

feat: migrate to PEP 621 and add uv support#21907
danbev merged 6 commits into
ggml-org:masterfrom
dhdaines:poetry_migrate

Conversation

@dhdaines

Copy link
Copy Markdown
Contributor

Overview

The pyproject.toml was no longer valid, in particular because transformers==5.5.1 does not actually support Python 3.9. This means that though Poetry insisted on running poetry lock, that command would always fail.

Also, because it used Poetry-specific configuration, it was not usable with less broken build/package managers like uv and hatch. Now that Poetry supports the PEP 621 standard for metadata, it is possible to interoperate.

I have also add the proper configuration to use uv, so you can now simply do uv run llama-convert-hf-to-gguf from the root directory and it will Just Work (I hope!). Yes, you can do this with poetry run as well 😉

Probably fixes #21536

Requirements

@ggml-gh-bot

This comment was marked as off-topic.

@github-actions github-actions Bot added the python python script changes label Apr 14, 2026
@CISC

CISC commented Apr 15, 2026

Copy link
Copy Markdown
Member

Thanks, we're using poetry to publish the gguf package (see gguf-publish.yml), but no-one is maintaining the poetry artifacts any more.

In fact I think it is too much of a burden to maintain the lock files in general, if poetry does not require it I think it will be preferable to remove it (and uv.lock).

@dhdaines

Copy link
Copy Markdown
Contributor Author

In fact I think it is too much of a burden to maintain the lock files in general, if poetry does not require it I think it will be preferable to remove it (and uv.lock).

I agree, I feel like lockfiles in anything other than a deployment situation are highly overrated... I can remove it from the PR.

@ggerganov

Copy link
Copy Markdown
Member

What are the next steps here?

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@CISC

CISC commented May 5, 2026

Copy link
Copy Markdown
Member

What are the next steps here?

It looks like poetry, the config and the dependencies need to be brought up-to-date and the lock files removed. This means we will no longer provide locked dependencies, but making sure we are updating them whenever we need to bump a dependency is too burdensome.

@danbev danbev force-pushed the poetry_migrate branch from 823778e to 8da750b Compare May 6, 2026 08:37
@danbev danbev removed the documentation Improvements or additions to documentation label May 6, 2026
@danbev

danbev commented May 6, 2026

Copy link
Copy Markdown
Member

@CISC I've tried to address your comments above related to the dependencies and the lock files. I'm not sure what needs to be done for the config yet, but wondering if we could perhaps do this in a follow up PR, so that we could perhaps release gguf-py to pypi (#22664)?

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, let's hope this works. :)

Comment thread gguf-py/pyproject.toml Outdated
Comment thread pyproject.toml
authors = [{name = "GGML", email = "ggml@ggml.ai"}]
requires-python = '>=3.10'
dependencies = [
'numpy (>=1.25.0,<2.0.0)',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may also be the time to bump numpy, but we can leave that to a follow up.

Comment thread gguf-py/pyproject.toml Outdated
@danbev

danbev commented May 6, 2026

Copy link
Copy Markdown
Member

I'm running some manual tests on macos, windows, and linux and ran into this issue #22753.
But cherry-picking that I can use poetry to convert:

  • linux
  • macos
  • window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes script Script related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile bug: building python-scrips nix derivation fails due to protobuf version constraint

4 participants