diff --git a/qase-python-commons/changelog.md b/qase-python-commons/changelog.md index dc0fd41f..a28f81aa 100644 --- a/qase-python-commons/changelog.md +++ b/qase-python-commons/changelog.md @@ -1,3 +1,9 @@ +# qase-python-commons@5.0.6 + +## What's new + +- Fixed `ModuleNotFoundError: No module named 'pip'` in environments managed by `uv`, which does not install `pip` by default. The `pip` import is now optional with a fallback to `"unknown"` for telemetry version reporting. Resolves [#466](https://github.com/qase-tms/qase-python/issues/466). + # qase-python-commons@5.0.3 ## What's new diff --git a/qase-python-commons/pyproject.toml b/qase-python-commons/pyproject.toml index ad489d12..17404a8d 100644 --- a/qase-python-commons/pyproject.toml +++ b/qase-python-commons/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "qase-python-commons" -version = "5.0.5" +version = "5.0.6" description = "A library for Qase TestOps and Qase Report" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] diff --git a/qase-python-commons/src/qase/commons/utils.py b/qase-python-commons/src/qase/commons/utils.py index 55f52451..6c687a0c 100644 --- a/qase-python-commons/src/qase/commons/utils.py +++ b/qase-python-commons/src/qase/commons/utils.py @@ -3,7 +3,11 @@ import threading import sys from typing import Union, List -import pip +try: + import pip + pip_version = pip.__version__ +except ModuleNotFoundError: + pip_version = "unknown" import string import uuid import time @@ -134,7 +138,7 @@ def get_host_data() -> dict: "version": platform.uname().version, "machine": platform.uname().machine, 'python': '.'.join(map(str, sys.version_info)), - 'pip': pip.__version__ + 'pip': pip_version } except Exception as e: return {}