Skip to content
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

Hatch support for uv.lock #1886

Open
RickyDaMa opened this issue Jan 13, 2025 · 3 comments
Open

Hatch support for uv.lock #1886

RickyDaMa opened this issue Jan 13, 2025 · 3 comments

Comments

@RickyDaMa
Copy link

Does Hatch support/respect uv's lockfile, or are there any plans to add this? I don't believe Hatch has its own lock file standard currently

@funkyfuture
Copy link
Contributor

there's a proposal for a standard lock file spec.

@sathieu
Copy link

sathieu commented Mar 6, 2025

PEP 751 is about [project]'s dependencies. Is there anything about [tool.hatch.envs.<envname>] dependencies and extra-dependencies?

@juftin
Copy link
Contributor

juftin commented Mar 8, 2025

PEP 751 is about [project]'s dependencies. Is there anything about [tool.hatch.envs.<envname>] dependencies and extra-dependencies?

Sorry for lurking, but I wanted to point out an important distinction between Hatch and UV and their differing approaches to "environments."

UV supports a singular virtual environment with a corresponding LockFile. UV supports different dependency groups for the environment (like "dev" / "test" / "docs"), however each of these groups ultimately need to resolve to the same virtual environment and the same LockFile.

Hatch, on the other hand, uses a virtual-environment-per-environment approach instead of dependency groups. This means that you would have a different virtual environment for each of your "dev" / "test" / "docs" environments. The power here of Hatch's approach is that you can have conflicting versions across your environments. Environment A can use pandas==1.0.0 and Environment B can use pandas==2.0.0.

As things stand today, in order for Hatch to support UV LockFiles there would need to be a LockFile per-environment.

From my understanding, hatch is also standards-based so I believe that the UV LockFile would need to be fully standardized and accepted before Hatch would adopt it (I don't represent the viewpoints of the Hatch maintainers so take this comment at face-value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants