about summary refs log tree commit diff
path: root/pkgs/development/python-modules/autoslot/default.nix
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2023-09-10 17:51:14 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2023-09-10 17:51:14 +0200
commitc8d03f8a7e956e65b56c4d300c2bfb0f1f17e2a0 (patch)
treee4934a7f6099548ff81bfa6314298a64687850df /pkgs/development/python-modules/autoslot/default.nix
parent6fed5bcac6303255fb6ba01a070f4ef506943742 (diff)
python311Packages.autoslot: ini at 2022.12.1
Diffstat (limited to 'pkgs/development/python-modules/autoslot/default.nix')
-rw-r--r--pkgs/development/python-modules/autoslot/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/autoslot/default.nix b/pkgs/development/python-modules/autoslot/default.nix
new file mode 100644
index 0000000000000..c234b35e0e585
--- /dev/null
+++ b/pkgs/development/python-modules/autoslot/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, flit-core
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "autoslot";
+  version = "2022.12.1";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "cjrh";
+    repo = "autoslot";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-fG4rRwRubJt2aXChEsMybEKal6LscZI7GA2uwtK5Vtg=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace 'requires = ["flit"]' 'requires = ["flit_core"]' \
+      --replace 'build-backend = "flit.buildapi"' 'build-backend = "flit_core.buildapi"'
+  '';
+
+  nativeBuildInputs = [
+    flit-core
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "autoslot"
+  ];
+
+  meta = with lib; {
+    description = "Automatic __slots__ for your Python classes";
+    homepage = "https://github.com/cjrh/autoslot";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}