From a38fe46280c73879dab53dc9d1b31d400485c2c5 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Fri, 13 Mar 2026 16:54:02 +0300 Subject: [PATCH 1/2] fix: make pip import optional for uv-managed environments pip is only used to report its version in telemetry data. In environments managed by uv, pip is not installed by default, causing a ModuleNotFoundError at import time. The import is now wrapped in a try/except with a fallback to "unknown". Closes #466 --- qase-python-commons/src/qase/commons/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 {} From d2c93d45fc0942be67118639d6c25727b816a1a2 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Fri, 13 Mar 2026 16:54:46 +0300 Subject: [PATCH 2/2] chore: bump qase-python-commons version to 5.0.6 and update changelog --- qase-python-commons/changelog.md | 6 ++++++ qase-python-commons/pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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"}]