diff --git a/pkgs/by-name/mn/mnamer/fix-requests-cache-version-check.patch b/pkgs/by-name/mn/mnamer/fix-requests-cache-version-check.patch new file mode 100644 index 000000000000..2a29976187d0 --- /dev/null +++ b/pkgs/by-name/mn/mnamer/fix-requests-cache-version-check.patch @@ -0,0 +1,33 @@ +From 634d56361e967adcd81c3cb839458d3aea99e5db Mon Sep 17 00:00:00 2001 +From: Skid <26208369+skid9000@users.noreply.github.com> +Date: Sun, 22 Feb 2026 20:28:03 +0100 +Subject: [PATCH] Fix requests_cache version check for 1.3.0 + +Using the same method provided here : https://github.com/requests-cache/requests-cache/commit/61fae61e07222777eb26a6fb670c4ee6a9cdddb7 +--- + mnamer/const.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/mnamer/const.py b/mnamer/const.py +index 66510ebf..bf321f41 100644 +--- a/mnamer/const.py ++++ b/mnamer/const.py +@@ -4,6 +4,7 @@ + from pathlib import Path + from platform import platform, python_version + from sys import argv, gettrace, version_info ++from importlib.metadata import version as pkg_version, PackageNotFoundError + + VERSION: str + +@@ -37,8 +38,8 @@ + requests_version = "N/A" + + try: +- from requests_cache import __version__ as requests_cache_version +-except ModuleNotFoundError: ++ requests_cache_version = pkg_version('requests_cache') ++except PackageNotFoundError: + requests_cache_version = "N/A" + + try: diff --git a/pkgs/by-name/mn/mnamer/package.nix b/pkgs/by-name/mn/mnamer/package.nix index d80ae16df58e..e4196ee96fbb 100644 --- a/pkgs/by-name/mn/mnamer/package.nix +++ b/pkgs/by-name/mn/mnamer/package.nix @@ -35,6 +35,8 @@ python3Packages.buildPythonApplication (finalAttrs: { patches = [ # https://github.com/jkwill87/mnamer/pull/291 ./cached_session_error.patch + # https://github.com/jkwill87/mnamer/pull/333 + ./fix-requests-cache-version-check.patch ]; nativeCheckInputs = [ python3Packages.pytestCheckHook ]; diff --git a/pkgs/by-name/op/open-web-calendar/package.nix b/pkgs/by-name/op/open-web-calendar/package.nix index 7ea2c1781495..b63ad48acbd2 100644 --- a/pkgs/by-name/op/open-web-calendar/package.nix +++ b/pkgs/by-name/op/open-web-calendar/package.nix @@ -12,13 +12,13 @@ let in python.pkgs.buildPythonApplication (finalAttrs: { pname = "open-web-calendar"; - version = "1.49"; + version = "1.51"; pyproject = true; src = fetchPypi { inherit (finalAttrs) version; pname = "open_web_calendar"; - hash = "sha256-vtmIqiF85zn8CiMUWsCKJUzfiiK/j+xlZIyuIMGxR4I="; + hash = "sha256-r+7ZKdNOhjnjE1MBNAkni4Rrpx4DMRhUaP1Mmk5wzOo="; }; # The Pypi tarball doesn't contain open_web_calendars/features @@ -39,7 +39,6 @@ python.pkgs.buildPythonApplication (finalAttrs: { dependencies = with python.pkgs; [ - flask-caching flask-allowed-hosts flask icalendar @@ -48,6 +47,7 @@ python.pkgs.buildPythonApplication (finalAttrs: { bcrypt caldav requests + requests-cache pyyaml recurring-ical-events gunicorn @@ -59,7 +59,10 @@ python.pkgs.buildPythonApplication (finalAttrs: { ] ++ requests.optional-dependencies.socks; - nativeCheckInputs = with python.pkgs; [ pytestCheckHook ]; + nativeCheckInputs = with python.pkgs; [ + pytestCheckHook + pytest-responses + ]; enabledTestPaths = [ "open_web_calendar/test" ]; diff --git a/pkgs/development/python-modules/requests-cache/default.nix b/pkgs/development/python-modules/requests-cache/default.nix index 329d359480a0..92d46c37db03 100644 --- a/pkgs/development/python-modules/requests-cache/default.nix +++ b/pkgs/development/python-modules/requests-cache/default.nix @@ -2,14 +2,13 @@ lib, attrs, buildPythonPackage, - bson, + hatchling, boto3, botocore, cattrs, fetchFromGitHub, itsdangerous, platformdirs, - poetry-core, psutil, pymongo, pytestCheckHook, @@ -23,27 +22,27 @@ rich, tenacity, time-machine, - timeout-decorator, ujson, + orjson, urllib3, url-normalize, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "requests-cache"; - version = "1.2.1"; + version = "1.3.1"; pyproject = true; src = fetchFromGitHub { owner = "requests-cache"; repo = "requests-cache"; - tag = "v${version}"; - hash = "sha256-juRCcBUr+Ko6kVPpUapwRbUGqWLKaRiCqppOc3S5FMU="; + tag = "v${finalAttrs.version}"; + hash = "sha256-t9SJ+enZHHYPRXaSrPop2hVOagE4oMnuXExO2DeNttc="; }; - nativeBuildInputs = [ poetry-core ]; + build-system = [ hatchling ]; - propagatedBuildInputs = [ + dependencies = [ attrs cattrs platformdirs @@ -57,12 +56,15 @@ buildPythonPackage rec { boto3 botocore ]; - mongodbo = [ pymongo ]; + mongodb = [ pymongo ]; redis = [ redis ]; - bson = [ bson ]; - json = [ ujson ]; security = [ itsdangerous ]; yaml = [ pyyaml ]; + all = [ + orjson + ujson + ] + ++ lib.concatAttrValues (lib.removeAttrs finalAttrs.optional-dependencies [ "all" ]); }; nativeCheckInputs = [ @@ -75,10 +77,7 @@ buildPythonPackage rec { rich tenacity time-machine - timeout-decorator - ] - ++ optional-dependencies.json - ++ optional-dependencies.security; + ]; preCheck = '' export HOME=$(mktemp -d); @@ -90,11 +89,8 @@ buildPythonPackage rec { ]; disabledTests = [ - # Tests are flaky in the sandbox - "test_remove_expired_responses" - # Tests that broke with urllib 2.0.5 + # Flaky "test_request_only_if_cached__stale_if_error__expired" - "test_stale_if_error__error_code" ]; pythonImportsCheck = [ "requests_cache" ]; @@ -102,8 +98,8 @@ buildPythonPackage rec { meta = { description = "Persistent cache for requests library"; homepage = "https://github.com/reclosedev/requests-cache"; - changelog = "https://github.com/requests-cache/requests-cache/blob/v${version}/HISTORY.md"; + changelog = "https://github.com/requests-cache/requests-cache/blob/$v{finalAttrs.version}/HISTORY.md"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ fab ]; }; -} +})