From 12e702672786dbc5bbf5dda6b9167413d83ff3e0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 26 Mar 2022 17:56:26 +0100 Subject: [PATCH 1/2] python3Packages.glean-parser: update pname --- .../python-modules/glean-parser/default.nix | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index 30d4db0d2613..953e3faa67bb 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -1,33 +1,34 @@ { lib -, buildPythonPackage -, fetchPypi -, pytestCheckHook -, pythonOlder -, setuptools-scm -# build inputs , appdirs +, buildPythonPackage , click , diskcache +, fetchPypi , jinja2 , jsonschema +, pytestCheckHook +, pythonOlder , pyyaml +, setuptools-scm , yamllint }: buildPythonPackage rec { - pname = "glean_parser"; + pname = "glean-parser"; version = "5.1.0"; + format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { - inherit pname version; - sha256 = "sha256-8oMbaGsW5Lkw9OluNsXXe2IBNbjeoIb9vDjVOt+uHR0="; + pname = "glean_parser"; + inherit version; + hash = "sha256-8oMbaGsW5Lkw9OluNsXXe2IBNbjeoIb9vDjVOt+uHR0="; }; - postPatch = '' - substituteInPlace setup.py --replace "pytest-runner" "" - ''; + nativeBuildInputs = [ + setuptools-scm + ]; propagatedBuildInputs = [ appdirs @@ -38,24 +39,29 @@ buildPythonPackage rec { pyyaml yamllint ]; - nativeBuildInputs = [ - setuptools-scm - ]; checkInputs = [ pytestCheckHook ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" + ''; + disabledTests = [ # https://bugzilla.mozilla.org/show_bug.cgi?id=1741668 "test_validate_ping" ]; - pythonImportsCheck = [ "glean_parser" ]; + pythonImportsCheck = [ + "glean_parser" + ]; meta = with lib; { description = "Tools for parsing the metadata for Mozilla's glean telemetry SDK"; homepage = "https://github.com/mozilla/glean_parser"; license = licenses.mpl20; - maintainers = [ maintainers.kvark ]; + maintainers = with maintainers; [ kvark ]; }; } From 73719073f34c7040a4ba422fe2ab9d14361b26be Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 26 Mar 2022 18:26:30 +0100 Subject: [PATCH 2/2] python3Packages.glean-sdk: relax glean_parser constraint - Fix execution of tests - Add missing input --- .../python-modules/glean-sdk/default.nix | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix index f2c2f92c9f0d..8bfc7dcafeda 100644 --- a/pkgs/development/python-modules/glean-sdk/default.nix +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -1,22 +1,27 @@ { lib , buildPythonPackage -, fetchPypi -, rustPlatform -, rustc , cargo -, setuptools-rust -# build inputs , cffi +, fetchPypi , glean-parser +, iso8601 +, pytest-localserver +, pytestCheckHook +, pythonOlder +, rustc +, rustPlatform +, setuptools-rust }: buildPythonPackage rec { pname = "glean-sdk"; version = "44.0.0"; + disabled = pythonOlder "3.6"; + src = fetchPypi { inherit pname version; - sha256 = "sha256-gzLsBwq3wrFde5cEb5+oFLW4KrwoiZpr22JbJhNr1yk="; + hash = "sha256-gzLsBwq3wrFde5cEb5+oFLW4KrwoiZpr22JbJhNr1yk="; }; cargoDeps = rustPlatform.fetchCargoTarball { @@ -26,22 +31,36 @@ buildPythonPackage rec { }; nativeBuildInputs = [ - rustc cargo - setuptools-rust + rustc rustPlatform.cargoSetupHook + setuptools-rust ]; + propagatedBuildInputs = [ cffi glean-parser + iso8601 ]; - pythonImportsCheck = [ "glean" ]; + checkInputs = [ + pytest-localserver + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace glean-core/python/setup.py \ + --replace "glean_parser==5.0.1" "glean_parser>=5.0.1" + ''; + + pythonImportsCheck = [ + "glean" + ]; meta = with lib; { - description = "Modern cross-platform telemetry client libraries and are a part of the Glean project"; + description = "Telemetry client libraries and are a part of the Glean project"; homepage = "https://mozilla.github.io/glean/book/index.html"; license = licenses.mpl20; - maintainers = [ maintainers.kvark ]; + maintainers = with maintainers; [ kvark ]; }; }