From 577710d5ef46acb7f7542bb74b44ed5ccba2be7d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 11 May 2024 22:25:48 +0200 Subject: [PATCH] python312Packages.courlan: refactor --- .../python-modules/courlan/default.nix | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/courlan/default.nix b/pkgs/development/python-modules/courlan/default.nix index 4320836769aa..eeb822e939de 100644 --- a/pkgs/development/python-modules/courlan/default.nix +++ b/pkgs/development/python-modules/courlan/default.nix @@ -4,15 +4,16 @@ , fetchPypi , langcodes , pytestCheckHook +, pythonOlder +, setuptools , tld , urllib3 -, pythonOlder }: buildPythonPackage rec { pname = "courlan"; version = "1.1.0"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.6"; @@ -21,7 +22,19 @@ buildPythonPackage rec { hash = "sha256-1wZoQzTxi+StofvVfyaArfADZkj22ECFL3pIItOt/Y0="; }; - propagatedBuildInputs = [ + # Tests try to write to /tmp directly. use $TMPDIR instead. + postPatch = '' + substituteInPlace tests/unit_tests.py \ + --replace-fail "\"courlan --help\"" "\"$out/bin/courlan --help\"" \ + --replace-fail "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" \ + --replace-fail "/tmp" "$TMPDIR" + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ babel langcodes tld @@ -37,22 +50,14 @@ buildPythonPackage rec { "test_urlcheck" ]; - # tests try to write to /tmp directly. use $TMPDIR instead. - postPatch = '' - substituteInPlace tests/unit_tests.py \ - --replace "\"courlan --help\"" "\"$out/bin/courlan --help\"" \ - --replace "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" \ - --replace "/tmp" "$TMPDIR" - ''; - pythonImportsCheck = [ "courlan" ]; meta = with lib; { description = "Clean, filter and sample URLs to optimize data collection"; - mainProgram = "courlan"; homepage = "https://github.com/adbar/courlan"; changelog = "https://github.com/adbar/courlan/blob/v${version}/HISTORY.md"; license = licenses.asl20; maintainers = with maintainers; [ jokatzke ]; + mainProgram = "courlan"; }; }