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
I'm trying to run Python tests in a Docker environment using Pants 2.28.0. Tests work fine when I run Docker directly, but fail with ModuleNotFoundError when run through Pants.
Python environment: /opt/venv (created with uv sync --frozen)
All dependencies installed in: /opt/venv/lib/python3.11/site-packages
Container's PATH and VIRTUAL_ENV are set correctly
image and its dependencies successfully built
What doesn't work:
When running the unit tests command
pants test projects/cas/predictor_api:tests-unit
--> fails with ModuleNotFoundError: No module named 'fastapi' - which means that the image environment is overridden, probably it overrides it with pex I tried to ignore it on the configurations unsuccessfully, here are the current BUILD configuration:
Does anyone know what is the correct approach , I would rather to test the image with it's bulit environment to obtain 100% isolation and reliability during the ci.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to run Python tests in a Docker environment using Pants 2.28.0. Tests work fine when I run Docker directly, but fail with ModuleNotFoundError when run through Pants.
Setup:
What doesn't work:
When running the unit tests command
pants test projects/cas/predictor_api:tests-unit
--> fails with ModuleNotFoundError: No module named 'fastapi' - which means that the image environment is overridden, probably it overrides it with pex I tried to ignore it on the configurations unsuccessfully, here are the current BUILD configuration:
Does anyone know what is the correct approach , I would rather to test the image with it's bulit environment to obtain 100% isolation and reliability during the ci.
Beta Was this translation helpful? Give feedback.
All reactions