From 01dbbb39ec485d437fad2db25293f4a375a263ac Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 21 Nov 2024 11:20:32 +0100 Subject: [PATCH 1/5] python312Packages.pygelf: init at 0.4.2 --- .../python-modules/pygelf/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/pygelf/default.nix diff --git a/pkgs/development/python-modules/pygelf/default.nix b/pkgs/development/python-modules/pygelf/default.nix new file mode 100644 index 0000000000000..bb5735771c745 --- /dev/null +++ b/pkgs/development/python-modules/pygelf/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + mock, + pytestCheckHook, + requests, +}: +buildPythonPackage rec { + pname = "pygelf"; + version = "0.4.2"; + pyproject = true; + + src = fetchPypi { + pname = "pygelf"; + inherit version; + hash = "sha256-0LuPRf9kipoYdxP0oFwJ9oX8uK3XsEu3Rx8gBxvRGq0="; + }; + + build-system = [ setuptools ]; + + pythonImportsCheck = [ "pygelf" ]; + + nativeCheckInputs = [ + mock + pytestCheckHook + requests + ]; + + disabledTests = [ + # ConnectionRefusedError: [Errno 111] Connection refused + "test_static_fields" + "test_dynamic_fields" + ]; + + disabledTestPaths = [ + # These tests requires files that are stripped off by Pypi packaging + "tests/test_queuehandler_support.py" + "tests/test_debug_mode.py" + "tests/test_common_fields.py" + ]; + + meta = { + description = "Python logging handlers with GELF (Graylog Extended Log Format) support"; + homepage = "https://github.com/keeprocking/pygelf"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 63be75ca0110f..04f9ff0e621d4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10397,6 +10397,8 @@ self: super: with self; { pyfreedompro = callPackage ../development/python-modules/pyfreedompro { }; + pygelf = callPackage ../development/python-modules/pygelf { }; + pygments-style-github = callPackage ../development/python-modules/pygments-style-github { }; pygnmi = callPackage ../development/python-modules/pygnmi { }; From df9a80ca76d4db2aabc06bbc7a185c1374f39328 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 21 Nov 2024 11:37:09 +0100 Subject: [PATCH 2/5] python312Packages.parsedmarc: add missing `pygelf` dependency --- pkgs/development/python-modules/parsedmarc/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index 61ec964340d41..dc118008ef9bc 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -27,6 +27,7 @@ nixosTests, opensearch-py, publicsuffixlist, + pygelf, pythonOlder, requests, tqdm, @@ -41,14 +42,14 @@ let in buildPythonPackage rec { pname = "parsedmarc"; - version = "8.15.0"; + version = "8.15.4"; pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-Z2KF8jv/D/SvwQWd1PGSlsAfowmYOd5CvvcC4kVuLos="; + hash = "sha256-lxW92jlSWgGVxOO+CwIZi5sKHqoZuR5VQCnDVORXmXU="; }; nativeBuildInputs = [ @@ -82,6 +83,7 @@ buildPythonPackage rec { mailsuite msgraph-core publicsuffixlist + pygelf requests tqdm xmltodict From 2c6c67a61d8889e4ef2a9e6a354eb4e0c6d2b255 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 21 Nov 2024 11:52:32 +0100 Subject: [PATCH 3/5] python312Packages.mail-parser: 4.0.0 -> 4.1.2 --- .../development/python-modules/mail-parser/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/mail-parser/default.nix b/pkgs/development/python-modules/mail-parser/default.nix index 226fe1878de2d..807c97f6addee 100644 --- a/pkgs/development/python-modules/mail-parser/default.nix +++ b/pkgs/development/python-modules/mail-parser/default.nix @@ -12,14 +12,14 @@ buildPythonPackage rec { pname = "mail-parser"; - version = "4.0.0"; + version = "4.1.2"; pyproject = true; src = fetchFromGitHub { owner = "SpamScope"; repo = "mail-parser"; rev = "refs/tags/${version}"; - hash = "sha256-WpV1WJFwzAquPXimew86YpEp++dnkIiBe5E4lMBDl7w="; + hash = "sha256-AXMfb+9POEaosCc+dv1xenhvBbpVkllMjftMoADUPXE="; }; LC_ALL = "en_US.utf-8"; @@ -49,11 +49,11 @@ buildPythonPackage rec { cat tests/mails/mail_malformed_3 | ${python.interpreter} -m mailparser -k -j ''; - meta = with lib; { + meta = { description = "Mail parser for python 2 and 3"; mainProgram = "mailparser"; homepage = "https://github.com/SpamScope/mail-parser"; - license = licenses.asl20; - maintainers = with maintainers; [ psyanticy ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ psyanticy ]; }; } From c532371d8423fb13baaa7c5a41790b7be0a0de17 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 21 Nov 2024 11:24:23 +0100 Subject: [PATCH 4/5] python312Packages.mailsuite: 1.9.16 -> 1.9.18 --- pkgs/development/python-modules/mailsuite/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/mailsuite/default.nix b/pkgs/development/python-modules/mailsuite/default.nix index f6cb1a2a23305..a58dfba8dbeae 100644 --- a/pkgs/development/python-modules/mailsuite/default.nix +++ b/pkgs/development/python-modules/mailsuite/default.nix @@ -16,18 +16,22 @@ buildPythonPackage rec { pname = "mailsuite"; - version = "1.9.16"; + version = "1.9.18"; format = "pyproject"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-rfavOOivttXXmdA/Nl3jUmXIUQrjxDDZ8cHcNIJQL6U="; + hash = "sha256-3rK5PgcAOKVvZbFT7PaZX9lhU8yKpPQozvh2F8mTkfA="; }; nativeBuildInputs = [ hatchling ]; + pythonRelaxDeps = [ + "mail-parser" + ]; + propagatedBuildInputs = [ dnspython expiringdict From d60df245ce98d22bb333abc09803ac8a4dd5a059 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 20 Nov 2024 20:44:21 +0100 Subject: [PATCH 5/5] python312Packages.opensearch-py: fix build --- .../python-modules/opensearch-py/default.nix | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/opensearch-py/default.nix b/pkgs/development/python-modules/opensearch-py/default.nix index 0914a8ca67014..5557ea3e21b1c 100644 --- a/pkgs/development/python-modules/opensearch-py/default.nix +++ b/pkgs/development/python-modules/opensearch-py/default.nix @@ -1,5 +1,6 @@ { lib, + stdenv, buildPythonPackage, fetchFromGitHub, @@ -62,6 +63,8 @@ buildPythonPackage rec { pytz ] ++ optional-dependencies.async; + __darwinAllowLocalNetworking = true; + disabledTestPaths = [ # require network "test_opensearchpy/test_async/test_connection.py" @@ -70,11 +73,21 @@ buildPythonPackage rec { "test_opensearchpy/test_server_secured" ]; - disabledTests = [ - # finds our ca-bundle, but expects something else (/path/to/clientcert/dir or None) - "test_ca_certs_ssl_cert_dir" - "test_no_ca_certs" - ]; + disabledTests = + [ + # finds our ca-bundle, but expects something else (/path/to/clientcert/dir or None) + "test_ca_certs_ssl_cert_dir" + "test_no_ca_certs" + + # Failing tests, issue opened at https://github.com/opensearch-project/opensearch-py/issues/849 + "test_basicauth_in_request_session" + "test_callable_in_request_session" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) [ + # Flaky tests: OSError: [Errno 48] Address already in use + "test_redirect_failure_when_allow_redirect_false" + "test_redirect_success_when_allow_redirect_true" + ]; meta = { description = "Python low-level client for OpenSearch";