mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
remarshal_0_17: init at 0.17.1; pkgs.formats.yaml_1_1: rename from pkgs.formats.yaml (#354687)
This commit is contained in:
commit
7661bb7fe9
62
pkgs/by-name/re/remarshal_0_17/package.nix
Normal file
62
pkgs/by-name/re/remarshal_0_17/package.nix
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
fetchPypi,
|
||||
}:
|
||||
|
||||
let
|
||||
python = python3Packages.python.override {
|
||||
self = python3Packages.python;
|
||||
packageOverrides = self: super: {
|
||||
tomlkit = super.tomlkit.overridePythonAttrs (oldAttrs: rec {
|
||||
version = "0.12.5";
|
||||
src = fetchPypi {
|
||||
pname = "tomlkit";
|
||||
inherit version;
|
||||
hash = "sha256-7vNPujmDTU1rc8m6fz5NHEF6Tlb4mn6W4JDdDSS4+zw=";
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
pythonPackages = python.pkgs;
|
||||
in
|
||||
pythonPackages.buildPythonApplication rec {
|
||||
pname = "remarshal";
|
||||
version = "0.17.1"; # last version with YAML 1.1 support, do not update
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dbohdan";
|
||||
repo = "remarshal";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-2WxMh5P/8NvElymnMU3JzQU0P4DMXFF6j15OxLaS+VA=";
|
||||
};
|
||||
|
||||
pythonRemoveDeps = [ "pytest" ];
|
||||
|
||||
build-system = [ pythonPackages.poetry-core ];
|
||||
|
||||
dependencies = with pythonPackages; [
|
||||
cbor2
|
||||
colorama
|
||||
python-dateutil
|
||||
pyyaml
|
||||
rich-argparse
|
||||
ruamel-yaml
|
||||
tomlkit
|
||||
u-msgpack-python
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ pythonPackages.pytestCheckHook ];
|
||||
|
||||
passthru.updateScript = throw "This package is pinned to 0.17.1 for YAML 1.1 support";
|
||||
|
||||
meta = with lib; {
|
||||
changelog = "https://github.com/remarshal-project/remarshal/releases/tag/v${version}";
|
||||
description = "Convert between TOML, YAML and JSON";
|
||||
license = licenses.mit;
|
||||
homepage = "https://github.com/dbohdan/remarshal";
|
||||
maintainers = with maintainers; [ hexa ];
|
||||
};
|
||||
}
|
@ -76,10 +76,11 @@ rec {
|
||||
|
||||
};
|
||||
|
||||
yaml = {}: {
|
||||
yaml = yaml_1_1;
|
||||
|
||||
generate = name: value: pkgs.callPackage ({ runCommand, remarshal }: runCommand name {
|
||||
nativeBuildInputs = [ remarshal ];
|
||||
yaml_1_1 = {}: {
|
||||
generate = name: value: pkgs.callPackage ({ runCommand, remarshal_0_17 }: runCommand name {
|
||||
nativeBuildInputs = [ remarshal_0_17 ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
preferLocalBuild = true;
|
||||
|
@ -118,7 +118,7 @@ in runBuildTests {
|
||||
'';
|
||||
};
|
||||
|
||||
yamlAtoms = shouldPass {
|
||||
yaml_1_1Atoms = shouldPass {
|
||||
format = formats.yaml {};
|
||||
input = {
|
||||
null = null;
|
||||
@ -129,6 +129,8 @@ in runBuildTests {
|
||||
attrs.foo = null;
|
||||
list = [ null null ];
|
||||
path = ./formats.nix;
|
||||
no = "no";
|
||||
time = "22:30:00";
|
||||
};
|
||||
expected = ''
|
||||
attrs:
|
||||
@ -138,9 +140,11 @@ in runBuildTests {
|
||||
list:
|
||||
- null
|
||||
- null
|
||||
'no': 'no'
|
||||
'null': null
|
||||
path: ${./formats.nix}
|
||||
str: foo
|
||||
time: '22:30:00'
|
||||
'true': true
|
||||
'';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user