Skip to content

Commit a68bd98

Browse files
authored
Remove support for python 3.8 (#338)
1 parent dfbe83d commit a68bd98

6 files changed

+48
-25
lines changed

CHANGES.rst

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
3.0.0
5+
-----
6+
7+
Breaking Changes
8+
~~~~~~~~~~~~~~~~
9+
10+
- Removed support for Python 3.8
11+
412
2.8.0
513
-----
614

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Please notice that sqlalchemy-hana isn't an official SAP product and isn't cover
1313

1414
Prerequisites
1515
-------------
16-
* Python 3.8+
16+
* Python 3.9+
1717
* SQLAlchemy 1.4 or 2.x
1818
* `hdbcli <https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/f3b8fabf34324302b123297cdbe710f0.html>`_
1919

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "sqlalchemy-hana"
7-
version = "2.8.0"
7+
version = "3.0.0"
88
description = "SQLAlchemy dialect for SAP HANA"
99
keywords = ["sqlalchemy", "sap", "hana"]
10-
requires-python = "~=3.8"
10+
requires-python = "~=3.9"
1111
readme = "README.rst"
1212
authors = [{ name = "Christoph Heer", email = "[email protected]" }]
1313
maintainers = [
@@ -20,7 +20,6 @@ classifiers = [
2020
"License :: OSI Approved :: Apache Software License",
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python :: 3 :: Only",
23-
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",

test/ci_setup.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ def setup(dburi: str) -> str:
2626
# always fulfill the password policy
2727
password = random_string(15) + "A1a"
2828

29-
with closing(
30-
dbapi.connect(url.hostname, url.port, url.username, url.password)
31-
) as connection, closing(connection.cursor()) as cursor:
29+
with (
30+
closing(
31+
dbapi.connect(url.hostname, url.port, url.username, url.password)
32+
) as connection,
33+
closing(connection.cursor()) as cursor,
34+
):
3235
cursor.execute(
3336
f'CREATE USER {user} PASSWORD "{password}" NO FORCE_FIRST_PASSWORD_CHANGE'
3437
)
@@ -41,9 +44,12 @@ def teardown(dburi: str, test_dburi: str) -> None:
4144
url = urlsplit(dburi)
4245
test_user = urlsplit(test_dburi).username
4346

44-
with closing(
45-
dbapi.connect(url.hostname, url.port, url.username, url.password)
46-
) as connection, closing(connection.cursor()) as cursor:
47+
with (
48+
closing(
49+
dbapi.connect(url.hostname, url.port, url.username, url.password)
50+
) as connection,
51+
closing(connection.cursor()) as cursor,
52+
):
4753
cursor.execute(f"DROP USER {test_user} CASCADE")
4854

4955

test/test_dialect.py

+16-10
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@ def test_do_rollback_to_savepoint_unrelated_error(self) -> None:
194194
dialect = config.db.dialect
195195
connection = Mock()
196196

197-
with mock.patch.object(
198-
sys, "exc_info", return_value=(ValueError, ValueError(), Mock())
199-
), mock.patch.object(
200-
DefaultDialect, "do_rollback_to_savepoint"
201-
) as super_rollback:
197+
with (
198+
mock.patch.object(
199+
sys, "exc_info", return_value=(ValueError, ValueError(), Mock())
200+
),
201+
mock.patch.object(
202+
DefaultDialect, "do_rollback_to_savepoint"
203+
) as super_rollback,
204+
):
202205
dialect.do_rollback_to_savepoint(connection, "savepoint")
203206
super_rollback.assert_called_once_with(connection, "savepoint")
204207

@@ -209,11 +212,14 @@ def test_do_rollback_to_savepoint_ignores_error(self) -> None:
209212
error = Error(133, "transaction rolled back: deadlock")
210213
dbapi_error = DBAPIError(None, None, error)
211214

212-
with mock.patch.object(
213-
sys, "exc_info", return_value=(DBAPIError, dbapi_error, Mock())
214-
), mock.patch.object(
215-
DefaultDialect, "do_rollback_to_savepoint"
216-
) as super_rollback:
215+
with (
216+
mock.patch.object(
217+
sys, "exc_info", return_value=(DBAPIError, dbapi_error, Mock())
218+
),
219+
mock.patch.object(
220+
DefaultDialect, "do_rollback_to_savepoint"
221+
) as super_rollback,
222+
):
217223
dialect.do_rollback_to_savepoint(connection, "savepoint")
218224
super_rollback.assert_not_called()
219225

test/test_types.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,15 @@ class BooleanTest(_TypeBaseTest):
141141
[(True, hana_types.BOOLEAN), (False, hana_types.TINYINT)],
142142
)
143143
def test_native_boolean(self, supports_native_boolean, type_):
144-
with mock.patch.object(
145-
testing.db.engine.dialect,
146-
"supports_native_boolean",
147-
supports_native_boolean,
148-
), testing.db.connect() as connection, connection.begin():
144+
with (
145+
mock.patch.object(
146+
testing.db.engine.dialect,
147+
"supports_native_boolean",
148+
supports_native_boolean,
149+
),
150+
testing.db.connect() as connection,
151+
connection.begin(),
152+
):
149153
table = Table("t", self.metadata, Column("x", types.Boolean))
150154
table.create(bind=connection)
151155

0 commit comments

Comments
 (0)