From f645e186a09949adc45fdc33663b71d748ffe5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 13:46:56 +0100 Subject: [PATCH 1/6] upd: python 3.14 included --- .github/workflows/release.yaml | 4 ++-- .gitignore | 1 + pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bd31077..b2c1a6e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -62,7 +62,7 @@ jobs: # Uncomment to re-enable multi-OS testing: # os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - python: ["3.10", "3.11", "3.12", "3.13"] + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 with: @@ -170,7 +170,7 @@ jobs: # Uncomment to re-enable multi-OS testing: # os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest] - python: ["3.10", "3.11", "3.12", "3.13"] + python: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v3 # Checkout repo here is required so pyproject.toml and source code exist. diff --git a/.gitignore b/.gitignore index 203402f..a5c6475 100644 --- a/.gitignore +++ b/.gitignore @@ -190,6 +190,7 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. However, if you prefer, # you could uncomment the following to ignore the entire vscode folder .vscode/ +.continue/ # Ruff stuff: .ruff_cache/ diff --git a/pyproject.toml b/pyproject.toml index f6359bc..46cef62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "woffu_client" version = "0.0.0" # This will be replaced by the CI pipeline -requires-python = ">=3.10,<3.14" +requires-python = ">=3.10,<3.15" description = "Woffu API client with access to several endpoints." authors = [{name="Marc Palacín Marfil", email="marc.palacin.marfil@gmail.com"}] readme = "README.md" From 0e6067133a4ade090013ac42a1ca3b78125001ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 13:53:15 +0100 Subject: [PATCH 2/6] upd: pyproject.toml comments --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46cef62..44e6eac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "woffu_client" version = "0.0.0" # This will be replaced by the CI pipeline -requires-python = ">=3.10,<3.15" +requires-python = ">=3.10,<3.15" #43 description = "Woffu API client with access to several endpoints." authors = [{name="Marc Palacín Marfil", email="marc.palacin.marfil@gmail.com"}] readme = "README.md" From 1648f7b406a4b4a2cbb0aa3136d227597f69bd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:32:27 +0100 Subject: [PATCH 3/6] fix: test patch compatibility with python 3.14 --- pyproject.toml | 2 +- tests/test_stdrequests_session.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 44e6eac..47e6ff3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "pytest==8.1.1", - "pytest-cov==5.0.0", + "pytest-cov>=6.0.0", "pre-commit==4.3.0" ] diff --git a/tests/test_stdrequests_session.py b/tests/test_stdrequests_session.py index 65aa0a5..91efeb4 100644 --- a/tests/test_stdrequests_session.py +++ b/tests/test_stdrequests_session.py @@ -801,9 +801,8 @@ def read(self): def test_request_defensive_fallback_range_empty(self): """Test defensive fallback on requests.""" - # Save original range for later restoration import builtins - + # Save original range for later restoration original_range = builtins.range # Define a local 'range' that yields nothing @@ -814,7 +813,6 @@ def empty_range(*args, **kwargs): try: # Override builtins.range locally inside this test builtins.range = empty_range - with self.assertRaises(RuntimeError): self.session.request("GET", "https://example.com") finally: From 126df9082e11341a80eac9815b9736f6595d4d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:47:14 +0100 Subject: [PATCH 4/6] fix: new builtin patch for test --- tests/test_stdrequests_session.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/test_stdrequests_session.py b/tests/test_stdrequests_session.py index 91efeb4..e060e2e 100644 --- a/tests/test_stdrequests_session.py +++ b/tests/test_stdrequests_session.py @@ -801,23 +801,9 @@ def read(self): def test_request_defensive_fallback_range_empty(self): """Test defensive fallback on requests.""" - import builtins - # Save original range for later restoration - original_range = builtins.range - - # Define a local 'range' that yields nothing - # to simulate empty retry loop - def empty_range(*args, **kwargs): - return iter(()) - - try: - # Override builtins.range locally inside this test - builtins.range = empty_range + with patch('builtins.range', return_value=iter(())): with self.assertRaises(RuntimeError): self.session.request("GET", "https://example.com") - finally: - # Restore original range - builtins.range = original_range def test_http_error_with_other_codes(self) -> None: """Test HTTPError status codes.""" From 7618e0eff13ae90283a304a930fc8900ccc406fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 15:13:07 +0100 Subject: [PATCH 5/6] fix: missing builtins import --- tests/test_stdrequests_session.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_stdrequests_session.py b/tests/test_stdrequests_session.py index e060e2e..defcca6 100644 --- a/tests/test_stdrequests_session.py +++ b/tests/test_stdrequests_session.py @@ -801,6 +801,8 @@ def read(self): def test_request_defensive_fallback_range_empty(self): """Test defensive fallback on requests.""" + import builtins # noqa:F401 + with patch('builtins.range', return_value=iter(())): with self.assertRaises(RuntimeError): self.session.request("GET", "https://example.com") From ed2c1a4cc7caae84bb445f74d7ad992b930c7adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Palac=C3=ADn?= <19353116+ProtossGP32@users.noreply.github.com> Date: Wed, 4 Feb 2026 15:39:15 +0100 Subject: [PATCH 6/6] fix: request empty retries test --- src/woffu_client/stdrequests_session.py | 2 ++ tests/test_stdrequests_session.py | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/woffu_client/stdrequests_session.py b/src/woffu_client/stdrequests_session.py index ba96fd8..80205f1 100644 --- a/src/woffu_client/stdrequests_session.py +++ b/src/woffu_client/stdrequests_session.py @@ -300,6 +300,7 @@ def _send_request( ) -> HTTPResponse: """Perform the HTTP request with retries and return HTTPResponse.""" last_exc: Optional[Exception] = None + for attempt in range(retries): try: req = urllib.request.Request( @@ -326,6 +327,7 @@ def _send_request( continue raise last_exc + # This should never be reached due to the logic above raise RuntimeError( "Request failed unexpectedly without raising an exception", ) diff --git a/tests/test_stdrequests_session.py b/tests/test_stdrequests_session.py index defcca6..f3484fd 100644 --- a/tests/test_stdrequests_session.py +++ b/tests/test_stdrequests_session.py @@ -799,13 +799,10 @@ def read(self): finally: self.session.opener.open = original_open - def test_request_defensive_fallback_range_empty(self): + def test_request_defensive_fallback_retries_empty(self): """Test defensive fallback on requests.""" - import builtins # noqa:F401 - - with patch('builtins.range', return_value=iter(())): - with self.assertRaises(RuntimeError): - self.session.request("GET", "https://example.com") + with self.assertRaises(RuntimeError): + self.session.request("GET", "https://example.com", retries=0) def test_http_error_with_other_codes(self) -> None: """Test HTTPError status codes."""