From 95b1c8571fb08ee11b3e2607632734910eb65665 Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Sat, 15 Aug 2026 23:38:05 +0800 Subject: [PATCH] Tests: Remove obsolete Python version skips --- docs/dataframe.rst | 2 +- pyproject.toml | 3 --- tests/bulk_test.py | 2 -- tests/integration.py | 4 ++-- tests/test_support_pandas.py | 16 ---------------- tests/vector_test.py | 6 +----- 6 files changed, 4 insertions(+), 29 deletions(-) diff --git a/docs/dataframe.rst b/docs/dataframe.rst index 1ceaf5a..a940c9f 100644 --- a/docs/dataframe.rst +++ b/docs/dataframe.rst @@ -58,7 +58,7 @@ Compatibility notes .. NOTE:: Please note that DataFrame support for pandas and Dask is only validated - with Python 3.8 and higher, and SQLAlchemy 1.4 and higher. We recommend + with Python 3.10 and higher, and SQLAlchemy 1.4 and higher. We recommend to use the most recent versions of those libraries. diff --git a/pyproject.toml b/pyproject.toml index 927c19b..53b8d30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,11 +78,8 @@ dynamic = [ "version", ] dependencies = [ - "backports.zoneinfo<1; python_version<'3.9'", "crate>=2.2.1,<3", "geojson>=2.5,<4", - "importlib-metadata; python_version<'3.8'", - "importlib-resources; python_version<'3.9'", "sqlalchemy>=1,<2.2", "verlib2<0.4", ] diff --git a/tests/bulk_test.py b/tests/bulk_test.py index b88ade5..43ea3be 100644 --- a/tests/bulk_test.py +++ b/tests/bulk_test.py @@ -220,7 +220,6 @@ def test_bulk_save_modern(self): } self.assertSequenceEqual(expected_bulk_args, bulk_args) - @skipIf(sys.version_info < (3, 8), "SQLAlchemy/pandas is not supported on Python <3.8") @skipIf(SA_VERSION < SA_2_0, "SQLAlchemy 1.4 is no longer supported by pandas 2.2") @patch("crate.client.connection.Cursor", mock_cursor=FakeCursor) def test_bulk_save_pandas(self, mock_cursor): @@ -261,7 +260,6 @@ def test_bulk_save_pandas(self, mock_cursor): self.assertEqual(effective_op_count, OPCOUNT) @skipIf(sys.version_info >= (3, 13), "SQLAlchemy/Dask is not supported on Python >=3.13 yet") - @skipIf(sys.version_info < (3, 8), "SQLAlchemy/Dask is not supported on Python <3.8") @skipIf(SA_VERSION < SA_2_0, "SQLAlchemy 1.4 is no longer supported by pandas 2.2") @patch("crate.client.connection.Cursor", mock_cursor=FakeCursor) def test_bulk_save_dask(self, mock_cursor): diff --git a/tests/integration.py b/tests/integration.py index 35e5e64..26f5b7b 100644 --- a/tests/integration.py +++ b/tests/integration.py @@ -181,8 +181,8 @@ def create_test_suite(): "docs/advanced-querying.rst", ] - # Don't run DataFrame integration tests on SQLAlchemy 1.4 and earlier, or Python 3.7. - skip_dataframe = SA_VERSION < SA_2_0 or sys.version_info < (3, 8) + # Don't run DataFrame integration tests on SQLAlchemy 1.4 and earlier. + skip_dataframe = SA_VERSION < SA_2_0 if not skip_dataframe: sqlalchemy_integration_tests += [ "docs/dataframe.rst", diff --git a/tests/test_support_pandas.py b/tests/test_support_pandas.py index ecae40c..c2395b1 100644 --- a/tests/test_support_pandas.py +++ b/tests/test_support_pandas.py @@ -1,5 +1,4 @@ import re -import sys import pandas as pd import pytest @@ -36,9 +35,6 @@ ) -@pytest.mark.skipif( - sys.version_info < (3, 8), reason="Feature not supported on Python 3.7 and earlier" -) @pytest.mark.skipif( SA_VERSION < SA_2_0, reason="Feature not supported on SQLAlchemy 1.4 and earlier" ) @@ -72,9 +68,6 @@ def test_table_kwargs_partitioned_by(cratedb_service): assert 'PARTITIONED BY ("time")' in ddl[0][0] -@pytest.mark.skipif( - sys.version_info < (3, 8), reason="Feature not supported on Python 3.7 and earlier" -) @pytest.mark.skipif( SA_VERSION < SA_2_0, reason="Feature not supported on SQLAlchemy 1.4 and earlier" ) @@ -108,9 +101,6 @@ def test_table_kwargs_translog_durability(cratedb_service): assert """"translog.durability" = 'ASYNC'""" in ddl[0][0] -@pytest.mark.skipif( - sys.version_info < (3, 8), reason="Feature not supported on Python 3.7 and earlier" -) @pytest.mark.skipif( SA_VERSION < SA_2_0, reason="Feature not supported on SQLAlchemy 1.4 and earlier" ) @@ -135,9 +125,6 @@ def test_table_kwargs_unknown(cratedb_service): ) -@pytest.mark.skipif( - sys.version_info < (3, 8), reason="Feature not supported on Python 3.7 and earlier" -) @pytest.mark.skipif( SA_VERSION < SA_2_0, reason="Feature not supported on SQLAlchemy 1.4 and earlier" ) @@ -160,9 +147,6 @@ def test_float_special_values(cratedb_service): assert df_load["col_1"].isna().all() -@pytest.mark.skipif( - sys.version_info < (3, 8), reason="Feature not supported on Python 3.7 and earlier" -) @pytest.mark.skipif( SA_VERSION < SA_2_0, reason="Feature not supported on SQLAlchemy 1.4 and earlier" ) diff --git a/tests/vector_test.py b/tests/vector_test.py index 8921aa1..ffc6b74 100644 --- a/tests/vector_test.py +++ b/tests/vector_test.py @@ -22,7 +22,6 @@ from __future__ import absolute_import import re -import sys from unittest import TestCase from unittest.mock import MagicMock, patch @@ -144,10 +143,7 @@ def test_from_db_failure(): with pytest.raises(TypeError) as ex: from_db({"foo": "bar"}) - if sys.version_info < (3, 10): - assert ex.match(re.escape("float() argument must be a string or a number, not 'dict'")) - else: - assert ex.match(re.escape("float() argument must be a string or a real number, not 'dict'")) + assert ex.match(re.escape("float() argument must be a string or a real number, not 'dict'")) def test_to_db_success():