From eec6c0ef265e7a34c1e969d126ae659f37e747bc Mon Sep 17 00:00:00 2001 From: natsukium Date: Mon, 16 Oct 2023 18:09:44 +0900 Subject: [PATCH 1/2] python311Packages.openant: 2017-02-11 -> 1.2.1 Diff: https://github.com/Tigge/openant/compare/ed89281e37f65d768641e87356cef38877952397...v1.2.1 --- .../python-modules/openant/default.nix | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/openant/default.nix b/pkgs/development/python-modules/openant/default.nix index 71f699e0552a..7a2949264d3c 100644 --- a/pkgs/development/python-modules/openant/default.nix +++ b/pkgs/development/python-modules/openant/default.nix @@ -1,29 +1,29 @@ { lib , buildPythonPackage , fetchFromGitHub +, setuptools , pyusb }: -buildPythonPackage { +buildPythonPackage rec { pname = "openant-unstable"; - version = "2017-02-11"; + version = "1.2.1"; + pyproject = true; src = fetchFromGitHub { owner = "Tigge"; repo = "openant"; - rev = "ed89281e37f65d768641e87356cef38877952397"; - sha256 = "1g81l9arqdy09ijswn3sp4d6i3z18d44lzyb78bwnvdb14q22k19"; + rev = "refs/tags/v${version}"; + hash = "sha256-Ook9dwcyWvpaGylVDjBxQ2bnXRUBPYQHo6Wub+ISpwE="; }; - # Removes some setup.py hacks intended to install udev rules. - # We do the job ourselves in postInstall below. - postPatch = '' - sed -i -e '/cmdclass=.*/d' setup.py - ''; + nativeBuildInputs = [ + setuptools + ]; postInstall = '' install -dm755 "$out/etc/udev/rules.d" - install -m644 resources/ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules" + install -m644 resources/42-ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules" ''; propagatedBuildInputs = [ pyusb ]; From d3201462f95b91fe2d4ec45f124e1748146d76b9 Mon Sep 17 00:00:00 2001 From: natsukium Date: Tue, 17 Oct 2023 15:45:24 +0900 Subject: [PATCH 2/2] python311Packages.openant: enable tests and add optional-dependencies --- .../python-modules/openant/default.nix | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/openant/default.nix b/pkgs/development/python-modules/openant/default.nix index 7a2949264d3c..ed142826160b 100644 --- a/pkgs/development/python-modules/openant/default.nix +++ b/pkgs/development/python-modules/openant/default.nix @@ -1,8 +1,12 @@ { lib , buildPythonPackage , fetchFromGitHub +, pythonOlder , setuptools , pyusb +, influxdb-client +, pyserial +, pytestCheckHook }: buildPythonPackage rec { @@ -10,6 +14,8 @@ buildPythonPackage rec { version = "1.2.1"; pyproject = true; + disabled = pythonOlder "3.7"; + src = fetchFromGitHub { owner = "Tigge"; repo = "openant"; @@ -28,11 +34,27 @@ buildPythonPackage rec { propagatedBuildInputs = [ pyusb ]; + passthru.optional-dependencies = { + serial = [ + pyserial + ]; + influx = [ + influxdb-client + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "openant" + ]; + meta = with lib; { homepage = "https://github.com/Tigge/openant"; description = "ANT and ANT-FS Python Library"; license = licenses.mit; - platforms = platforms.unix; }; }