From 4a624f55ffe4df2385dba060d5917cff283847d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:23:45 +0100 Subject: [PATCH 1/6] build: bump python versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .github/workflows/build.yaml | 6 +++--- .github/workflows/publish.yaml | 2 +- pyproject.toml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 076950f..0d84836 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,7 +26,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.14 - name: Install detect-secrets run: | @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - name: Checkout repository @@ -78,7 +78,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.14 - name: Install Publishing Tools run: | diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2b6c652..c08a1b6 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -24,7 +24,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: 3.14 - name: Build and publish distribution env: diff --git a/pyproject.toml b/pyproject.toml index 612f29d..550344d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,15 +6,15 @@ authors = [ ] description = "Core library used by SDKs for IBM Cloud Services" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "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", + "Programming Language :: Python :: 3.14", "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", From 44711f9d2c16b7512a0680e5bc2fe2ed498aadf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:40:48 +0100 Subject: [PATCH 2/6] build: update readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .github/workflows/build.yaml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0d84836..810351e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,7 +26,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.14 + python-version: 3.13 - name: Install detect-secrets run: | @@ -78,7 +78,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.14 + python-version: 3.13 - name: Install Publishing Tools run: | diff --git a/README.md b/README.md index 76ae4a2..8ce0bc0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This project contains core functionality required by Python code generated by th (openapi-sdkgen). # Python Version -The current minimum Python version supported is 3.9. +The current minimum Python version supported is 3.10. ## Installation From 3114552b7bd03879eaad04e338bf7550a97784ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:27:37 +0100 Subject: [PATCH 3/6] build: bump python versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index c08a1b6..2b6c652 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -24,7 +24,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.14 + python-version: 3.13 - name: Build and publish distribution env: From 25c357ea84539cbf360f6abc24c9663baa7e9424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:36:46 +0100 Subject: [PATCH 4/6] fix(test): change tests to run on python 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- test/test_base_service.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/test/test_base_service.py b/test/test_base_service.py index f7a97fb..9d2ece1 100644 --- a/test/test_base_service.py +++ b/test/test_base_service.py @@ -605,7 +605,7 @@ def test_http_client(): auth = BasicAuthenticator('my_username', 'my_password') service = AnyServiceV1('2018-11-20', authenticator=auth) assert isinstance(service.get_http_client(), requests.sessions.Session) - assert service.get_http_client().headers.get('Accept-Encoding') == 'gzip, deflate' + assert service.get_http_client().headers.get('Accept-Encoding').startswith('gzip, deflate') new_http_client = requests.Session() new_http_client.headers.update({'Accept-Encoding': 'gzip'}) @@ -686,7 +686,7 @@ def test_gzip_compression_file_input(): tmp_file.seek(0) prepped = service.prepare_request('GET', url='', data=tmp_file) - assert prepped['data'].read() == gzip.compress(raw_data) + assert gzip.decompress(prepped['data'].read()) == raw_data assert prepped['headers'].get('content-encoding') == 'gzip' assert prepped['data'].read() == b'' @@ -700,10 +700,7 @@ def test_gzip_compression_file_input(): for chunk in prepped['data']: compressed += chunk - assert compressed == gzip.compress(raw_data) - - # Make sure the decompression works fine. - assert gzip.decompress(compressed) == raw_data + assert gzip.decompress(compressed) == raw_data # Should return file-like object with the compressed data when compression is on # and the input is a file, opened for reading in text mode. @@ -714,7 +711,7 @@ def test_gzip_compression_file_input(): tmp_file.seek(0) prepped = service.prepare_request('GET', url='', data=tmp_file) - assert prepped['data'].read() == gzip.compress(text_data.encode()) + assert gzip.decompress(prepped['data'].read()) == text_data.encode() assert prepped['headers'].get('content-encoding') == 'gzip' assert prepped['data'].read() == b'' @@ -728,10 +725,8 @@ def test_gzip_compression_file_input(): for chunk in prepped['data']: compressed += chunk - assert compressed == gzip.compress(text_data.encode()) - - # Make sure the decompression works fine. - assert gzip.decompress(compressed).decode() == text_data + # Make sure the decompression works fine. + assert gzip.decompress(compressed).decode() == text_data def test_gzip_compression_external(): From 53685f9ae135aa483cb3f3c323ca825f62695016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Wed, 12 Nov 2025 09:42:10 +0100 Subject: [PATCH 5/6] fix(test): change tests to run on python 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- test/test_base_service.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/test_base_service.py b/test/test_base_service.py index 9d2ece1..b077079 100644 --- a/test/test_base_service.py +++ b/test/test_base_service.py @@ -677,7 +677,6 @@ def test_gzip_compression(): def test_gzip_compression_file_input(): service = AnyServiceV1('2018-11-20', authenticator=NoAuthAuthenticator()) service.set_enable_gzip_compression(True) - # Should return file-like object with the compressed data when compression is on # and the input is a file, opened for reading in binary mode. raw_data = b'rawdata' @@ -686,7 +685,7 @@ def test_gzip_compression_file_input(): tmp_file.seek(0) prepped = service.prepare_request('GET', url='', data=tmp_file) - assert gzip.decompress(prepped['data'].read()) == raw_data + assert prepped['data'].read() == gzip.compress(raw_data, mtime=None) assert prepped['headers'].get('content-encoding') == 'gzip' assert prepped['data'].read() == b'' @@ -694,13 +693,15 @@ def test_gzip_compression_file_input(): with tempfile.TemporaryFile(mode='w+b') as tmp_file: tmp_file.write(raw_data) tmp_file.seek(0) - prepped = service.prepare_request('GET', url='', data=tmp_file) compressed = b'' for chunk in prepped['data']: compressed += chunk - assert gzip.decompress(compressed) == raw_data + assert compressed == gzip.compress(raw_data, mtime=None) + + # Make sure the decompression works fine. + assert gzip.decompress(compressed) == raw_data # Should return file-like object with the compressed data when compression is on # and the input is a file, opened for reading in text mode. @@ -711,7 +712,7 @@ def test_gzip_compression_file_input(): tmp_file.seek(0) prepped = service.prepare_request('GET', url='', data=tmp_file) - assert gzip.decompress(prepped['data'].read()) == text_data.encode() + assert prepped['data'].read() == gzip.compress(text_data.encode(), mtime=None) assert prepped['headers'].get('content-encoding') == 'gzip' assert prepped['data'].read() == b'' @@ -719,15 +720,15 @@ def test_gzip_compression_file_input(): with tempfile.TemporaryFile(mode='w+') as tmp_file: tmp_file.write(text_data) tmp_file.seek(0) - prepped = service.prepare_request('GET', url='', data=tmp_file) compressed = b'' for chunk in prepped['data']: compressed += chunk - # Make sure the decompression works fine. - assert gzip.decompress(compressed).decode() == text_data + assert compressed == gzip.compress(text_data.encode(), mtime=None) + # Make sure the decompression works fine. + assert gzip.decompress(compressed).decode() == text_data def test_gzip_compression_external(): # Should set gzip compression from external config From 971585e5eebd862afbe93fdd6ad55d6fa2659e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=ADdia=20Tarcza?= <100163235+diatrcz@users.noreply.github.com> Date: Wed, 12 Nov 2025 09:47:11 +0100 Subject: [PATCH 6/6] fix(test): lint code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com> --- test/test_base_service.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_base_service.py b/test/test_base_service.py index b077079..a90f79e 100644 --- a/test/test_base_service.py +++ b/test/test_base_service.py @@ -730,6 +730,7 @@ def test_gzip_compression_file_input(): # Make sure the decompression works fine. assert gzip.decompress(compressed).decode() == text_data + def test_gzip_compression_external(): # Should set gzip compression from external config file_path = os.path.join(os.path.dirname(__file__), '../resources/ibm-credentials-gzip.env')