diff --git a/nixos/modules/services/monitoring/parsedmarc.nix b/nixos/modules/services/monitoring/parsedmarc.nix index a146e7ab95435..83e56d6fab4aa 100644 --- a/nixos/modules/services/monitoring/parsedmarc.nix +++ b/nixos/modules/services/monitoring/parsedmarc.nix @@ -438,7 +438,7 @@ in ]; dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{ name = "parsedmarc"; - options.path = "${pkgs.python3Packages.parsedmarc.dashboard}"; + options.path = "${pkgs.parsedmarc.dashboard}"; }]; }; }; @@ -530,7 +530,7 @@ in MemoryDenyWriteExecute = true; LockPersonality = true; SystemCallArchitectures = "native"; - ExecStart = "${pkgs.python3Packages.parsedmarc}/bin/parsedmarc -c /run/parsedmarc/parsedmarc.ini"; + ExecStart = "${lib.getExe pkgs.parsedmarc} -c /run/parsedmarc/parsedmarc.ini"; }; }; diff --git a/pkgs/by-name/pa/parsedmarc/package.nix b/pkgs/by-name/pa/parsedmarc/package.nix new file mode 100644 index 0000000000000..fab1e01e8ba40 --- /dev/null +++ b/pkgs/by-name/pa/parsedmarc/package.nix @@ -0,0 +1,41 @@ +{ lib +, python3 +, fetchFromGitHub +}: + +let + python = python3.override { + packageOverrides = self: super: { + # https://github.com/domainaware/parsedmarc/issues/464 + msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec { + version = "0.2.2"; + + src = fetchFromGitHub { + owner = "microsoftgraph"; + repo = "msgraph-sdk-python-core"; + rev = "v${version}"; + hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA="; + }; + + nativeBuildInputs = with self; [ + flit-core + ]; + + propagatedBuildInputs = with self; [ + requests + ]; + + nativeCheckInputs = with self; [ + pytestCheckHook + responses + ]; + + disabledTestPaths = [ + "tests/integration" + ]; + + pythonImportsCheck = [ "msgraph.core" ]; + }); + }; + }; +in with python.pkgs; toPythonApplication parsedmarc diff --git a/pkgs/development/python-modules/microsoft-kiota-abstractions/default.nix b/pkgs/development/python-modules/microsoft-kiota-abstractions/default.nix new file mode 100644 index 0000000000000..8335e24367d29 --- /dev/null +++ b/pkgs/development/python-modules/microsoft-kiota-abstractions/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, flit-core +, opentelemetry-api +, opentelemetry-sdk +, std-uritemplate +, pytest-asyncio +, pytest-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "microsoft-kiota-abstractions"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "kiota-abstractions-python"; + rev = "v${version}"; + hash = "sha256-lIhVBEZsxq6VnldlgpEknfF3/sOnATCYzvY4V6wZCz4="; + }; + + nativeBuildInputs = [ + flit-core + ]; + + propagatedBuildInputs = [ + opentelemetry-api + opentelemetry-sdk + std-uritemplate + ]; + + pythonImportsCheck = [ "kiota_abstractions" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytest-mock + pytestCheckHook + ]; + + meta = { + changelog = "https://github.com/microsoft/kiota-abstractions-python/blob/${src.rev}/CHANGELOG.md"; + description = "Abstractions library for Kiota generated Python clients"; + homepage = "https://github.com/microsoft/kiota-abstractions-python"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/microsoft-kiota-authentication-azure/default.nix b/pkgs/development/python-modules/microsoft-kiota-authentication-azure/default.nix new file mode 100644 index 0000000000000..c0a76716d46ad --- /dev/null +++ b/pkgs/development/python-modules/microsoft-kiota-authentication-azure/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, flit-core +, aiohttp +, azure-core +, microsoft-kiota-abstractions +, opentelemetry-api +, opentelemetry-sdk +, pytest-asyncio +, pytest-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "microsoft-kiota-authentication-azure"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "kiota-authentication-azure-python"; + rev = "v${version}"; + hash = "sha256-RA0BbIwDs3cXiH4tQsvCGUO1OAg+DWjEeWd7MEVIC8E="; + }; + + nativeBuildInputs = [ + flit-core + ]; + + propagatedBuildInputs = [ + aiohttp + azure-core + microsoft-kiota-abstractions + opentelemetry-api + opentelemetry-sdk + ]; + + pythonImportsCheck = [ "kiota_authentication_azure" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytest-mock + pytestCheckHook + ]; + + meta = { + changelog = "https://github.com/microsoft/kiota-authentication-azure-python/blob/${src.rev}/CHANGELOG.md"; + description = "Kiota Azure authentication provider for python clients"; + homepage = "https://github.com/microsoft/kiota-authentication-azure-python"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/microsoft-kiota-http/default.nix b/pkgs/development/python-modules/microsoft-kiota-http/default.nix new file mode 100644 index 0000000000000..4faed21720d31 --- /dev/null +++ b/pkgs/development/python-modules/microsoft-kiota-http/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, flit-core +, httpx +, microsoft-kiota-abstractions +, opentelemetry-api +, opentelemetry-sdk +, pytest-asyncio +, pytest-mock +, pytestCheckHook +, urllib3 +}: + +buildPythonPackage rec { + pname = "microsoft-kiota-http"; + version = "1.2.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "kiota-http-python"; + rev = "v${version}"; + hash = "sha256-BGMEndYa1ZMKWw18Fs9S/ieMhu+e4tKQW57CC3g0P0Q="; + }; + + nativeBuildInputs = [ + flit-core + ]; + + propagatedBuildInputs = [ + httpx + microsoft-kiota-abstractions + opentelemetry-api + opentelemetry-sdk + ] ++ httpx.optional-dependencies.http2; + + pythonImportsCheck = [ "kiota_http" ]; + + nativeCheckInputs = [ + pytest-asyncio + pytest-mock + pytestCheckHook + urllib3 + ]; + + meta = { + changelog = "https://github.com/microsoft/kiota-http-python/blob/${src.rev}/CHANGELOG.md"; + description = "HTTP request adapter implementation for Kiota clients for Python"; + homepage = "https://github.com/microsoft/kiota-http-python"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/msgraph-core/default.nix b/pkgs/development/python-modules/msgraph-core/default.nix index a1df35addf030..975e35948c1cf 100644 --- a/pkgs/development/python-modules/msgraph-core/default.nix +++ b/pkgs/development/python-modules/msgraph-core/default.nix @@ -2,47 +2,50 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub -, flit-core -, requests +, setuptools +, httpx +, microsoft-kiota-abstractions +, microsoft-kiota-authentication-azure +, microsoft-kiota-http +, azure-identity , pytestCheckHook -, responses }: buildPythonPackage rec { pname = "msgraph-core"; - version = "0.2.2"; + version = "1.0.0"; - disabled = pythonOlder "3.5"; + disabled = pythonOlder "3.8"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "microsoftgraph"; repo = "msgraph-sdk-python-core"; rev = "v${version}"; - hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA="; + hash = "sha256-VizjN7sXqPvo9VOSaaUnogTlUDJ1OA2COYNTcVRqhJA="; }; nativeBuildInputs = [ - flit-core + setuptools ]; propagatedBuildInputs = [ - requests - ]; + httpx + microsoft-kiota-abstractions + microsoft-kiota-authentication-azure + microsoft-kiota-http + ] ++ httpx.optional-dependencies.http2; nativeCheckInputs = [ + azure-identity pytestCheckHook - responses - ]; - - disabledTestPaths = [ - "tests/integration" ]; - pythonImportsCheck = [ "msgraph.core" ]; + pythonImportsCheck = [ "msgraph_core" ]; meta = { + changelog = "https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/${src.rev}/CHANGELOG.md"; description = "Core component of the Microsoft Graph Python SDK"; homepage = "https://github.com/microsoftgraph/msgraph-sdk-python-core"; license = lib.licenses.mit; diff --git a/pkgs/development/python-modules/parsedmarc/default.nix b/pkgs/development/python-modules/parsedmarc/default.nix index ac859c0c825f0..9723c8a581787 100644 --- a/pkgs/development/python-modules/parsedmarc/default.nix +++ b/pkgs/development/python-modules/parsedmarc/default.nix @@ -108,5 +108,7 @@ buildPythonPackage rec { license = licenses.asl20; maintainers = with maintainers; [ talyz ]; mainProgram = "parsedmarc"; + # https://github.com/domainaware/parsedmarc/issues/464 + broken = lib.versionAtLeast msgraph-core.version "1.0.0"; }; } diff --git a/pkgs/development/python-modules/std-uritemplate/default.nix b/pkgs/development/python-modules/std-uritemplate/default.nix new file mode 100644 index 0000000000000..c4e6cd999c815 --- /dev/null +++ b/pkgs/development/python-modules/std-uritemplate/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchPypi +, poetry-core +}: + +buildPythonPackage rec { + pname = "std-uritemplate"; + version = "0.0.50"; + pyproject = true; + + src = fetchPypi { + pname = "std_uritemplate"; + inherit version; + hash = "sha256-ZeMNxtZm+rltW4pD9/46lHEVFdExSL7b5N02T3AYk+k="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + pythonImportsCheck = [ "stduritemplate" ]; + + # tests not shipped on PyPI, no tags on GitHub + doCheck = false; + + meta = { + description = "Std-uritemplate implementation for Python"; + homepage = "https://github.com/andreaTP/std-uritemplate"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9c56dd1a58aa6..b42d624181d13 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -40838,8 +40838,6 @@ with pkgs; OSCAR = qt5.callPackage ../applications/misc/OSCAR { }; - parsedmarc = with python3Packages; toPythonApplication parsedmarc; - pgmanage = callPackage ../applications/misc/pgmanage { }; pgadmin4 = callPackage ../tools/admin/pgadmin { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 27ed55d001ea0..c88cecdb51cb9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7032,6 +7032,12 @@ self: super: with self; { microdata = callPackage ../development/python-modules/microdata { }; + microsoft-kiota-abstractions = callPackage ../development/python-modules/microsoft-kiota-abstractions { }; + + microsoft-kiota-authentication-azure = callPackage ../development/python-modules/microsoft-kiota-authentication-azure { }; + + microsoft-kiota-http = callPackage ../development/python-modules/microsoft-kiota-http { }; + midiutil = callPackage ../development/python-modules/midiutil { }; mido = callPackage ../development/python-modules/mido { }; @@ -13834,6 +13840,8 @@ self: super: with self; { statsmodels = callPackage ../development/python-modules/statsmodels { }; + std-uritemplate = callPackage ../development/python-modules/std-uritemplate { }; + std2 = callPackage ../development/python-modules/std2 { }; stdiomask = callPackage ../development/python-modules/stdiomask { };