diff --git a/qase-api-v2-client/README.md b/qase-api-v2-client/README.md index f9db4d8d..067568f3 100644 --- a/qase-api-v2-client/README.md +++ b/qase-api-v2-client/README.md @@ -5,14 +5,13 @@ Qase TestOps API v2 Specification. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.0.0 -- Package version: 1.0.0 -- Generator version: 7.4.0 +- Generator version: 7.15.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://qase.io](https://qase.io) -## Requirements. +## Requirements -Python 3.7+ +Python 3.9+ ## Installation & Usage @@ -21,10 +20,10 @@ Python 3.7+ If the python package is hosted on a repository, you can install directly using: ```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +pip install qase-api-v2-client ``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) +(you may need to run `pip` with root permission: `sudo pip install qase-api-v2-client`) Then import the package: @@ -98,12 +97,12 @@ with qase.api_client_v2.ApiClient(configuration) as api_client: ## Documentation for API Endpoints -All URIs are relative to *https://api.qase.io/v2* +All URIs are relative to ** - Class | Method | HTTP request | Description + Class | Method | HTTP request | Description --------------|---------------------------------------------------------------|-----------------------------------------------|------------------------------------ - *ResultsApi* | [**create_result_v2**](docs/ResultsApi.md#create_result_v2) | **POST** /{project_code}/run/{run_id}/result | (Beta) Create test run result - *ResultsApi* | [**create_results_v2**](docs/ResultsApi.md#create_results_v2) | **POST** /{project_code}/run/{run_id}/results | (Beta) Bulk create test run result + *ResultsApi* | [**create_result_v2**](docs/ResultsApi.md#create_result_v2) | **POST** /{project_code}/run/{run_id}/result | (Beta) Create test run result + *ResultsApi* | [**create_results_v2**](docs/ResultsApi.md#create_results_v2) | **POST** /{project_code}/run/{run_id}/results | (Beta) Bulk create test run result ## Documentation For Models @@ -135,6 +134,4 @@ Authentication schemes defined for the API: ## Author -support@qase.io - - + diff --git a/qase-python-commons/changelog.md b/qase-python-commons/changelog.md index a454c762..883d482b 100644 --- a/qase-python-commons/changelog.md +++ b/qase-python-commons/changelog.md @@ -1,3 +1,17 @@ +# qase-python-commons@4.0.0 + +## What's new + +- Unsupport Python 3.7 and 3.8. Support Python 3.9, 3.10, 3.11, 3.12, 3.13. +- Updated the `qase-api-client` dependency to the latest version. +- Updated the `qase-api-v2-client` dependency to the latest version. + +# qase-python-commons@3.5.8 + +## What's new + +- Updated the `qase-api-client` dependency to the latest version. + # qase-python-commons@3.5.7 ## What's new diff --git a/qase-python-commons/pyproject.toml b/qase-python-commons/pyproject.toml index 364a3977..bc05a2bf 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 = "3.5.7" +version = "4.0.0" description = "A library for Qase TestOps and Qase Report" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] @@ -18,20 +18,19 @@ classifiers = [ 'Topic :: Software Development :: Testing', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] urls = {"Homepage" = "https://github.com/qase-tms/qase-python/tree/main/qase-python-commons"} -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = [ "certifi>=2024.2.2", "attrs>=23.2.0", - "qase-api-client~=1.2.3", - "qase-api-v2-client~=1.2.2", + "qase-api-client~=2.0.0", + "qase-api-v2-client~=2.0.0", "more_itertools" ] @@ -48,8 +47,8 @@ testing = [ [tool.tox] legacy_tox_ini = """ [tox] -minversion = 3.7 -envlist = py{37,38,39,310,311} +minversion = 3.9 +envlist = py{39,310,311,312,313} [testenv] deps = diff --git a/qase-python-commons/src/qase/commons/models/attachment.py b/qase-python-commons/src/qase/commons/models/attachment.py index d6c7587b..fce10be8 100644 --- a/qase-python-commons/src/qase/commons/models/attachment.py +++ b/qase-python-commons/src/qase/commons/models/attachment.py @@ -29,16 +29,19 @@ def __init__(self, def get_id(self) -> str: return self.id - def get_for_upload(self) -> BytesIO: + def get_for_upload(self) -> tuple: + """Returns attachment data in format expected by new API client: (filename, filedata)""" + if self.file_path: with open(self.file_path, "rb") as fc: - content = BytesIO(fc.read()) + filedata = fc.read() else: if isinstance(self.content, str): - content = BytesIO(bytes(self.content, 'utf-8')) + filedata = bytes(self.content, 'utf-8') elif isinstance(self.content, bytes): - content = BytesIO(self.content) - content.name = self.file_name - content.mime = self.mime_type - - return content + filedata = self.content + else: + # Handle case where content is not str or bytes (e.g., JSON serialized) + filedata = bytes(self.content, 'utf-8') + + return (self.file_name, filedata)