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

Installing hatch masks my globally installed uv #1520

Open
dhirschfeld opened this issue May 23, 2024 · 7 comments
Open

Installing hatch masks my globally installed uv #1520

dhirschfeld opened this issue May 23, 2024 · 7 comments

Comments

@dhirschfeld
Copy link

I use the uv package manager and have it globally installed as a default tool, available anywhere.

When I install hatch, my globally installed uv is masked by the version required by hatch.

It's not a big problem as hatch isn't constraining uv, but it's worth considering if there's a way to not mask a globally installed version.

@ofek
Copy link
Collaborator

ofek commented May 24, 2024

Did you install using the binary?

@dhirschfeld
Copy link
Author

Did you install using the binary?

Hatch or uv? Both are installed with mamba.

@ofek
Copy link
Collaborator

ofek commented May 24, 2024

@dhirschfeld
Copy link
Author

I didn't know about that. Will give that a go, thanks!

@ofek
Copy link
Collaborator

ofek commented May 30, 2024

Does that suffice?

@dhirschfeld
Copy link
Author

Testing timeframes are likely measured in weeks - it's not causing any actual problems at present so isn't a super high priority...

@polarathene
Copy link

polarathene commented Jun 21, 2024

When I install hatch, my globally installed uv is masked by the version required by hatch.

Is that within a hatch environment specifically? Or on the host? If it is on the host, it's probably due to mamba in your PATH environment having higher precedence than your system uv binary?

Otherwise, in a hatch shell you probably can access uv from hatch, but not the hatch command itself (documented here in collapsed section):

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

$ cd /tmp && hatch shell --name 3.11
$ python --version
Python 3.12.3

# Fails due to modified PATH:
$ hatch --version
bash: /root/.local/share/pyapp/hatch/1303662642487178586/1.11.0/python/bin/hatch: cannot execute: required file not found
$ /usr/local/bin/hatch --version
Hatch, version 1.11.0
# UV is available however:
$ uv --version
uv 0.1.44

# hatch environment and hatch install location are given precedence for resolving binaries:
$ echo $PATH
/root/.local/share/hatch/env/virtual/opt/y8366zdl/opt/bin:/root/.local/share/pyapp/hatch/1303662642487178586/1.11.0/python/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

That happens with the curl install (PyApp), but not with pipx install. Presumably mamba would be similar for you.


HATCH_ENV_TYPE_VIRTUAL_UV_PATH IIRC only changes what uv binary hatch will use implicitly. If your issue is not that, but with explicit use of the uv command yourself, this ENV does not help AFAIK. The linked docs might not make that distinction clear though.

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

3 participants