From f5b67283e7844eaf78c1c570ef6f5fdc44fca05b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 14 Oct 2024 19:26:57 +0300 Subject: [PATCH 1/8] python312Packages.orderly-set: init at 5.2.2 --- .../python-modules/orderly-set/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/orderly-set/default.nix diff --git a/pkgs/development/python-modules/orderly-set/default.nix b/pkgs/development/python-modules/orderly-set/default.nix new file mode 100644 index 000000000000..93f164a5b603 --- /dev/null +++ b/pkgs/development/python-modules/orderly-set/default.nix @@ -0,0 +1,56 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + + # build-system + setuptools, + + # tests + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "orderly-set"; + version = "5.2.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "seperman"; + repo = "orderly-set"; + rev = "refs/tags/${version}"; + hash = "sha256-ZDo5fSHD0lCn9CRQtWK10QeZoOhuXG3LR3KA/to9gpE="; + }; + patches = [ + # https://github.com/seperman/orderly-set/pull/5 + (fetchpatch { + name = "do-not-import-mypy.patch"; + url = "https://github.com/seperman/orderly-set/commit/34362084868a081b8ebaaf1f13c93a7a798ef557.patch"; + hash = "sha256-eKbnA31ykm5fH0om6cfOaMpy+ZNNWRDkHieaUIHF8OM="; + }) + ]; + + build-system = [ + setuptools + ]; + + pythonImportsCheck = [ + "orderly_set" + ]; + nativeCheckInputs = [ + pytestCheckHook + ]; + disabledTests = [ + # Statically analyzes types, can be disabled so that mypy won't be needed. + "test_typing_mypy" + ]; + + meta = { + description = "Orderly Set previously known as Ordered Set"; + homepage = "https://github.com/seperman/orderly-set"; + changelog = "https://github.com/seperman/orderly-set/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1222a3ddb722..98ef6c8e066a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9510,6 +9510,8 @@ self: super: with self; { ordered-set = callPackage ../development/python-modules/ordered-set { }; + orderly-set = callPackage ../development/python-modules/orderly-set { }; + orderedset = callPackage ../development/python-modules/orderedset { }; orgparse = callPackage ../development/python-modules/orgparse { }; From c5e848affd3a4d235ddc108974b77e8f6beb88ba Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 14 Oct 2024 19:20:58 +0300 Subject: [PATCH 2/8] python312Packages.deepdiff: adopt by doronbehar --- pkgs/development/python-modules/deepdiff/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/deepdiff/default.nix b/pkgs/development/python-modules/deepdiff/default.nix index ff583a572018..7788fb0ad6aa 100644 --- a/pkgs/development/python-modules/deepdiff/default.nix +++ b/pkgs/development/python-modules/deepdiff/default.nix @@ -72,6 +72,9 @@ buildPythonPackage rec { homepage = "https://github.com/seperman/deepdiff"; changelog = "https://github.com/seperman/deepdiff/releases/tag/${version}"; license = licenses.mit; - maintainers = with maintainers; [ mic92 ]; + maintainers = with maintainers; [ + mic92 + doronbehar + ]; }; } From 987094ba31b14d3320cc1b195bb07081b70802be Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 14 Oct 2024 19:20:42 +0300 Subject: [PATCH 3/8] python312Packages.deepdiff: modernize --- .../python-modules/deepdiff/default.nix | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/deepdiff/default.nix b/pkgs/development/python-modules/deepdiff/default.nix index 7788fb0ad6aa..1b806285a32f 100644 --- a/pkgs/development/python-modules/deepdiff/default.nix +++ b/pkgs/development/python-modules/deepdiff/default.nix @@ -2,10 +2,20 @@ lib, buildPythonPackage, fetchFromGitHub, + pythonOlder, + + # build-system + setuptools, + + # dependencies click, ordered-set, orjson, + + # optional-dependencies clevercsv, + + # tests jsonpickle, numpy, pytestCheckHook, @@ -13,13 +23,12 @@ pyyaml, toml, tomli-w, - pythonOlder, }: buildPythonPackage rec { pname = "deepdiff"; version = "7.0.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; @@ -35,7 +44,11 @@ buildPythonPackage rec { --replace '/tmp/' "$TMPDIR/" ''; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ click ordered-set orjson @@ -66,13 +79,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "deepdiff" ]; - meta = with lib; { + meta = { description = "Deep Difference and Search of any Python object/data"; mainProgram = "deep"; homepage = "https://github.com/seperman/deepdiff"; changelog = "https://github.com/seperman/deepdiff/releases/tag/${version}"; - license = licenses.mit; - maintainers = with maintainers; [ + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mic92 doronbehar ]; From 6b732100029877351c9fd6f2a4664de3483f02ea Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 14 Oct 2024 19:16:48 +0300 Subject: [PATCH 4/8] python312Packages.deepdiff: 7.0.1 -> 8.0.0 Diff: https://github.com/seperman/deepdiff/compare/refs/tags/7.0.1...8.0.0 Changelog: https://github.com/seperman/deepdiff/releases/tag/8.0.0 --- .../python-modules/deepdiff/default.nix | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/deepdiff/default.nix b/pkgs/development/python-modules/deepdiff/default.nix index 1b806285a32f..ac3ec5983290 100644 --- a/pkgs/development/python-modules/deepdiff/default.nix +++ b/pkgs/development/python-modules/deepdiff/default.nix @@ -9,7 +9,7 @@ # dependencies click, - ordered-set, + orderly-set, orjson, # optional-dependencies @@ -23,11 +23,13 @@ pyyaml, toml, tomli-w, + polars, + pandas, }: buildPythonPackage rec { pname = "deepdiff"; - version = "7.0.1"; + version = "8.0.0"; pyproject = true; disabled = pythonOlder "3.7"; @@ -36,23 +38,24 @@ buildPythonPackage rec { owner = "seperman"; repo = "deepdiff"; rev = "refs/tags/${version}"; - hash = "sha256-HqmAE5sLwyjyUahIUeRIJW0c5eliq/qEzE2FydHwc70="; + hash = "sha256-SnVsYQHTgy0sDKabImSXbSeKES2bBxjE6ZtVzrenm+A="; }; - postPatch = '' - substituteInPlace tests/test_command.py \ - --replace '/tmp/' "$TMPDIR/" - ''; - build-system = [ setuptools ]; dependencies = [ click - ordered-set + orderly-set orjson ]; + pythonRelaxDeps = [ + # Upstream develops this package as well, and from some reason pins this + # dependency to a patch version below this one. No significant changes + # happend in that relase, so we shouldn't worry, especially if tests pass. + "orderly-set" + ]; optional-dependencies = { cli = [ @@ -69,12 +72,17 @@ buildPythonPackage rec { pytestCheckHook python-dateutil tomli-w + polars + pandas ] ++ optional-dependencies.cli; disabledTests = [ # not compatible with pydantic 2.x "test_pydantic1" "test_pydantic2" + # Require pytest-benchmark + "test_cache_deeply_nested_a1" + "test_lfu" ]; pythonImportsCheck = [ "deepdiff" ]; From 6954bb67983129297e3d11abca734c9b4c9205cc Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Wed, 23 Oct 2024 08:57:47 +0300 Subject: [PATCH 5/8] python312Packages.deepdiff: 8.0.0 -> 8.0.1 --- pkgs/development/python-modules/deepdiff/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/deepdiff/default.nix b/pkgs/development/python-modules/deepdiff/default.nix index ac3ec5983290..3b46cf4aac9c 100644 --- a/pkgs/development/python-modules/deepdiff/default.nix +++ b/pkgs/development/python-modules/deepdiff/default.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { pname = "deepdiff"; - version = "8.0.0"; + version = "8.0.1"; pyproject = true; disabled = pythonOlder "3.7"; @@ -38,7 +38,7 @@ buildPythonPackage rec { owner = "seperman"; repo = "deepdiff"; rev = "refs/tags/${version}"; - hash = "sha256-SnVsYQHTgy0sDKabImSXbSeKES2bBxjE6ZtVzrenm+A="; + hash = "sha256-e6eTPSGoJ8r/4vGi/iGVFW/BruBADtVMtnO001Qs0IQ="; }; build-system = [ From a28273e38666e62523316f22f0b8a46cb685dbae Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 13:53:24 +0300 Subject: [PATCH 6/8] python311Packages.ttp: disable more failing tests --- pkgs/development/python-modules/ttp/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/ttp/default.nix b/pkgs/development/python-modules/ttp/default.nix index 700f97a68b5f..653ba4ad7171 100644 --- a/pkgs/development/python-modules/ttp/default.nix +++ b/pkgs/development/python-modules/ttp/default.nix @@ -64,6 +64,9 @@ buildPythonPackage rec { disabledTests = [ # data structure mismatches + "test_global_output_deepdiff_with_var_before" + "test_group_specific_output_deepdiff_with_var_before" + "test_group_specific_output_deepdiff_with_var_before_with_add_field" "test_yangson_validate" "test_yangson_validate_yang_lib_in_output_tag_data" "test_yangson_validate_multiple_inputs_mode_per_input_with_yang_lib_in_file" From 411dd1710d43283e0d2ed3b9aecc600b87197b63 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 13:36:11 +0300 Subject: [PATCH 7/8] python312Packages.dbt-common: reorder function inputs --- .../python-modules/dbt-common/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/dbt-common/default.nix b/pkgs/development/python-modules/dbt-common/default.nix index b97f071343e3..f3bb688e2189 100644 --- a/pkgs/development/python-modules/dbt-common/default.nix +++ b/pkgs/development/python-modules/dbt-common/default.nix @@ -1,24 +1,30 @@ { lib, - agate, + fetchPypi, buildPythonPackage, + pythonOlder, + + # build-system + hatchling, + + # dependencies + agate, colorama, deepdiff, - fetchPypi, - hatchling, isodate, jinja2, jsonschema, mashumaro, pathspec, protobuf, - pytest-mock, - pytest-xdist, - pytestCheckHook, python-dateutil, - pythonOlder, requests, typing-extensions, + + # tests + pytestCheckHook, + pytest-mock, + pytest-xdist, }: buildPythonPackage rec { @@ -34,7 +40,9 @@ buildPythonPackage rec { hash = "sha256-ehZ+a3zznnWMY9NJx9LfRtkV1vHiIH0HEhsYWfMbmb4="; }; - build-system = [ hatchling ]; + build-system = [ + hatchling + ]; pythonRelaxDeps = [ "protobuf" @@ -60,9 +68,9 @@ buildPythonPackage rec { doCheck = false; nativeCheckInputs = [ - pytest-mock - pytest-xdist pytestCheckHook + pytest-xdist + pytest-mock ]; pythonImportsCheck = [ "dbt_common" ]; From e5a2d548ffbbfce56effdfd3a042e04bec177c11 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 20 Oct 2024 13:39:00 +0300 Subject: [PATCH 8/8] python312Packages.dbt-common: 1.8.0 -> 1.11.0 Not yet fully building, but with a Python package set that uses protobuf4 instead of protobuf5, it is working. --- .../python-modules/dbt-common/default.nix | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/dbt-common/default.nix b/pkgs/development/python-modules/dbt-common/default.nix index f3bb688e2189..9b037341b490 100644 --- a/pkgs/development/python-modules/dbt-common/default.nix +++ b/pkgs/development/python-modules/dbt-common/default.nix @@ -1,6 +1,6 @@ { lib, - fetchPypi, + fetchFromGitHub, buildPythonPackage, pythonOlder, @@ -25,19 +25,24 @@ pytestCheckHook, pytest-mock, pytest-xdist, + numpy, }: buildPythonPackage rec { pname = "dbt-common"; - version = "1.8.0"; + version = "1.11.0"; pyproject = true; disabled = pythonOlder "3.8"; - src = fetchPypi { - pname = "dbt_common"; - inherit version; - hash = "sha256-ehZ+a3zznnWMY9NJx9LfRtkV1vHiIH0HEhsYWfMbmb4="; + src = fetchFromGitHub { + owner = "dbt-labs"; + repo = "dbt-common"; + # Unfortunatly, upstream doesn't tag commits on GitHub, and the pypi source + # doesn't include tests. TODO: Write an update script that will detect the + # version from `dbt_common/__about__.py`. + rev = "ed11c6ceb4f29d4a79489469309d9ce9dd1757e6"; + hash = "sha256-JA6hFQwF7h1tXyCxBVKGgyevdTxyYeN3I/Bwy9uoC0Y="; }; build-system = [ @@ -47,6 +52,7 @@ buildPythonPackage rec { pythonRelaxDeps = [ "protobuf" "agate" + "deepdiff" ]; dependencies = [ @@ -64,15 +70,17 @@ buildPythonPackage rec { typing-extensions ] ++ mashumaro.optional-dependencies.msgpack; - # Upstream stopped to tag the source fo rnow - doCheck = false; - nativeCheckInputs = [ pytestCheckHook pytest-xdist pytest-mock ]; - + disabledTests = [ + # Assertion errors (TODO: Notify upstream) + "test_create_print_json" + "test_events" + "test_extra_dict_on_event" + ]; pythonImportsCheck = [ "dbt_common" ]; meta = {