From 345b20f15fcc1a0544ceb06fbd3d5c23e5533d5d Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Sun, 3 Nov 2024 15:57:07 +0100 Subject: [PATCH] python312Packages.pygreat: 2019.5.1.dev0 -> 2024.0.2 --- .../python-modules/pygreat/default.nix | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/pygreat/default.nix b/pkgs/development/python-modules/pygreat/default.nix index 6f66c9eb5dc7..d10685b810c5 100644 --- a/pkgs/development/python-modules/pygreat/default.nix +++ b/pkgs/development/python-modules/pygreat/default.nix @@ -1,41 +1,59 @@ { lib, buildPythonPackage, - isPy3k, fetchFromGitHub, + setuptools, + pythonOlder, future, pyusb, }: -buildPythonPackage { +buildPythonPackage rec { pname = "pygreat"; - version = "2019.5.1.dev0"; - format = "setuptools"; + version = "2024.0.2"; + pyproject = true; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "greatscottgadgets"; repo = "libgreat"; - rev = "14c00b7c8f036f4d467e4b1a324ffa3566b126fa"; - sha256 = "1h0z83k1k4z8j36z936h61l8j3cjr3wsxr86k91v5c5h93g9dkqh"; + rev = "refs/tags/v${version}"; + hash = "sha256-yYp+2y4QIOykkrObWaXbZMMc2fsRn/+tGWqySA7V534="; }; - propagatedBuildInputs = [ + sourceRoot = "${src.name}/host"; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + pythonRemoveDeps = [ + "backports.functools-lru-cache" + ]; + + dependencies = [ future pyusb ]; - disabled = !isPy3k; + # has no tests + doCheck = false; - preBuild = '' - cd host - substituteInPlace setup.py --replace "'backports.functools_lru_cache'" "" - substituteInPlace pygreat/comms.py --replace "from backports.functools_lru_cache import lru_cache as memoize_with_lru_cache" "from functools import lru_cache as memoize_with_lru_cache" - echo "$version" > ../VERSION - ''; + pythonImportsCheck = [ + "pygreat" + ]; - meta = with lib; { + meta = { + changelog = "https://github.com/greatscottgadgets/libgreat/releases/tag/v${version}"; description = "Python library for talking with libGreat devices"; - homepage = "https://greatscottgadgets.com/greatfet/"; - license = with licenses; [ bsd3 ]; + homepage = "https://github.com/greatscottgadgets/libgreat/"; + license = with lib.licenses; [ bsd3 ]; + maintainers = with lib.maintainers; [ carlossless ]; }; }