about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pint/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pint/default.nix')
-rw-r--r--pkgs/development/python-modules/pint/default.nix83
1 files changed, 43 insertions, 40 deletions
diff --git a/pkgs/development/python-modules/pint/default.nix b/pkgs/development/python-modules/pint/default.nix
index 9a9029aca062..1339b39505a9 100644
--- a/pkgs/development/python-modules/pint/default.nix
+++ b/pkgs/development/python-modules/pint/default.nix
@@ -1,76 +1,79 @@
-{ lib
-, buildPythonPackage
-, fetchPypi
-, pythonOlder
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  pythonOlder,
 
-# build-system
-, setuptools
-, setuptools-scm
+  # build-system
+  setuptools,
+  setuptools-scm,
 
-# propagates
-, typing-extensions
+  # dependencies
+  appdirs,
+  flexcache,
+  flexparser,
+  typing-extensions,
 
-# tests
-, pytestCheckHook
-, pytest-subtests
-, pytest-benchmark
-, numpy
-, matplotlib
-, uncertainties
+  # tests
+  pytestCheckHook,
+  pytest-subtests,
+  pytest-benchmark,
+  numpy,
+  matplotlib,
+  uncertainties,
 }:
 
 buildPythonPackage rec {
   pname = "pint";
-  version = "0.23";
-  format = "pyproject";
+  version = "0.24.3";
+  pyproject = true;
 
-  disabled = pythonOlder "3.6";
+  disabled = pythonOlder "3.9";
 
-  src = fetchPypi {
-    inherit version;
-    pname = "Pint";
-    hash = "sha256-4VCbkWBtvFJSfGAKTvdP+sEv/3Boiv8g6QckCTRuybQ=";
+  src = fetchFromGitHub {
+    owner = "hgrecco";
+    repo = "pint";
+    rev = "refs/tags/${version}";
+    hash = "sha256-PJEgwshTBIqmKMEro+IT+7v4dab3qD7I45OuTOJloR0=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
     setuptools
     setuptools-scm
   ];
 
-  propagatedBuildInputs = [
+  dependencies = [
+    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"
-  ];
+  pytestFlagsArray = [ "--benchmark-disable" ];
 
   preCheck = ''
     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; {
+  meta = {
     changelog = "https://github.com/hgrecco/pint/blob/${version}/CHANGES";
     description = "Physical quantities module";
     mainProgram = "pint-convert";
-    license = licenses.bsd3;
+    license = lib.licenses.bsd3;
     homepage = "https://github.com/hgrecco/pint/";
-    maintainers = with maintainers; [ doronbehar ];
+    maintainers = with lib.maintainers; [ doronbehar ];
   };
 }