From edf6a2bbf2b0282fcdc2333344abaa36aaa3b33a Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sat, 27 Jul 2024 16:48:31 -0400 Subject: [PATCH 1/5] python312Packages.python-hglib: Remove nose dependency --- .../python-modules/python-hglib/default.nix | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/python-hglib/default.nix b/pkgs/development/python-modules/python-hglib/default.nix index 528316240c0a2fd..8477de756358a11 100644 --- a/pkgs/development/python-modules/python-hglib/default.nix +++ b/pkgs/development/python-modules/python-hglib/default.nix @@ -1,9 +1,10 @@ { lib, buildPythonPackage, - fetchPypi, + fetchzip, mercurial, - nose, + pytestCheckHook, + fetchpatch2, }: buildPythonPackage rec { @@ -11,14 +12,28 @@ buildPythonPackage rec { version = "2.6.2"; format = "setuptools"; - src = fetchPypi { - inherit pname version; - hash = "sha256-sYvR7VPJDuV9VxTWata7crZOkw1K7KmDCJLAi7KNpgg="; + src = fetchzip { + url = "https://repo.mercurial-scm.org/python-hglib/archive/${version}.tar.gz"; + hash = "sha256-UXersegqJ9VAxy4Kvpb2IiOJfQbWryeeaGvwiR4ncW8="; }; + patches = [ + (fetchpatch2 { + name = "remove-nose.patch"; + excludes = [ "heptapod-ci.yml" ]; + url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/8341f2494b3f"; + hash = "sha256-4gicVCAH94itxHY0l8ek0L/RVhUrw2lMbbnENbWrV6U="; + }) + (fetchpatch2 { + name = "fix-tests.patch"; + url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/a2afbf236ca8"; + hash = "sha256-T/yKJ8cMMOBVk24SXwyPOoD321S1fZEIunaPJAxI0KI="; + }) + ]; + nativeCheckInputs = [ mercurial - nose + pytestCheckHook ]; preCheck = '' From ea02102a7c0f3eb77e9c536614e714c73c6fb048 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sun, 28 Jul 2024 17:13:58 -0400 Subject: [PATCH 2/5] python312Packages.glean-parser: 4.1.2 -> 4.3.0 --- .../python-modules/glean-parser/default.nix | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index 8196b35ce3637db..c36ca579afe94ca 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -8,43 +8,39 @@ jinja2, jsonschema, pytestCheckHook, - pythonOlder, pyyaml, setuptools, setuptools-scm, - yamllint, }: buildPythonPackage rec { pname = "glean-parser"; - version = "14.1.2"; - format = "setuptools"; - - disabled = pythonOlder "3.8"; + version = "14.3.0"; + pyproject = true; src = fetchPypi { pname = "glean_parser"; inherit version; - hash = "sha256-OL59Tg+rD4M0DjQnkU4IqGMcf6sIioxg6bVDyrbqgww="; + hash = "sha256-tI1kMCn7gksLdq2ytKAOiKSd5OxHmsnFrdUsUR6b5IE="; }; postPatch = '' substituteInPlace setup.py \ - --replace "pytest-runner" "" \ - --replace "MarkupSafe>=1.1.1,<=2.0.1" "MarkupSafe>=1.1.1" + --replace-fail "pytest-runner" "" ''; - nativeBuildInputs = [ setuptools-scm ]; + build-system = [ + setuptools + setuptools-scm + ]; - propagatedBuildInputs = [ + dependencies = [ appdirs click diskcache jinja2 jsonschema pyyaml - setuptools - yamllint ]; nativeCheckInputs = [ pytestCheckHook ]; @@ -63,12 +59,12 @@ buildPythonPackage rec { pythonImportsCheck = [ "glean_parser" ]; - meta = with lib; { + meta = { description = "Tools for parsing the metadata for Mozilla's glean telemetry SDK"; mainProgram = "glean_parser"; homepage = "https://github.com/mozilla/glean_parser"; changelog = "https://github.com/mozilla/glean_parser/blob/v${version}/CHANGELOG.md"; - license = licenses.mpl20; + license = lib.licenses.mpl20; maintainers = [ ]; }; } From 2ec9bc5d5b5c0a2df98049b859439f6636d3276c Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sun, 28 Jul 2024 17:14:18 -0400 Subject: [PATCH 3/5] python312Packages.glean-sdk: 52.7.0 -> 60.4.0 --- .../python-modules/glean-sdk/default.nix | 56 +++++++------------ pkgs/top-level/python-packages.nix | 4 +- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix index 6a577a000f60b77..5dea3e4736652ef 100644 --- a/pkgs/development/python-modules/glean-sdk/default.nix +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -2,55 +2,41 @@ stdenv, lib, buildPythonPackage, - cargo, - cffi, - fetchPypi, + fetchFromGitHub, glean-parser, - iso8601, - lmdb, - pkg-config, pytest-localserver, pytestCheckHook, - python, - pythonOlder, - rustc, rustPlatform, semver, - setuptools-rust, + setuptools, }: buildPythonPackage rec { pname = "glean-sdk"; - version = "52.7.0"; - format = "setuptools"; + version = "60.4.0"; + pyproject = true; - disabled = pythonOlder "3.6"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-sLjdGHiS7Co/oA9gQyAFkD14tAYjmwjWcPr4CRrzw/0="; + src = fetchFromGitHub { + owner = "mozilla"; + repo = "glean"; + rev = "v${version}"; + hash = "sha256-C3wQdxPNBPQN6eUK6Vq0bA6Wpqb28e9BTBf7c/hTQxU="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; - hash = "sha256-5TlgWcLmjklxhtDbB0aRF71iIRTJwetFj1Jii1DGdvU="; + hash = "sha256-XqOCHnvM64kZNifU5Wt/bFAvyRVy28ozWSwlvm/sMk8="; }; - nativeBuildInputs = [ - cargo - pkg-config - rustc + build-system = [ rustPlatform.cargoSetupHook - setuptools-rust + rustPlatform.maturinBuildHook + setuptools ]; - buildInputs = [ lmdb ]; - - propagatedBuildInputs = [ - cffi + dependencies = [ glean-parser - iso8601 semver ]; @@ -59,23 +45,23 @@ buildPythonPackage rec { pytestCheckHook ]; + pytestFlagsArray = [ "glean-core/python/tests" ]; + disabledTests = [ # RuntimeError: No ping received. "test_client_activity_api" "test_flipping_upload_enabled_respects_order_of_events" + # A warning causes this test to fail + "test_get_language_tag_reports_the_tag_for_the_default_locale" ]; - postInstallCheck = lib.optionalString stdenv.hostPlatform.isElf '' - readelf -a $out/${python.sitePackages}/glean/libglean_ffi.so | grep -F 'Shared library: [liblmdb.so' - ''; - pythonImportsCheck = [ "glean" ]; - meta = with lib; { + meta = { broken = stdenv.isDarwin; 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 = with maintainers; [ melling ]; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ melling ]; }; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b515694b0b91b98..73187b49b259e77 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4968,9 +4968,7 @@ self: super: with self; { glean-parser = callPackage ../development/python-modules/glean-parser { }; - glean-sdk = callPackage ../development/python-modules/glean-sdk { - inherit (pkgs) lmdb; - }; + glean-sdk = callPackage ../development/python-modules/glean-sdk { }; glfw = callPackage ../development/python-modules/glfw { }; From 531e796aff9d8eddf31db6d2a0fe54ca89c21ae5 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sun, 28 Jul 2024 18:13:17 -0400 Subject: [PATCH 4/5] mozphab: Disable failing tests --- pkgs/applications/misc/mozphab/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/misc/mozphab/default.nix b/pkgs/applications/misc/mozphab/default.nix index 4c7bd07f6eeb3d8..6a08104129821a4 100644 --- a/pkgs/applications/misc/mozphab/default.nix +++ b/pkgs/applications/misc/mozphab/default.nix @@ -57,6 +57,14 @@ python3.pkgs.buildPythonApplication rec { export HOME=$(mktemp -d) ''; + disabledTests = [ + # AttributeError: 'called_once' is not a valid assertion. + "test_commit" + # AttributeError: 'not_called' is not a valid assertion. + "test_finalize_no_evolve" + "test_patch" + ]; + disabledTestPaths = [ # codestyle doesn't matter to us "tests/test_style.py" From 43a5b1e66c17a66c08baba67861907f308e26678 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Mon, 29 Jul 2024 12:42:24 -0400 Subject: [PATCH 5/5] python312Packages.python-hglib: modernize --- .../python-modules/python-hglib/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/python-hglib/default.nix b/pkgs/development/python-modules/python-hglib/default.nix index 8477de756358a11..71e9bd7318ea46b 100644 --- a/pkgs/development/python-modules/python-hglib/default.nix +++ b/pkgs/development/python-modules/python-hglib/default.nix @@ -5,12 +5,13 @@ mercurial, pytestCheckHook, fetchpatch2, + setuptools, }: buildPythonPackage rec { pname = "python-hglib"; version = "2.6.2"; - format = "setuptools"; + pyproject = true; src = fetchzip { url = "https://repo.mercurial-scm.org/python-hglib/archive/${version}.tar.gz"; @@ -21,16 +22,18 @@ buildPythonPackage rec { (fetchpatch2 { name = "remove-nose.patch"; excludes = [ "heptapod-ci.yml" ]; - url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/8341f2494b3f"; + url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/8341f2494b3fc1c0d9ee55fa4487c0ac82f64d2a"; hash = "sha256-4gicVCAH94itxHY0l8ek0L/RVhUrw2lMbbnENbWrV6U="; }) (fetchpatch2 { name = "fix-tests.patch"; - url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/a2afbf236ca8"; + url = "https://repo.mercurial-scm.org/python-hglib/raw-rev/a2afbf236ca86287e72f54e1248413625d1bc405"; hash = "sha256-T/yKJ8cMMOBVk24SXwyPOoD321S1fZEIunaPJAxI0KI="; }) ]; + build-system = [ setuptools ]; + nativeCheckInputs = [ mercurial pytestCheckHook @@ -43,10 +46,10 @@ buildPythonPackage rec { pythonImportsCheck = [ "hglib" ]; - meta = with lib; { + meta = { description = "Library with a fast, convenient interface to Mercurial. It uses Mercurial’s command server for communication with hg"; homepage = "https://www.mercurial-scm.org/wiki/PythonHglibs"; - license = licenses.mit; + license = lib.licenses.mit; maintainers = [ ]; }; }