about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2024-05-11 22:25:48 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2024-05-11 22:25:48 +0200
commit577710d5ef46acb7f7542bb74b44ed5ccba2be7d (patch)
tree420e66bccf6f9cee06d2474e7bbafa9bd6fa82cb /pkgs
parent3e6c1b075ca3ed8e414a4006f70857cf0b37ae7e (diff)
python312Packages.courlan: refactor
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/courlan/default.nix29
1 files changed, 17 insertions, 12 deletions
diff --git a/pkgs/development/python-modules/courlan/default.nix b/pkgs/development/python-modules/courlan/default.nix
index 4320836769aa8..eeb822e939deb 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";
   };
 }