From 3733d828401092b50b68c11a5d8bd2a2733663b4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 18 May 2023 20:56:54 +0200 Subject: [PATCH] python311Packages.cypherpunkpay: switch to pythonRelaxDepsHook - disable on unsupported Python releases - relax yoyo-migrations - add pythonImportsCheck - ignore deprecation warning --- .../python-modules/cypherpunkpay/default.nix | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/cypherpunkpay/default.nix b/pkgs/development/python-modules/cypherpunkpay/default.nix index 0ee8de93280..f52fbd02cac 100644 --- a/pkgs/development/python-modules/cypherpunkpay/default.nix +++ b/pkgs/development/python-modules/cypherpunkpay/default.nix @@ -1,25 +1,26 @@ -{ stdenv -, lib -, buildPythonPackage -, fetchFromGitHub -, poetry-core +{ lib +, stdenv , apscheduler , bitstring +, buildPythonPackage , cffi , ecdsa +, fetchFromGitHub , monero +, poetry-core , pypng , pyqrcode , pyramid , pyramid_jinja2 , pysocks +, pytestCheckHook +, pythonOlder +, pythonRelaxDepsHook , requests , tzlocal , waitress -, yoyo-migrations -, pytestCheckHook -, pytest-cov , webtest +, yoyo-migrations }: buildPythonPackage rec { @@ -27,6 +28,8 @@ buildPythonPackage rec { version = "1.0.16"; format = "pyproject"; + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "CypherpunkPay"; repo = "CypherpunkPay"; @@ -34,17 +37,18 @@ buildPythonPackage rec { hash = "sha256-X0DB0PVwR0gRnt3jixFzglWAOPKBMvqTOG6pK6OJ03w="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "bitstring = '^3.1.9'" "bitstring = '>=3.1.9'" \ - --replace 'cffi = "1.15.0"' 'cffi = ">=1.15.0"' \ - --replace 'ecdsa = "^0.17.0"' 'ecdsa = ">=0.17.0"' \ - --replace 'pypng = "^0.0.20"' 'pypng = ">=0.0.20"' \ - --replace 'tzlocal = "2.1"' 'tzlocal = ">=2.1"' - ''; + pythonRelaxDeps = [ + "bitstring" + "cffi" + "ecdsa" + "pypng" + "tzlocal" + "yoyo-migrations" + ]; nativeBuildInputs = [ poetry-core + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -66,10 +70,14 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - pytest-cov webtest ]; + pytestFlagsArray = [ + "-W" + "ignore::DeprecationWarning" + ]; + disabledTestPaths = [ # performance test "tests/unit/tools/pbkdf2_test.py" @@ -94,9 +102,14 @@ buildPythonPackage rec { "tests/acceptance/views_dummystore" ]; + pythonImportsCheck = [ + "cypherpunkpay" + ]; + meta = with lib; { description = "Modern self-hosted software for accepting Bitcoin"; - homepage = "https://cypherpunkpay.org"; + homepage = "https://github.com/CypherpunkPay/CypherpunkPay"; + changelog = "https://github.com/CypherpunkPay/CypherpunkPay/releases/tag/v${version}"; license = with licenses; [ mit /* or */ unlicense ]; maintainers = with maintainers; [ prusnak ]; };