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

build failing when python3.11-venv is not installed #548

Open
jugmac00 opened this issue Dec 6, 2022 · 7 comments
Open

build failing when python3.11-venv is not installed #548

jugmac00 opened this issue Dec 6, 2022 · 7 comments

Comments

@jugmac00
Copy link
Contributor

jugmac00 commented Dec 6, 2022

While testing the release candidate for tox (tox -e py311), I ran into this exception:

raise build.FailedProcessError(exc, 'Failed to create venv. Maybe try installing virtualenv.') from None

But I had virtualenv already installed (in a globally available virtualenv, not a system package). The solution was to install python3.11-venv instead.

I am on Ubuntu 20.04 with Python 3.11 installed via deadsnakes PPA.

@layday
Copy link
Member

layday commented Dec 6, 2022

Builds run in an isolated environment without access to system site packages, which is why build was not able to locate virtualenv. venv is part of the stdlib, albeit debundled by Debian.

@jugmac00
Copy link
Contributor Author

jugmac00 commented Dec 6, 2022

@layday Thanks for clarifying. Do you think it makes sense to update the exception message to point out what to do on Debian/Ubuntu?

@layday
Copy link
Member

layday commented Dec 11, 2022

I think my original diagnosis was incorrect. Was build installed in the same environment as virtualenv, and which version of virtualenv did you have?

@jugmac00
Copy link
Contributor Author

jugmac00 commented Dec 11, 2022

virtualenv is version 20.13.0 (hu, have not updated for a while), and yes, it is installed in a separate virtualenv (bootstrapped as a zipapp).

build was installed via tox for a test

@pytest.mark.usefixtures("enable_pip_pypi_access")
def test_build_wheel_external(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
    ini = """
    [testenv]
    package = external
    package_env = .ext
    commands =
        python -c 'from demo_pkg_inline import do; do()'

    [testenv:.ext]
    deps = build
    package_glob = {envtmpdir}{/}dist{/}*.whl
    commands =
        pyproject-build -w . -o {envtmpdir}{/}dist
    """
    project = tox_project({"tox.ini": ini})
    result = project.run("r", "--root", str(demo_pkg_inline))

    result.assert_success()
    assert "greetings from demo_pkg_inline" in result.out

@layday
Copy link
Member

layday commented Dec 11, 2022

Alright, then I assume that virtualenv was (indeed) not available inside the tox env; I'd still recommend requiring virtualenv (i.e. build[virtualenv]) if it works.

@uranusjr
Copy link
Member

Would it make sense to add a virtual environment creation method to use the virtualenv command in PATH alongside with existing methods?

@layday
Copy link
Member

layday commented Dec 12, 2022 via email

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