about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2024-06-30 00:01:53 +0300
committerGitHub <noreply@github.com>2024-06-30 00:01:53 +0300
commit0833561d8222daff01ad752332471b6fa99cecde (patch)
tree50b197c06ad527a8f5bad34d797cc3d3e38ccefe /pkgs
parent4f23d940ce7df84989dd56d8301b2b7bc6aa3efc (diff)
parent45e59249d67b92873cadac0744403eac3c66a6ea (diff)
Merge pull request #320113 from doronbehar/pkg/python-pint
python311Packages.pint: fix pint-convert executable
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/flexcache/default.nix37
-rw-r--r--pkgs/development/python-modules/flexparser/default.nix37
-rw-r--r--pkgs/development/python-modules/pint/default.nix37
-rw-r--r--pkgs/development/python-modules/uncertainties/default.nix29
-rw-r--r--pkgs/top-level/python-packages.nix4
5 files changed, 114 insertions, 30 deletions
diff --git a/pkgs/development/python-modules/flexcache/default.nix b/pkgs/development/python-modules/flexcache/default.nix
new file mode 100644
index 0000000000000..1442940ca199f
--- /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/development/python-modules/flexparser/default.nix b/pkgs/development/python-modules/flexparser/default.nix
new file mode 100644
index 0000000000000..b0ec855ed2299
--- /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/development/python-modules/pint/default.nix b/pkgs/development/python-modules/pint/default.nix
index 30d02f2058b87..178e738ed1655 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,15 +42,23 @@ buildPythonPackage rec {
     setuptools-scm
   ];
 
-  propagatedBuildInputs = [ typing-extensions ];
+  propagatedBuildInputs = [
+    appdirs
+    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" ];
@@ -55,13 +67,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";
diff --git a/pkgs/development/python-modules/uncertainties/default.nix b/pkgs/development/python-modules/uncertainties/default.nix
index a098bb8c45348..db120296a24f0 100644
--- a/pkgs/development/python-modules/uncertainties/default.nix
+++ b/pkgs/development/python-modules/uncertainties/default.nix
@@ -1,32 +1,33 @@
 {
   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 ];
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
   nativeCheckInputs = [
-    pynose
+    pytestCheckHook
     numpy
   ];
 
-  checkPhase = ''
-    nosetests -sve test_1to2
-  '';
-
   meta = with lib; {
     homepage = "https://pythonhosted.org/uncertainties/";
     description = "Transparent calculations with uncertainties on the quantities involved (aka error propagation)";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 17bc295d63f01..6b165d64e4eb8 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -4457,6 +4457,10 @@ self: super: with self; {
 
   flet-runtime = callPackage ../development/python-modules/flet-runtime { };
 
+  flexcache = callPackage ../development/python-modules/flexcache { };
+
+  flexparser = callPackage ../development/python-modules/flexparser { };
+
   flexmock = callPackage ../development/python-modules/flexmock { };
 
   flickrapi = callPackage ../development/python-modules/flickrapi { };