From 96c294e7cacf7158b6f03e82d6f56f79e59c9595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 22 Oct 2023 15:05:06 -0700 Subject: [PATCH] python311Packages.stem: improve expression Also add myself as maintainer. --- .../python-modules/stem/default.nix | 49 +++++++++++++------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/stem/default.nix b/pkgs/development/python-modules/stem/default.nix index 6d9bd653fd912..8cd6ff3f3d6e8 100644 --- a/pkgs/development/python-modules/stem/default.nix +++ b/pkgs/development/python-modules/stem/default.nix @@ -1,32 +1,51 @@ -{ lib, buildPythonPackage, fetchPypi, python, mock }: +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, setuptools +, cryptography +, mock +, python +}: buildPythonPackage rec { pname = "stem"; version = "1.8.2"; - src = fetchPypi { - inherit pname version; - hash = "sha256-g/sZ/9TJ+CIHwAYFFIA4n4CvIhp+R4MACu3sTjhOtYI="; + disabled = pythonOlder "3.6"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "torproject"; + repo = "stem"; + rev = "refs/tags/${version}"; + hash = "sha256-9BXeE/sVa13jr8G060aWjc49zgDVBhjaR6nt4lSxc0g="; }; - postPatch = '' - rm test/unit/installation.py - sed -i "/test.unit.installation/d" test/settings.cfg - # https://github.com/torproject/stem/issues/56 - sed -i '/MOCK_VERSION/d' run_tests.py - ''; + nativeBuildInputs = [ + setuptools + ]; - nativeCheckInputs = [ mock ]; + nativeCheckInputs = [ + cryptography + mock + ]; checkPhase = '' - touch .gitignore - ${python.interpreter} run_tests.py -u + runHook preCheck + + ${python.interpreter} run_tests.py --unit + + runHook postCheck ''; meta = with lib; { + changelog = "https://github.com/torproject/stem/blob/${src.rev}/docs/change_log.rst"; description = "Controller library that allows applications to interact with Tor"; + downloadPage = "https://github.com/torproject/stem"; homepage = "https://stem.torproject.org/"; - license = licenses.gpl3; - maintainers = with maintainers; [ ]; + license = licenses.lgpl3Only; + maintainers = with maintainers; [ dotlambda ]; }; }