Skip to content

Commit 2b453f1

Browse files
authored
build: bump python versions (#228)
* build: bump python versions and adjust tests Signed-off-by: Lídia Tarcza <[email protected]>
1 parent 7ebd71d commit 2b453f1

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
strategy:
4646
matrix:
47-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
47+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
4848

4949
steps:
5050
- name: Checkout repository

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This project contains core functionality required by Python code generated by th
99
(openapi-sdkgen).
1010

1111
# Python Version
12-
The current minimum Python version supported is 3.9.
12+
The current minimum Python version supported is 3.10.
1313

1414
## Installation
1515

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ authors = [
66
]
77
description = "Core library used by SDKs for IBM Cloud Services"
88
readme = "README.md"
9-
requires-python = ">=3.9"
9+
requires-python = ">=3.10"
1010
classifiers = [
1111
"Programming Language :: Python",
1212
"Programming Language :: Python :: 3",
13-
"Programming Language :: Python :: 3.9",
1413
"Programming Language :: Python :: 3.10",
1514
"Programming Language :: Python :: 3.11",
1615
"Programming Language :: Python :: 3.12",
1716
"Programming Language :: Python :: 3.13",
17+
"Programming Language :: Python :: 3.14",
1818
"Development Status :: 5 - Production/Stable",
1919
"Environment :: Console",
2020
"Intended Audience :: Developers",

test/test_base_service.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def test_http_client():
605605
auth = BasicAuthenticator('my_username', 'my_password')
606606
service = AnyServiceV1('2018-11-20', authenticator=auth)
607607
assert isinstance(service.get_http_client(), requests.sessions.Session)
608-
assert service.get_http_client().headers.get('Accept-Encoding') == 'gzip, deflate'
608+
assert service.get_http_client().headers.get('Accept-Encoding').startswith('gzip, deflate')
609609

610610
new_http_client = requests.Session()
611611
new_http_client.headers.update({'Accept-Encoding': 'gzip'})
@@ -677,7 +677,6 @@ def test_gzip_compression():
677677
def test_gzip_compression_file_input():
678678
service = AnyServiceV1('2018-11-20', authenticator=NoAuthAuthenticator())
679679
service.set_enable_gzip_compression(True)
680-
681680
# Should return file-like object with the compressed data when compression is on
682681
# and the input is a file, opened for reading in binary mode.
683682
raw_data = b'rawdata'
@@ -686,21 +685,20 @@ def test_gzip_compression_file_input():
686685
tmp_file.seek(0)
687686

688687
prepped = service.prepare_request('GET', url='', data=tmp_file)
689-
assert prepped['data'].read() == gzip.compress(raw_data)
688+
assert prepped['data'].read() == gzip.compress(raw_data, mtime=None)
690689
assert prepped['headers'].get('content-encoding') == 'gzip'
691690
assert prepped['data'].read() == b''
692691

693692
# Simulate the requests (urllib3) package reading method for binary files.
694693
with tempfile.TemporaryFile(mode='w+b') as tmp_file:
695694
tmp_file.write(raw_data)
696695
tmp_file.seek(0)
697-
698696
prepped = service.prepare_request('GET', url='', data=tmp_file)
699697
compressed = b''
700698
for chunk in prepped['data']:
701699
compressed += chunk
702700

703-
assert compressed == gzip.compress(raw_data)
701+
assert compressed == gzip.compress(raw_data, mtime=None)
704702

705703
# Make sure the decompression works fine.
706704
assert gzip.decompress(compressed) == raw_data
@@ -714,21 +712,20 @@ def test_gzip_compression_file_input():
714712
tmp_file.seek(0)
715713

716714
prepped = service.prepare_request('GET', url='', data=tmp_file)
717-
assert prepped['data'].read() == gzip.compress(text_data.encode())
715+
assert prepped['data'].read() == gzip.compress(text_data.encode(), mtime=None)
718716
assert prepped['headers'].get('content-encoding') == 'gzip'
719717
assert prepped['data'].read() == b''
720718

721719
# Simulate the requests (urllib3) package reading method for text files.
722720
with tempfile.TemporaryFile(mode='w+') as tmp_file:
723721
tmp_file.write(text_data)
724722
tmp_file.seek(0)
725-
726723
prepped = service.prepare_request('GET', url='', data=tmp_file)
727724
compressed = b''
728725
for chunk in prepped['data']:
729726
compressed += chunk
730727

731-
assert compressed == gzip.compress(text_data.encode())
728+
assert compressed == gzip.compress(text_data.encode(), mtime=None)
732729

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

0 commit comments

Comments
 (0)