Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 5 additions & 8 deletions test/test_base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand Down Expand Up @@ -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'
Expand All @@ -686,21 +685,20 @@ 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 prepped['data'].read() == gzip.compress(raw_data, mtime=None)
assert prepped['headers'].get('content-encoding') == 'gzip'
assert prepped['data'].read() == b''

# Simulate the requests (urllib3) package reading method for binary files.
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 compressed == gzip.compress(raw_data)
assert compressed == gzip.compress(raw_data, mtime=None)

# Make sure the decompression works fine.
assert gzip.decompress(compressed) == raw_data
Expand All @@ -714,21 +712,20 @@ 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 prepped['data'].read() == gzip.compress(text_data.encode(), mtime=None)
assert prepped['headers'].get('content-encoding') == 'gzip'
assert prepped['data'].read() == b''

# Simulate the requests (urllib3) package reading method for text files.
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

assert compressed == gzip.compress(text_data.encode())
assert compressed == gzip.compress(text_data.encode(), mtime=None)

# Make sure the decompression works fine.
assert gzip.decompress(compressed).decode() == text_data
Expand Down