From 6b95f3074328ca1d6c2a513898f10ad71c1badae Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 6 Sep 2024 17:34:06 +0200 Subject: [PATCH] python312Packages.simple-parsing: init at 0.1.6 --- .../python-modules/simple-parsing/default.nix | 83 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 85 insertions(+) create mode 100644 pkgs/development/python-modules/simple-parsing/default.nix diff --git a/pkgs/development/python-modules/simple-parsing/default.nix b/pkgs/development/python-modules/simple-parsing/default.nix new file mode 100644 index 000000000000..b263f24ba1d6 --- /dev/null +++ b/pkgs/development/python-modules/simple-parsing/default.nix @@ -0,0 +1,83 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + poetry-core, + poetry-dynamic-versioning, + + # dependencies + docstring-parser, + typing-extensions, + + # optional-dependencies + tomli, + tomli-w, + pyyaml, + + # tests + matplotlib, + numpy, + orion, + pytest-benchmark, + pytest-regressions, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "simple-parsing"; + version = "0.1.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "lebrice"; + repo = "SimpleParsing"; + rev = "refs/tags/v${version}"; + hash = "sha256-RDS1sWzaQqXp/0a7dXlUHnd6z+GTIpUN1MnUCTI9LGw="; + }; + + build-system = [ + poetry-core + poetry-dynamic-versioning + ]; + + dependencies = [ + docstring-parser + typing-extensions + ]; + + optional-dependencies = { + toml = [ + tomli + tomli-w + ]; + yaml = [ pyyaml ]; + }; + + pythonImportsCheck = [ "simple_parsing" ]; + + nativeCheckInputs = [ + matplotlib + numpy + orion + pytest-benchmark + pytest-regressions + pytestCheckHook + ]; + + disabledTests = [ + # Expected: OrderedDict([('a', 1), ('b', 2), ('c', 5), ('d', 6), ('e', 7)]) + # Got: OrderedDict({'a': 1, 'b': 2, 'c': 5, 'd': 6, 'e': 7}) + # https://github.com/lebrice/SimpleParsing/issues/326 + "simple_parsing.utils.dict_union" + ]; + + meta = { + description = "Simple, Elegant, Typed Argument Parsing with argparse"; + changelog = "https://github.com/lebrice/SimpleParsing/releases/tag/v${version}"; + homepage = "https://github.com/lebrice/SimpleParsing"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 49045d27c5b8..bd1254196d4c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14166,6 +14166,8 @@ self: super: with self; { simber = callPackage ../development/python-modules/simber { }; + simple-parsing = callPackage ../development/python-modules/simple-parsing { }; + simple-term-menu = callPackage ../development/python-modules/simple-term-menu { }; simpleaudio = callPackage ../development/python-modules/simpleaudio { };