2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-07-01 15:47:52 +00:00
|
|
|
fetchFromGitHub,
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonOlder,
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
# dependencies
|
2024-07-01 15:47:52 +00:00
|
|
|
appdirs,
|
|
|
|
flexcache,
|
|
|
|
flexparser,
|
2024-07-27 06:49:29 +00:00
|
|
|
typing-extensions,
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-subtests,
|
|
|
|
pytest-benchmark,
|
|
|
|
numpy,
|
|
|
|
matplotlib,
|
|
|
|
uncertainties,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pint";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.24.1";
|
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hgrecco";
|
|
|
|
repo = "pint";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-PQAQvjMi7pFgNhUbw20vc306aTyEbCQNHGef/pxxpXo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [
|
2023-08-10 07:59:29 +00:00
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [
|
2024-07-01 15:47:52 +00:00
|
|
|
appdirs
|
|
|
|
flexcache
|
|
|
|
flexparser
|
|
|
|
typing-extensions
|
2024-07-27 06:49:29 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
# 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
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
pytestCheckHook
|
2021-12-19 01:06:50 +00:00
|
|
|
pytest-subtests
|
2024-01-02 11:29:13 +00:00
|
|
|
pytest-benchmark
|
2020-04-24 23:36:52 +00:00
|
|
|
matplotlib
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "--benchmark-disable" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
meta = {
|
2023-08-10 07:59:29 +00:00
|
|
|
changelog = "https://github.com/hgrecco/pint/blob/${version}/CHANGES";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Physical quantities module";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pint-convert";
|
2024-07-27 06:49:29 +00:00
|
|
|
license = lib.licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/hgrecco/pint/";
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with lib.maintainers; [ doronbehar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|