about summary refs log tree commit diff
path: root/pkgs/development/python-modules/moreorless/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/moreorless/default.nix')
-rw-r--r--pkgs/development/python-modules/moreorless/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/moreorless/default.nix b/pkgs/development/python-modules/moreorless/default.nix
new file mode 100644
index 0000000000000..8f849b42f1378
--- /dev/null
+++ b/pkgs/development/python-modules/moreorless/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, buildPythonPackage
+, click
+, fetchFromGitHub
+, parameterized
+, pytestCheckHook
+, pythonOlder
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "moreorless";
+  version = "0.4.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "thatch";
+    repo = "moreorless";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-N11iqsxMGgzwW2QYeOoHQaR/aDEuoUnnd/2Mc5culN0=";
+  };
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
+  propagatedBuildInputs = [
+    click
+  ];
+
+  nativeCheckInputs = [
+    parameterized
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "moreorless"
+  ];
+
+  pytestFlagsArray = [
+    "moreorless/tests/click.py"
+    "moreorless/tests/general.py"
+    "moreorless/tests/patch.py"
+  ];
+
+  meta = with lib; {
+    description = "Wrapper to make difflib.unified_diff more fun to use";
+    homepage = "https://github.com/thatch/moreorless/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}