2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
2022-12-28 21:21:41 +00:00
|
|
|
, antlr4
|
|
|
|
, antlr4-python3-runtime
|
2022-08-12 12:06:08 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools
|
2022-09-09 14:08:57 +00:00
|
|
|
, jre_minimal
|
|
|
|
, pydevd
|
2022-08-12 12:06:08 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-09-09 14:08:57 +00:00
|
|
|
, pyyaml
|
2022-12-28 21:21:41 +00:00
|
|
|
, substituteAll
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "omegaconf";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "2.3.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2021-08-27 14:25:00 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "omry";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-Qxa4uIiX5TAyQ5rFkizdev60S4iVAJ08ES6FpNqf8zI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./antlr4.patch;
|
|
|
|
antlr_jar = "${antlr4.out}/share/java/antlr-${antlr4.version}-complete.jar";
|
|
|
|
})
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# https://github.com/omry/omegaconf/pull/1137
|
|
|
|
./0000-add-support-for-dataclasses_missing_type.patch
|
2022-12-28 21:21:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# We substitute the path to the jar with the one from our antlr4
|
|
|
|
# package, so this file becomes unused
|
|
|
|
rm -v build_helpers/bin/antlr*-complete.jar
|
|
|
|
|
|
|
|
sed -i 's/antlr4-python3-runtime==.*/antlr4-python3-runtime/' requirements/base.txt
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
setuptools
|
2022-08-12 12:06:08 +00:00
|
|
|
jre_minimal
|
|
|
|
];
|
2021-08-27 14:25:00 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-12-28 21:21:41 +00:00
|
|
|
antlr4-python3-runtime
|
2022-08-12 12:06:08 +00:00
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pydevd
|
|
|
|
pytest-mock
|
2022-09-09 14:08:57 +00:00
|
|
|
pytestCheckHook
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"omegaconf"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-09-09 14:08:57 +00:00
|
|
|
description = "Framework for configuring complex applications";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/omry/omegaconf";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/omry/omegaconf/blob/v${version}/NEWS.md";
|
2022-09-09 14:08:57 +00:00
|
|
|
license = licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|