cool-easter-32542
06/05/2024, 9:45 PM/3rdparty/BUILD
...
python_requirements(
name="python-default",
source="requirements/default_requirements.txt",
module_mapping={
"PyYAML": ["yaml"],
"opencv-python": ["cv2"],
"ruamel-yaml": ["ruamel.yaml"],
"scikit-video": ["skvideo"],
"torchvision": ["albumentations.pytorch", "torchvision"],
"azure-monitor-opentelemetry": ["azure"],
"google-auth": ["google.auth"],
"google-auth-oauthlib": ["google.oauth2", "google_auth_oauthlib"],
"google-api-python-client": ["googleapiclient"],
},
resolve="python-default",
overrides={
"docplex": {"dependencies": [":python-default#cplex"]},
"fastapi": {
"dependencies": [
":python-default#python-multipart",
":python-default#httpx",
]
},
"mongomock": {"dependencies": [":python-default#setuptools"]},
"sqlalchemy": {"dependencies": [":python-default#pyodbc"]},
},
)
...
By just changig the pants_version from the /pants.toml down to 2.18.0 or 2.19.0 makes the test pass smoothly. 2.20.0 and 2.21.0 would end with Cv2 import error for several tests:
ModuleNotFoundError: No module named 'cv2'
Commenting the lines related to other imports from the same module_mapping (for example "ruamel-yaml": ["ruamel.yaml"],) would result in import errors related to those modules. This points out to the problem been cv2 specific.
Any ideas on why pants > 2.19 wouldn't pick up the module_mapping={"opencv-python": ["cv2"]}?
Pants version
2.21.0
OS
Linux
pantsbuild/pantscool-easter-32542
06/21/2024, 11:30 PM