remarshal_0_17: init at 0.17.1; pkgs.formats.yaml_1_1: rename from pkgs.formats.yaml (#354687)

authored by Martin Weinelt and committed by GitHub 7661bb7f f1e22103

+71 -4
+62
pkgs/by-name/re/remarshal_0_17/package.nix
···
··· 1 + { 2 + lib, 3 + python3Packages, 4 + fetchFromGitHub, 5 + fetchPypi, 6 + }: 7 + 8 + let 9 + python = python3Packages.python.override { 10 + self = python3Packages.python; 11 + packageOverrides = self: super: { 12 + tomlkit = super.tomlkit.overridePythonAttrs (oldAttrs: rec { 13 + version = "0.12.5"; 14 + src = fetchPypi { 15 + pname = "tomlkit"; 16 + inherit version; 17 + hash = "sha256-7vNPujmDTU1rc8m6fz5NHEF6Tlb4mn6W4JDdDSS4+zw="; 18 + }; 19 + }); 20 + }; 21 + }; 22 + pythonPackages = python.pkgs; 23 + in 24 + pythonPackages.buildPythonApplication rec { 25 + pname = "remarshal"; 26 + version = "0.17.1"; # last version with YAML 1.1 support, do not update 27 + pyproject = true; 28 + 29 + src = fetchFromGitHub { 30 + owner = "dbohdan"; 31 + repo = "remarshal"; 32 + rev = "refs/tags/v${version}"; 33 + hash = "sha256-2WxMh5P/8NvElymnMU3JzQU0P4DMXFF6j15OxLaS+VA="; 34 + }; 35 + 36 + pythonRemoveDeps = [ "pytest" ]; 37 + 38 + build-system = [ pythonPackages.poetry-core ]; 39 + 40 + dependencies = with pythonPackages; [ 41 + cbor2 42 + colorama 43 + python-dateutil 44 + pyyaml 45 + rich-argparse 46 + ruamel-yaml 47 + tomlkit 48 + u-msgpack-python 49 + ]; 50 + 51 + nativeCheckInputs = [ pythonPackages.pytestCheckHook ]; 52 + 53 + passthru.updateScript = throw "This package is pinned to 0.17.1 for YAML 1.1 support"; 54 + 55 + meta = with lib; { 56 + changelog = "https://github.com/remarshal-project/remarshal/releases/tag/v${version}"; 57 + description = "Convert between TOML, YAML and JSON"; 58 + license = licenses.mit; 59 + homepage = "https://github.com/dbohdan/remarshal"; 60 + maintainers = with maintainers; [ hexa ]; 61 + }; 62 + }
+4 -3
pkgs/pkgs-lib/formats.nix
··· 76 77 }; 78 79 - yaml = {}: { 80 81 - generate = name: value: pkgs.callPackage ({ runCommand, remarshal }: runCommand name { 82 - nativeBuildInputs = [ remarshal ]; 83 value = builtins.toJSON value; 84 passAsFile = [ "value" ]; 85 preferLocalBuild = true;
··· 76 77 }; 78 79 + yaml = yaml_1_1; 80 81 + yaml_1_1 = {}: { 82 + generate = name: value: pkgs.callPackage ({ runCommand, remarshal_0_17 }: runCommand name { 83 + nativeBuildInputs = [ remarshal_0_17 ]; 84 value = builtins.toJSON value; 85 passAsFile = [ "value" ]; 86 preferLocalBuild = true;
+5 -1
pkgs/pkgs-lib/tests/formats.nix
··· 118 ''; 119 }; 120 121 - yamlAtoms = shouldPass { 122 format = formats.yaml {}; 123 input = { 124 null = null; ··· 129 attrs.foo = null; 130 list = [ null null ]; 131 path = ./formats.nix; 132 }; 133 expected = '' 134 attrs: ··· 138 list: 139 - null 140 - null 141 'null': null 142 path: ${./formats.nix} 143 str: foo 144 'true': true 145 ''; 146 };
··· 118 ''; 119 }; 120 121 + yaml_1_1Atoms = shouldPass { 122 format = formats.yaml {}; 123 input = { 124 null = null; ··· 129 attrs.foo = null; 130 list = [ null null ]; 131 path = ./formats.nix; 132 + no = "no"; 133 + time = "22:30:00"; 134 }; 135 expected = '' 136 attrs: ··· 140 list: 141 - null 142 - null 143 + 'no': 'no' 144 'null': null 145 path: ${./formats.nix} 146 str: foo 147 + time: '22:30:00' 148 'true': true 149 ''; 150 };