From d63bc61f9d3702465fc9492513b4aae78c708242 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Wed, 4 Dec 2024 11:08:45 -0500 Subject: [PATCH] Drop support for Python 3.8, which is at end of life Also add tests for Python 3.13. --- .github/workflows/test.yml | 6 +++--- gcn_kafka/env.py | 11 +---------- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 176fda7..ed2a85d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,20 +16,20 @@ jobs: with: coverage: 'codecov' envs: | - - linux: py38 - linux: py39 - linux: py310 - linux: py311 - linux: py312 - - macos: py38 + - linux: py313 - macos: py39 - macos: py310 - macos: py311 - macos: py312 - - windows: py38 + - macos: py313 - windows: py39 - windows: py310 - windows: py311 - windows: py312 + - windows: py313 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/gcn_kafka/env.py b/gcn_kafka/env.py index f4a97fa..10439a7 100644 --- a/gcn_kafka/env.py +++ b/gcn_kafka/env.py @@ -8,15 +8,6 @@ replacement_dict = {"_": ".", "__": "-", "___": "_"} -# Adapted from https://peps.python.org/pep-0616/ -# # FIXME: Remove after dropping support for Python 3.8 -def removeprefix(self: str, prefix: str) -> str: - if self.startswith(prefix): - return self[len(prefix) :] - else: - return self[:] - - def replacement(match: re.Match) -> str: text = match[0] return replacement_dict.get(text) or text @@ -40,6 +31,6 @@ def config_from_env( config = {} for key, value in env.items(): if key.startswith(prefix): - key = env_key_splitter.sub(replacement, removeprefix(key, prefix)) + key = env_key_splitter.sub(replacement, key.removeprefix(prefix)) config[key.lower()] = value return config diff --git a/pyproject.toml b/pyproject.toml index b3c1d75..0ac0a49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "confluent-kafka >= 2.2.0", "requests", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dynamic = [ "version" ] [project.urls]