2023-08-04 22:07:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, attrs
|
|
|
|
, pendulum
|
2023-08-04 22:07:22 +00:00
|
|
|
, poetry-core
|
2020-04-24 23:36:52 +00:00
|
|
|
, pprintpp
|
2023-08-04 22:07:22 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonRelaxDepsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, wrapt
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "tbm-utils";
|
2020-06-15 15:56:04 +00:00
|
|
|
version = "2.6.0";
|
2023-08-04 22:07:22 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "thebigmunch";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-AEKawsAxDSDNkIaXEFFgdEBOY2PpASDrhlDrsnM5eyA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = ''
|
2023-08-04 22:07:22 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'poetry>=1.0.0' 'poetry-core' \
|
|
|
|
--replace 'poetry.masonry.api' 'poetry.core.masonry.api'
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
pendulum
|
|
|
|
pprintpp
|
|
|
|
wrapt
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"attrs"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Skip on macOS because /etc/localtime is accessed through the pendulum
|
|
|
|
# library, which is not allowed in a sandboxed build.
|
|
|
|
"test_create_parser_filter_dates"
|
|
|
|
"test_parse_args"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = lib.optionals stdenv.isDarwin [
|
|
|
|
# Skip on macOS because /etc/localtime is accessed through the pendulum
|
|
|
|
# library, which is not allowed in a sandboxed build.
|
|
|
|
"tests/test_datetime.py"
|
|
|
|
"tests/test_misc.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"tbm_utils"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A commonly-used set of utilities";
|
|
|
|
homepage = "https://github.com/thebigmunch/tbm-utils";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/thebigmunch/tbm-utils/blob/${version}/CHANGELOG.md";
|
|
|
|
license = [ lib.licenses.mit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|