You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TST: Hard to install ipython into local test run with tox-uv #17793
@mhvk Thanks for pointing this out, I honestly had no idea that someone would use tox to create virtualenvs. The answer is a yes but: uvdoes not include pip itself in virtualenvs it creates (because it makes it redundant), so if you were to run the exact commands you showed in that order, you'd get stopped at
$ pip install ipython
/Users/clm/dev/astropy-project/coordinated/astropy/.tox/test/bin/python: No module named pip
but that's trivially solved by either:
* typing `uv pip` instead of `pip`
* running the awkward (but functional) command `uv pip install pip` between env activation and any further install
is this satisfactory ?
@neutrinoceros - now that this PR is merged, I noticed that my workflow of
tox -e test --develop --notest
source .tox/test/bin/activate
pip install ipython
is indeed broken (as expected). However, your statement that I could just do uv pip install ipython turns out not to be true, since by default uv is not in the path, so I'm stuck with .tox/.tox/bin/uv pip install ipython, which is quite long. There probably is a clever trick to have this work, but I haven't been able to find it. Any suggestions?
I initially thought that tox-uv would integrate with a system-level installed uv. It is clear now that it doesn't. I think this is why my initial response was wrong. Let me try and come up with a new solution for this workflow.
Activity
neutrinoceros commentedon Feb 19, 2025
I initially thought that
tox-uvwould integrate with a system-level installeduv. It is clear now that it doesn't. I think this is why my initial response was wrong. Let me try and come up with a new solution for this workflow.neutrinoceros commentedon Feb 19, 2025
Further context: @mhvk's original comment was #16963 (comment)
mhvk commentedon Feb 19, 2025
FWIW, I tried
tox ... -x uv_seed=True, which seemed logical but didn't seem to do anything.neutrinoceros commentedon Feb 19, 2025
this worked for me
pip install ipythonprobably works too but I'm always wary that it might not run within the environment currently activated, so I avoided it.mhvk commentedon Feb 19, 2025
Hmm, that increases the line count by one! It is probably easier to add
.tox/.tox/binto my path; it will generally not exist anyway...pllim commentedon Feb 19, 2025
Do we need to update our dev guide for testing about this?
neutrinoceros commentedon Feb 19, 2025
I would be -0.9 on promoting this workflow which feels a lot like a hack to me.