diff --git a/pkgs/development/python-modules/aiogram/default.nix b/pkgs/development/python-modules/aiogram/default.nix index a33cdb451779..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,12 +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"; @@ -29,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 = [ @@ -50,17 +54,20 @@ 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" ]; + passthru.updateScript = gitUpdater { }; + meta = with lib; { description = "Modern and fully asynchronous framework for Telegram Bot API"; homepage = "https://github.com/aiogram/aiogram"; 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 ];