From 1ecbd6907151aa5a09ca8897a303793b1e94e069 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Jun 2024 17:06:25 +0300 Subject: [PATCH 1/5] python312Packages.flexcache: init at 0.3 --- .../python-modules/flexcache/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/python-modules/flexcache/default.nix diff --git a/pkgs/development/python-modules/flexcache/default.nix b/pkgs/development/python-modules/flexcache/default.nix new file mode 100644 index 000000000000..1442940ca199 --- /dev/null +++ b/pkgs/development/python-modules/flexcache/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + typing-extensions, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "flexcache"; + version = "0.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "hgrecco"; + repo = "flexcache"; + rev = "refs/tags/${version}"; + hash = "sha256-MAbTe7NxzfRPzo/Wnb5SnPJvJWf6zVeYsaw/g9OJYSE="; + }; + + build-system = [ setuptools-scm ]; + + dependencies = [ typing-extensions ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "flexcache" ]; + + meta = { + description = "An robust and extensible package to cache on disk the result of expensive calculations"; + homepage = "https://github.com/hgrecco/flexcache"; + changelog = "https://github.com/hgrecco/flexcache/blob/${src.rev}/CHANGES"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 95ab04200e21..8e08554c0779 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4432,6 +4432,8 @@ self: super: with self; { flet-runtime = callPackage ../development/python-modules/flet-runtime { }; + flexcache = callPackage ../development/python-modules/flexcache { }; + flexmock = callPackage ../development/python-modules/flexmock { }; flickrapi = callPackage ../development/python-modules/flickrapi { }; From 0b8fdadfa273eb849172895d6c20f2b3caadf795 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Jun 2024 17:12:29 +0300 Subject: [PATCH 2/5] python312Packages.flexparser: init at 0.3.1 --- .../python-modules/flexparser/default.nix | 37 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 39 insertions(+) create mode 100644 pkgs/development/python-modules/flexparser/default.nix diff --git a/pkgs/development/python-modules/flexparser/default.nix b/pkgs/development/python-modules/flexparser/default.nix new file mode 100644 index 000000000000..b0ec855ed229 --- /dev/null +++ b/pkgs/development/python-modules/flexparser/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools-scm, + typing-extensions, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "flexparser"; + version = "0.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "hgrecco"; + repo = "flexparser"; + rev = "refs/tags/${version}"; + hash = "sha256-9ImG8uh1SZ+pAbqzWBkTVn+3EBAGzzdP8vqqP59IgIw="; + }; + + build-system = [ setuptools-scm ]; + + dependencies = [ typing-extensions ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "flexparser" ]; + + meta = { + description = "Parsing made fun ... using typing"; + homepage = "https://github.com/hgrecco/flexparser"; + changelog = "https://github.com/hgrecco/flexparser/blob/${src.rev}/CHANGES"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8e08554c0779..31ca4b89a5f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4434,6 +4434,8 @@ self: super: with self; { flexcache = callPackage ../development/python-modules/flexcache { }; + flexparser = callPackage ../development/python-modules/flexparser { }; + flexmock = callPackage ../development/python-modules/flexmock { }; flickrapi = callPackage ../development/python-modules/flickrapi { }; From 12844b0068dd2bd76f887214af0c546dc581c47e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Jun 2024 17:24:11 +0300 Subject: [PATCH 3/5] python312Packages.uncertainties: 3.1.7 -> 3.2.1 --- .../python-modules/uncertainties/default.nix | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/uncertainties/default.nix b/pkgs/development/python-modules/uncertainties/default.nix index a098bb8c4534..db120296a24f 100644 --- a/pkgs/development/python-modules/uncertainties/default.nix +++ b/pkgs/development/python-modules/uncertainties/default.nix @@ -1,31 +1,32 @@ { lib, buildPythonPackage, - fetchPypi, - future, + setuptools-scm, + fetchFromGitHub, + pytestCheckHook, numpy, - pynose, }: buildPythonPackage rec { pname = "uncertainties"; - version = "3.1.7"; - format = "setuptools"; + version = "3.2.1"; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-gBEeCDnyOcWyM8tHcgF7SDoLehVzpYG5Krd0ajXm+qs="; + src = fetchFromGitHub { + owner = "lmfit"; + repo = "uncertainties"; + rev = "refs/tags/${version}"; + hash = "sha256-AaFazHeq7t4DnG2s9GvmAJ3ni62PWHR//mNPL+WyGSI="; }; - propagatedBuildInputs = [ future ]; - nativeCheckInputs = [ - pynose - numpy + nativeBuildInputs = [ + setuptools-scm ]; - checkPhase = '' - nosetests -sve test_1to2 - ''; + nativeCheckInputs = [ + pytestCheckHook + numpy + ]; meta = with lib; { homepage = "https://pythonhosted.org/uncertainties/"; From 3c69550446db39f18559ef46cb78f671ab41a866 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Jun 2024 17:16:14 +0300 Subject: [PATCH 4/5] python311Packages.pint: 0.23 -> 0.24 Switched to fetchFromGitHub, because upstream didn't add a release to pypi, only on GitHub. --- .../python-modules/pint/default.nix | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/pint/default.nix b/pkgs/development/python-modules/pint/default.nix index 30d02f2058b8..f9f4f80d5d25 100644 --- a/pkgs/development/python-modules/pint/default.nix +++ b/pkgs/development/python-modules/pint/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, pythonOlder, # build-system @@ -10,6 +10,9 @@ # propagates typing-extensions, + appdirs, + flexcache, + flexparser, # tests pytestCheckHook, @@ -22,15 +25,16 @@ buildPythonPackage rec { pname = "pint"; - version = "0.23"; + version = "0.24"; format = "pyproject"; disabled = pythonOlder "3.6"; - src = fetchPypi { - inherit version; - pname = "Pint"; - hash = "sha256-4VCbkWBtvFJSfGAKTvdP+sEv/3Boiv8g6QckCTRuybQ="; + src = fetchFromGitHub { + owner = "hgrecco"; + repo = "pint"; + rev = "refs/tags/${version}"; + hash = "sha256-zMcLC3SSl/W7+xX4ah3ZV7fN/LIGJzatqH4MNK8/fec="; }; nativeBuildInputs = [ @@ -38,7 +42,12 @@ buildPythonPackage rec { setuptools-scm ]; - propagatedBuildInputs = [ typing-extensions ]; + propagatedBuildInputs = [ + appdirs + flexcache + flexparser + typing-extensions + ]; nativeCheckInputs = [ pytestCheckHook @@ -55,13 +64,6 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - disabledTests = [ - # https://github.com/hgrecco/pint/issues/1898 - "test_load_definitions_stage_2" - # pytest8 deprecation - "test_nonnumeric_magnitudes" - ]; - meta = with lib; { changelog = "https://github.com/hgrecco/pint/blob/${version}/CHANGES"; description = "Physical quantities module"; From 45e59249d67b92873cadac0744403eac3c66a6ea Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 14 Jun 2024 17:21:19 +0300 Subject: [PATCH 5/5] python311Packages.pint: fix pint-convert executable By propagating numpy and uncertainties inputs. --- pkgs/development/python-modules/pint/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pint/default.nix b/pkgs/development/python-modules/pint/default.nix index f9f4f80d5d25..178e738ed165 100644 --- a/pkgs/development/python-modules/pint/default.nix +++ b/pkgs/development/python-modules/pint/default.nix @@ -47,15 +47,18 @@ buildPythonPackage rec { flexcache flexparser typing-extensions + # Both uncertainties and numpy are not necessarily needed for every + # function of pint, but needed for the pint-convert executable which we + # necessarily distribute with this package as it is. + uncertainties + numpy ]; nativeCheckInputs = [ pytestCheckHook pytest-subtests pytest-benchmark - numpy matplotlib - uncertainties ]; pytestFlagsArray = [ "--benchmark-disable" ];