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

macos: test_uv_venv_skip_missing_interpreters_fail test fails #130

Open
ssbarnea opened this issue Nov 18, 2024 · 1 comment
Open

macos: test_uv_venv_skip_missing_interpreters_fail test fails #130

ssbarnea opened this issue Nov 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ssbarnea
Copy link
Member

Issue

Environment

Provide at least:

  • OS:
Output of pip list of the host Python, where tox is installed
macos

Output of running tox

Output of tox -rvv
========================================================================== FAILURES ==========================================================================
________________________________________________________ test_uv_venv_skip_missing_interpreters_fail _________________________________________________________

tox_project = <function init_fixture.<locals>._init at 0x10350a200>

    def test_uv_venv_skip_missing_interpreters_fail(tox_project: ToxProjectCreator) -> None:
        project = tox_project({
            "tox.ini": "[tox]\nskip_missing_interpreters=false\n[testenv]\npackage=skip\nbase_python=1.0"
        })
        result = project.run("-vv")
>       result.assert_failed(code=1)

tests/test_tox_uv_venv.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = code: -1
cmd: /Users/ssbarnea/code/os/tox-uv/.tox/py/bin/python -m tox -vv
cwd: /private/var/folders/32/1xrphgzd4xv777... Python request `1` from explicit request
  × Invalid version request: Python <3 is not supported but 1 was requested.

code = 1

    def assert_failed(self, code: int | None = None) -> None:
        status_match = self.code != 0 if code is None else self.code == code
>       assert status_match, f"should be {code}, got {self}"  # noqa: S101
E       AssertionError: should be 1, got code: -1
E         cmd: /Users/ssbarnea/code/os/tox-uv/.tox/py/bin/python -m tox -vv
E         cwd: /private/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/pytest-of-ssbarnea/pytest-90/test_uv_venv_skip_missing_inte0/p
E         standard output
E         ROOT: 9676 D setup logging to DEBUG on pid 36143 [tox/report.py:222]
E         py: 9697 W venv> /Users/ssbarnea/code/os/tox-uv/.tox/py/bin/uv venv -p 1 --allow-existing -v /private/var/folders/32/1xrphgzd4xv777syxjtkpdw80000gn/T/pytest-of-ssbarnea/pytest-90/test_uv_venv_skip_missing_inte0/p/.tox/py [tox/tox_env/api.py:427]
E         py: 9715 W skipped because could not find python interpreter with spec(s): 1 [tox/session/cmd/run/single.py:50]
E           py: SKIP (0.02 seconds)
E           evaluation failed :( (0.04 seconds)
E
E         standard error
E         DEBUG uv 0.5.2 (195f4b634 2024-11-14)
E         DEBUG Using Python request `1` from explicit request
E           × Invalid version request: Python <3 is not supported but 1 was requested.
E
E       assert False

.tox/py/lib/python3.12/site-packages/tox/pytest.py:361: AssertionError

Minimal example

@ssbarnea ssbarnea added the bug Something isn't working label Nov 18, 2024
@ssbarnea
Copy link
Member Author

ssbarnea commented Nov 18, 2024

Debugging update

I was able to spot that self.request.allow from https://github.com/tox-dev/tox/blob/5d880fc93c22d37585f838f8f5359be2714223bb/src/tox/execute/local_sub_process/__init__.py#L179 contains only:

(Pdb) self.request.allow
['/Users/ssbarnea/.config/mise/installs/python/3.12.7/bin/uv']

And that is why it fails.

When run without the tox-uv plugin this attribute contains ['.../.tox/py/bin/*'] and I guess that is why it works.

This is happening with the minimal tox.ini file from tha test, one that does not even have any allowlist_externals or even commands inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant