From e9e88644dc56174fa0d709ade90c24769cebff86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 29 Dec 2023 23:53:53 -0500 Subject: [PATCH 1/3] python3Packages.magic-filter: report correct version in WHEEL --- pkgs/development/python-modules/magic-filter/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/magic-filter/default.nix b/pkgs/development/python-modules/magic-filter/default.nix index e9d2fb8b8696..8b4cc8068965 100644 --- a/pkgs/development/python-modules/magic-filter/default.nix +++ b/pkgs/development/python-modules/magic-filter/default.nix @@ -20,6 +20,11 @@ buildPythonPackage rec { hash = "sha256-MSYIZ/bzngRu6mG3EGblUotSCA+6bi+l3EymFA8NRZA="; }; + postPatch = '' + substituteInPlace magic_filter/__init__.py \ + --replace '"1"' '"${version}"' + ''; + nativeBuildInputs = [ hatchling ]; From 356d12c562c021ad6e1d097364ce34e57a727760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 29 Dec 2023 23:55:17 -0500 Subject: [PATCH 2/3] python3Packages.aiogram: add passthru.updateScript --- pkgs/development/python-modules/aiogram/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/aiogram/default.nix b/pkgs/development/python-modules/aiogram/default.nix index a33cdb451779..1f244ac054f5 100644 --- a/pkgs/development/python-modules/aiogram/default.nix +++ b/pkgs/development/python-modules/aiogram/default.nix @@ -13,6 +13,7 @@ , pytest-asyncio , pytest-lazy-fixture , redis +, gitUpdater }: buildPythonPackage rec { @@ -61,6 +62,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "aiogram" ]; + passthru.updateScript = gitUpdater { }; + meta = with lib; { description = "Modern and fully asynchronous framework for Telegram Bot API"; homepage = "https://github.com/aiogram/aiogram"; From 5ae05cc9e7560087be47584be9892a76196b7167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sat, 30 Dec 2023 00:16:13 -0500 Subject: [PATCH 3/3] python3Packages.aiogram: fix build --- .../python-modules/aiogram/default.nix | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/aiogram/default.nix b/pkgs/development/python-modules/aiogram/default.nix index 1f244ac054f5..0dc72bc2006a 100644 --- a/pkgs/development/python-modules/aiogram/default.nix +++ b/pkgs/development/python-modules/aiogram/default.nix @@ -6,6 +6,7 @@ , aiohttp , aiohttp-socks , aioredis +, aiofiles , aresponses , babel , certifi @@ -13,13 +14,16 @@ , pytest-asyncio , pytest-lazy-fixture , redis +, hatchling +, pydantic +, pytz , gitUpdater }: buildPythonPackage rec { pname = "aiogram"; version = "3.2.0"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -30,18 +34,17 @@ buildPythonPackage rec { hash = "sha256-8SYrg+gfNSTR0CTPf4cYDa4bfA0LPBmZtPcATF22fqw="; }; - postPatch = '' - substituteInPlace setup.py \ - --replace "aiohttp>=3.8.0,<3.9.0" "aiohttp" \ - --replace "Babel>=2.9.1,<2.10.0" "Babel" \ - --replace "magic-filter>=1.0.9" "magic-filter" - ''; + nativeBuildInputs = [ + hatchling + ]; propagatedBuildInputs = [ + aiofiles aiohttp babel certifi magic-filter + pydantic ]; nativeCheckInputs = [ @@ -51,13 +54,14 @@ buildPythonPackage rec { pytest-asyncio pytest-lazy-fixture pytestCheckHook + pytz redis ]; - # requires network + # import failures disabledTests = [ - "test_download_file_404" - "test_download_404" + "test_aiohtt_server" + "test_deep_linking" ]; pythonImportsCheck = [ "aiogram" ];