1{ 2 lib, 3 antlr4, 4 antlr4-python3-runtime, 5 attrs, 6 buildPythonPackage, 7 fetchFromGitHub, 8 setuptools, 9 jre_minimal, 10 pydevd, 11 pytest-mock, 12 pytestCheckHook, 13 pythonAtLeast, 14 pythonOlder, 15 pyyaml, 16 replaceVars, 17}: 18 19buildPythonPackage rec { 20 pname = "omegaconf"; 21 version = "2.3.0"; 22 pyproject = true; 23 24 disabled = pythonOlder "3.6"; 25 26 src = fetchFromGitHub { 27 owner = "omry"; 28 repo = "omegaconf"; 29 tag = "v${version}"; 30 hash = "sha256-Qxa4uIiX5TAyQ5rFkizdev60S4iVAJ08ES6FpNqf8zI="; 31 }; 32 33 patches = [ 34 (replaceVars ./antlr4.patch { 35 antlr_jar = "${antlr4.out}/share/java/antlr-${antlr4.version}-complete.jar"; 36 }) 37 38 # https://github.com/omry/omegaconf/pull/1137 39 ./0000-add-support-for-dataclasses_missing_type.patch 40 ]; 41 42 postPatch = '' 43 # We substitute the path to the jar with the one from our antlr4 44 # package, so this file becomes unused 45 rm -v build_helpers/bin/antlr*-complete.jar 46 47 sed -i 's/antlr4-python3-runtime==.*/antlr4-python3-runtime/' requirements/base.txt 48 ''; 49 50 build-system = [ setuptools ]; 51 52 nativeBuildInputs = [ jre_minimal ]; 53 54 dependencies = [ 55 antlr4-python3-runtime 56 pyyaml 57 ]; 58 59 nativeCheckInputs = [ 60 attrs 61 pydevd 62 pytest-mock 63 pytestCheckHook 64 ]; 65 66 pythonImportsCheck = [ "omegaconf" ]; 67 68 pytestFlagsArray = [ 69 "-W" 70 "ignore::DeprecationWarning" 71 ]; 72 73 disabledTests = 74 [ 75 # assert (1560791320562868035 == 1560791320562868035) == False 76 "test_eq" 77 ] 78 ++ lib.optionals (pythonAtLeast "3.13") [ 79 # pathlib._local.Path != pathlib.Path type check mismatch 80 "test_errors" 81 "test_to_yaml" 82 "test_type_str" 83 ]; 84 85 meta = with lib; { 86 description = "Framework for configuring complex applications"; 87 homepage = "https://github.com/omry/omegaconf"; 88 changelog = "https://github.com/omry/omegaconf/blob/v${version}/NEWS.md"; 89 license = licenses.bsd3; 90 maintainers = with maintainers; [ bcdarwin ]; 91 }; 92}