Skip to content

🐞 Pytest.test wrongly assumes "/opt/venv/bin/python" is present in the user-provided container #13

@danielgafni

Description

@danielgafni

What is the issue?

The current installation may easily fail if the user-provided container does not satisfy the assumptions of this installation process.

More specifically, in order of severance:

  1. It hardcodes --python to an arbitrary location ("--python", "/opt/venv/bin/python") which may not be available. I think you wanna set UV_SYSTEM_PYTHON=true instead.
  2. it performs a uv sync which will uninstall extras and non-default groups; if you wanna do it at least pass --inexact.
  3. Is there a reason it sets a cache buster?
  4. I also find it weird that it installs a specific Python version by default

I think both steps may belong to the optional container setup path here, but a user-provided container should be considered prepared to just run uv pip install over the module-provided pytest_otel.

Even more, I'd make this step optional as well, because users may want to cache this part before copying their source code into the container to avoid rebuilding this error on every source code change.

Dagger version

dagger v0.21.0 (image://registry.dagger.io/engine:v0.21.0) darwin/arm64/v8

Steps to reproduce

No response

Log output

  │ ✘ withExec uv pip install --python /opt/venv/bin/python /opt/pytest_otel 0.1s ERROR
  │ ┃ error: No virtual environment or system Python installation found for path `/opt/venv/bin/python
  │ ┃ uv venv` to create an environment
  │ ! exit code: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions