From 1951dc2f1fb4e90198ee7f2795de6b29190762aa Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 10 Jan 2025 22:55:55 +0900 Subject: [PATCH 1/2] python312Packages.periodictable: 1.7.1 -> 2.0.2 Diff: https://github.com/python-periodictable/periodictable/compare/refs/tags/v1.7.1...v2.0.2 --- .../python-modules/periodictable/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/periodictable/default.nix b/pkgs/development/python-modules/periodictable/default.nix index 31b5b0a4500f..5e6c229c2f7b 100644 --- a/pkgs/development/python-modules/periodictable/default.nix +++ b/pkgs/development/python-modules/periodictable/default.nix @@ -1,6 +1,6 @@ { lib, - fetchPypi, + fetchFromGitHub, buildPythonPackage, numpy, pyparsing, @@ -10,14 +10,16 @@ buildPythonPackage rec { pname = "periodictable"; - version = "1.7.1"; + version = "2.0.2"; format = "setuptools"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-Q9fbcjPWszli+D156lT0fDuSPT6DQDy8A/WPNTr0tSw="; + src = fetchFromGitHub { + owner = "python-periodictable"; + repo = "periodictable"; + tag = "v${version}"; + hash = "sha256-nI6hiLnqmVXT06pPkHCBEMTxZhfnZJqSImW3V9mJ4+8="; }; propagatedBuildInputs = [ From 4f96879c9d8bebd35ddc1a78886d6a4da55fb015 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 10 Jan 2025 23:03:43 +0900 Subject: [PATCH 2/2] python312Packages.periodictable: refactor --- .../python-modules/periodictable/default.nix | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/periodictable/default.nix b/pkgs/development/python-modules/periodictable/default.nix index 5e6c229c2f7b..1bde32797813 100644 --- a/pkgs/development/python-modules/periodictable/default.nix +++ b/pkgs/development/python-modules/periodictable/default.nix @@ -2,8 +2,10 @@ lib, fetchFromGitHub, buildPythonPackage, + setuptools, numpy, pyparsing, + pytest-cov-stub, pytestCheckHook, pythonOlder, }: @@ -11,9 +13,9 @@ buildPythonPackage rec { pname = "periodictable"; version = "2.0.2"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "python-periodictable"; @@ -22,19 +24,24 @@ buildPythonPackage rec { hash = "sha256-nI6hiLnqmVXT06pPkHCBEMTxZhfnZJqSImW3V9mJ4+8="; }; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ numpy pyparsing ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytest-cov-stub + pytestCheckHook + ]; pythonImportsCheck = [ "periodictable" ]; - meta = with lib; { + meta = { description = "Extensible periodic table of the elements"; homepage = "https://github.com/pkienzle/periodictable"; - license = licenses.publicDomain; - maintainers = with maintainers; [ rprospero ]; + license = lib.licenses.publicDomain; + maintainers = with lib.maintainers; [ rprospero ]; }; }