From 6b16a86c87e73d768cfc95e14a9e41035aa4473c Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 2 Jun 2026 23:13:53 +0000 Subject: [PATCH 1/4] python3Packages.graphite-web: add setuptools build-system Assisted-by: Claude:opus-4.8 --- pkgs/development/python-modules/graphite-web/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix index 05c0c0d745e82..f9b7ab769830d 100644 --- a/pkgs/development/python-modules/graphite-web/default.nix +++ b/pkgs/development/python-modules/graphite-web/default.nix @@ -5,6 +5,9 @@ buildPythonPackage, fetchFromGitHub, + # build-system + setuptools, + # dependencies cairocffi, django, @@ -54,6 +57,8 @@ buildPythonPackage { --replace-fail "test_render_view" "_dont_test_render_view" ''; + build-system = [ setuptools ]; + dependencies = [ cairocffi django From 40607652611853cc32c2eb55d13bbbe5c4cc4287 Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 2 Jun 2026 23:14:13 +0000 Subject: [PATCH 2/4] python3Packages.graphite-web: 1.1.10-unstable-2025-02-24 -> 1.2.1-pre2 Assisted-by: Claude:opus-4.8 --- pkgs/development/python-modules/graphite-web/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix index f9b7ab769830d..37cba6e8e2508 100644 --- a/pkgs/development/python-modules/graphite-web/default.nix +++ b/pkgs/development/python-modules/graphite-web/default.nix @@ -34,14 +34,14 @@ buildPythonPackage { pname = "graphite-web"; - version = "1.1.10-unstable-2025-02-24"; + version = "1.2.1-pre2"; pyproject = true; src = fetchFromGitHub { owner = "graphite-project"; repo = "graphite-web"; - rev = "49c28e2015d605ad9ec93524f7076dd924a4731a"; - hash = "sha256-TxsQPhnI5WhQvKKkDEYZ8xnyg/qf+N9Icej6d6A0jC0="; + tag = "1.2.1-pre2"; + hash = "sha256-2C5iWn5/BoX0OPT/UQO94V1oZ/xiRzgoipp0551dnpM="; }; postPatch = '' From 0cc51be2414f75a67d920a5c22d4b6e8a069a943 Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Wed, 3 Jun 2026 00:15:29 +0000 Subject: [PATCH 3/4] python3Packages.graphite-web: fix test in Django 5 Assisted-by: Claude:opus-4.8 --- .../python-modules/graphite-web/default.nix | 6 ++++++ .../epoch-django5-localize-via-pytz.patch | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/development/python-modules/graphite-web/epoch-django5-localize-via-pytz.patch diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix index 37cba6e8e2508..654b3fe7126ea 100644 --- a/pkgs/development/python-modules/graphite-web/default.nix +++ b/pkgs/development/python-modules/graphite-web/default.nix @@ -4,6 +4,7 @@ pkgs, buildPythonPackage, fetchFromGitHub, + fetchpatch, # build-system setuptools, @@ -44,6 +45,11 @@ buildPythonPackage { hash = "sha256-2C5iWn5/BoX0OPT/UQO94V1oZ/xiRzgoipp0551dnpM="; }; + patches = [ + # https://github.com/graphite-project/graphite-web/pull/2914 + ./epoch-django5-localize-via-pytz.patch + ]; + postPatch = '' substituteInPlace webapp/graphite/settings.py \ --replace-fail \ diff --git a/pkgs/development/python-modules/graphite-web/epoch-django5-localize-via-pytz.patch b/pkgs/development/python-modules/graphite-web/epoch-django5-localize-via-pytz.patch new file mode 100644 index 0000000000000..a58abbd376d91 --- /dev/null +++ b/pkgs/development/python-modules/graphite-web/epoch-django5-localize-via-pytz.patch @@ -0,0 +1,13 @@ +diff --git a/webapp/graphite/util.py b/webapp/graphite/util.py +index bb46fa16c..7152cb765 100644 +--- a/webapp/graphite/util.py ++++ b/webapp/graphite/util.py +@@ -59,7 +59,7 @@ def epoch(dt): + if not dt.tzinfo: + tb = traceback.extract_stack(None, 2) + log.warning('epoch() called with non-timezone-aware datetime in %s at %s:%d' % (tb[0][2], tb[0][0], tb[0][1])) +- return calendar.timegm(make_aware(dt, pytz.timezone(settings.TIME_ZONE)).astimezone(pytz.utc).timetuple()) ++ return calendar.timegm(pytz.timezone(settings.TIME_ZONE).localize(dt, is_dst=None).astimezone(pytz.utc).timetuple()) + return calendar.timegm(dt.astimezone(pytz.utc).timetuple()) + + From 59a8fc346afd547319b2f8ef1847edad8f4c9026 Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 2 Jun 2026 22:09:14 -0400 Subject: [PATCH 4/4] python3Packages.graphite-web: fix for concurrent Darwin builds Assisted-by: Claude:opus-4.8 --- pkgs/development/python-modules/graphite-web/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix index 654b3fe7126ea..7a78a8f271a49 100644 --- a/pkgs/development/python-modules/graphite-web/default.nix +++ b/pkgs/development/python-modules/graphite-web/default.nix @@ -100,9 +100,12 @@ buildPythonPackage { ]; preCheck = - # Start a redis server + # Start a redis server on a per-build port. Darwin builds share the host + # network (no netns isolation), so concurrent builds would otherwise + # collide on the default port 6379. test_redis_tagdb reads TEST_REDIS_PORT. '' - ${pkgs.valkey}/bin/redis-server & + export TEST_REDIS_PORT=$(( ($$ % 20000) + 20000 )) + ${pkgs.valkey}/bin/redis-server --port "$TEST_REDIS_PORT" & REDIS_PID=$! '';