-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
tox-uv (1.15) runs with Python 3.9, and fails with 3.10 and 3.11. #110
Comments
I am facing the exact same issue, except that I am targeting Python 3.10 - 3.13 and only 3.13 works. This only happens when using the |
Can you provide a reproducible using a docker image? That way I can reproduce it on my machine and easier to fix it and understand what's happening. |
I can reproduce. pin to some python version and run a tox session with another python version. E.g.
The error does not happen when the python version of the tox session matches the pinned python. |
This fails:FROM ghcr.io/astral-sh/uv:0.5.1-python3.13-bookworm@sha256:ae1bf2a1a69ef66cb179b9b7cf36da21ac2fac1145bc91e29ddb93d9f171ae3b
RUN mkdir debug && \
cd debug && \
uv init --python=3.12 && \
uv sync && \
echo "[tox]\n[testenv:py3{12,13}]\nrunner=uv-venv-lock-runner\ncommands=python hello.py" > tox.ini
RUN cd debug && uvx --with tox-uv==1.16.0 tox run -e py312
RUN cd debug && uvx --with tox-uv==1.16.0 tox run -e py313 Log
This works:FROM ghcr.io/astral-sh/uv:0.5.1-python3.13-bookworm@sha256:ae1bf2a1a69ef66cb179b9b7cf36da21ac2fac1145bc91e29ddb93d9f171ae3b
RUN mkdir debug && \
cd debug && \
uv init --python=3.12 && \
uv sync && \
echo "[tox]\n[testenv:py3{12,13}]\nrunner=uv-venv-lock-runner\ncommands=python hello.py" > tox.ini
RUN cd debug && uvx --with tox-uv==1.16.0 tox run -e py312
RUN cd debug && rm .python-version && uvx --with tox-uv==1.16.0 tox run -e py313 && uv python pin 3.12
RUN cd debug && uvx --with tox-uv==1.16.0 tox run -e py313 Tested with |
I have a fix: FROM ghcr.io/astral-sh/uv:0.5.4-python3.13-bookworm@sha256:c053e153740d87b1847cb201a23f7bb9267d66cf666d9009101b241bfef57eca
RUN mkdir debug && \
cd debug && \
uv init --python=3.12 && \
uv sync && \
uv tool install --with tox-uv==1.16.0 tox && \
echo "[tox]\n[testenv:py3{12,13}]\nrunner=uv-venv-lock-runner\ncommands=python hello.py" > tox.ini
# FIX HERE
#
# we monkey patch with find + sed _run_lock.py
# remove the RUN line below and it should fail
#
RUN find /root/.local/share/uv/ -type f -name "_run_lock.py" -exec sed -i 's/cmd = \["uv", "sync", "--frozen"\]/cmd = ["uv", "sync", "-p", self.env_python(), "--frozen"]/g' {} +
########
RUN cd debug && /root/.local/bin/tox run -e py313 i.e: in _run_lock.py line 63: tox-uv/src/tox_uv/_run_lock.py Line 63 in 82825c8
replace cmd = ["uv", "sync", "--frozen"] with cmd = ["uv", "sync", "-p", self.env_python(), "--frozen"] I do not have time for a PR, I'll let someone else do it. Note that #121 might be right. This fixes
|
meanwhile one can also use uv_sync_flags=--python={env_python} Test: FROM ghcr.io/astral-sh/uv:0.5.4-python3.13-bookworm@sha256:c053e153740d87b1847cb201a23f7bb9267d66cf666d9009101b241bfef57eca
RUN mkdir debug && \
cd debug && \
uv init --python=3.12 && \
uv sync && \
uv tool install --with tox-uv==1.16.0 tox && \
echo "[tox]\n[testenv:py3{12,13}]\nrunner=uv-venv-lock-runner\ncommands=python hello.py\nuv_sync_flags=--python={env_python}" > tox.ini
RUN cd debug && /root/.local/bin/tox run -e py313 |
Issue
tox-uv (1.15) runs with Python 3.9, and fails with 3.10 and 3.11.
Environment
Provide at least:
Output of
pip list
of the host Python, wheretox
is installedOutput of running tox
Output of
tox -rvv
Minimal example
The text was updated successfully, but these errors were encountered: