From d6fe39ecc251362aaa969abf2304b4bdde712b09 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Nov 2021 08:43:55 -0500 Subject: [PATCH 01/10] maintainers: add kvark --- maintainers/maintainer-list.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 41018c41728b..6b284ce4291e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6344,6 +6344,13 @@ githubId = 449813; name = "Roman Kuznetsov"; }; + kvark = { + name = "Dzmitry Malyshau"; + email = "kvark@fastmail.com"; + matrix = "@kvark:matrix.org"; + github = "kvark"; + githubId = 107301; + }; kwohlfahrt = { email = "kai.wohlfahrt@gmail.com"; github = "kwohlfahrt"; From 634d44ab55add35de6b12fb8d2b8288c40d50560 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Nov 2021 12:28:27 -0500 Subject: [PATCH 02/10] python3Packages.python-hglib: init at 2.6.1 This is required for glean-sdk python module. It uses 2.6.1 specifically. We'd need to relax the requirement and update it to 2.6.2 later. --- .../python-modules/python-hglib/default.nix | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/python-hglib/default.nix diff --git a/pkgs/development/python-modules/python-hglib/default.nix b/pkgs/development/python-modules/python-hglib/default.nix new file mode 100644 index 000000000000..cf0cf42124ab --- /dev/null +++ b/pkgs/development/python-modules/python-hglib/default.nix @@ -0,0 +1,29 @@ +{ lib +, python3Packages +}: + +python3Packages.buildPythonPackage rec { + pname = "python-hglib"; + # https://bugzilla.mozilla.org/show_bug.cgi?id=1741686 + version = "2.6.1"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "sha256-fB+gy00zLdbshAmwR4fOukYj6X+zeGVvfKsLmWxso7I="; + }; + + buildInputs = [ + ]; + + # attempts to create a temporary `HGTMP` folder + doCheck = false; + + pythonImportsCheck = [ "hglib" ]; + + meta = with lib; { + 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; + maintainers = [ maintainers.kvark ]; + }; +} From 313f74cd73924b4b7dfc6f519cbc3f4db7c6c13b Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Nov 2021 12:29:43 -0500 Subject: [PATCH 03/10] python3Packages.glean-parser: init at 4.3.1 Needed as a dependency of glean-sdk, which is needed for moz-phab. --- .../python-modules/glean-parser/default.nix | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/glean-parser/default.nix diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix new file mode 100644 index 000000000000..4b631a45ded0 --- /dev/null +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -0,0 +1,49 @@ +{ lib +, pkgs +, python3Packages +, setuptools-scm +}: + +python3Packages.buildPythonPackage rec { + pname = "glean_parser"; + version = "4.3.1"; + + disabled = python3Packages.pythonOlder "3.6"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "sha256-wZSro1pX/50TlSfFMh71JlmXlJlONVutTDFL06tkw+s="; + }; + + propagatedBuildInputs = with python3Packages; [ + appdirs + click + diskcache + jinja2 + jsonschema + pytest + pytest-runner + pyyaml + yamllint + ]; + nativeBuildInputs = [ + setuptools-scm + ]; + + checkInputs = [ + python3Packages.pytestCheckHook + ]; + disabledTests = [ + # https://bugzilla.mozilla.org/show_bug.cgi?id=1741668 + "test_validate_ping" + ]; + + 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 ]; + }; +} From a811dea815a5494928c46851cc149f91133b0721 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Nov 2021 12:30:27 -0500 Subject: [PATCH 04/10] python3Packages.glean-sdk: init at 42.2.0 Needed for moz-phab. --- .../python-modules/glean-sdk/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 6 +++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/glean-sdk/default.nix diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix new file mode 100644 index 000000000000..926bf01308d5 --- /dev/null +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -0,0 +1,42 @@ +{ lib +, pkgs +, python3Packages +, rustPlatform +, setuptools-rust +}: + +python3Packages.buildPythonPackage rec { + pname = "glean-sdk"; + version = "42.2.0"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "sha256-X2p6KQnEB6ZHdCHGFVEoEMiI+0R2vfGqel+jFKTcx74="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + sha256 = "sha256-/+rKGPYTLovgjTGL2F/pWzlUy1tY207yuJz3Xdhm1hg="; + }; + + nativeBuildInputs = [ + pkgs.rustc + pkgs.cargo + setuptools-rust + rustPlatform.cargoSetupHook + ]; + propagatedBuildInputs = with python3Packages; [ + cffi + glean-parser + ]; + + pythonImportsCheck = [ "glean" ]; + + meta = with lib; { + description = "Modern cross-platform 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 87b06b9eb148..6e733af61eed 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3126,6 +3126,10 @@ in { glcontext = callPackage ../development/python-modules/glcontext { }; + glean-parser = callPackage ../development/python-modules/glean-parser { }; + + glean-sdk = callPackage ../development/python-modules/glean-sdk { }; + glfw = callPackage ../development/python-modules/glfw { }; glob2 = callPackage ../development/python-modules/glob2 { }; @@ -7533,6 +7537,8 @@ in { python-gvm = callPackage ../development/python-modules/python-gvm { }; + python-hglib = callPackage ../development/python-modules/python-hglib { }; + python-hosts = callPackage ../development/python-modules/python-hosts { }; python-hpilo = callPackage ../development/python-modules/python-hpilo { }; From 51324da2e02964d9ed2fe24413d138f57abde1fb Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 17 Nov 2021 12:30:53 -0500 Subject: [PATCH 05/10] moz-phab: init at 0.1.99 The official Mozilla tool for code submissions. Needed to do anything useful on NixOS with Mozilla code. --- pkgs/applications/misc/moz-phab/default.nix | 38 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 pkgs/applications/misc/moz-phab/default.nix diff --git a/pkgs/applications/misc/moz-phab/default.nix b/pkgs/applications/misc/moz-phab/default.nix new file mode 100644 index 000000000000..217bbe537083 --- /dev/null +++ b/pkgs/applications/misc/moz-phab/default.nix @@ -0,0 +1,38 @@ +{ lib, python3Packages, pkgs }: + +python3Packages.buildPythonApplication rec { + pname = "MozPhab"; + version = "0.1.99"; + + src = python3Packages.fetchPypi { + inherit pname version; + sha256 = "sha256-uKoMMSp5AIvB1qTRYAh7n1+2dDLneFbssfkfTTshfcs="; + }; + + propagatedBuildInputs = with python3Packages; [ + distro + glean-sdk + python-hglib + sentry-sdk + setuptools + ]; + buildInputs = [ + pkgs.mercurial + ]; + + # https://bugzilla.mozilla.org/show_bug.cgi?id=1741683 + doCheck = false; + + meta = with lib; { + description = "Phabricator CLI from Mozilla to support submission of a series of commits"; + longDescription = '' + moz-phab is a custom command-line tool, which communicates to + Phabricator’s API, providing several conveniences, including support for + submitting series of commits. + ''; + homepage = "https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html"; + license = licenses.mpl20; + maintainers = [ maintainers.kvark ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 94c1272776df..184f3696834e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7047,6 +7047,8 @@ with pkgs; motion = callPackage ../applications/video/motion { }; + moz-phab = callPackage ../applications/misc/moz-phab { }; + mtail = callPackage ../servers/monitoring/mtail { }; multitail = callPackage ../tools/misc/multitail { }; From 34db5494488846b12fda5ddf0aa52edf3c9d2aae Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 18 Nov 2021 09:37:48 -0500 Subject: [PATCH 06/10] python3Packages.glean-sdk: apply patch for process environments --- .../python-modules/glean-sdk/default.nix | 7 +++++++ .../python-modules/glean-sdk/pr-1542.patch | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/development/python-modules/glean-sdk/pr-1542.patch diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix index 926bf01308d5..551efd480124 100644 --- a/pkgs/development/python-modules/glean-sdk/default.nix +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -3,6 +3,7 @@ , python3Packages , rustPlatform , setuptools-rust +, fetchpatch }: python3Packages.buildPythonPackage rec { @@ -14,6 +15,12 @@ python3Packages.buildPythonPackage rec { sha256 = "sha256-X2p6KQnEB6ZHdCHGFVEoEMiI+0R2vfGqel+jFKTcx74="; }; + patches = [ + # Fix the environment for spawned process + # https://github.com/mozilla/glean/pull/1542 + ./pr-1542.patch + ]; + cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; diff --git a/pkgs/development/python-modules/glean-sdk/pr-1542.patch b/pkgs/development/python-modules/glean-sdk/pr-1542.patch new file mode 100644 index 000000000000..f9a7b2723eba --- /dev/null +++ b/pkgs/development/python-modules/glean-sdk/pr-1542.patch @@ -0,0 +1,20 @@ +diff --git a/glean-core/python/glean/_process_dispatcher.py b/glean-core/python/glean/_process_dispatcher.py +index 33a8b12796..a39b54a917 100644 +--- a/glean-core/python/glean/_process_dispatcher.py ++++ b/glean-core/python/glean/_process_dispatcher.py +@@ -120,8 +120,14 @@ def dispatch(cls, func, args) -> Union[_SyncWorkWrapper, subprocess.Popen]: + Path(".coveragerc").absolute() + ) + ++ # Explicitly pass the contents of `sys.path` as `PYTHONPATH` to the ++ # subprocess so that there aren't any module search path ++ # differences. ++ python_path = ":".join(sys.path)[1:] ++ + p = subprocess.Popen( +- [sys.executable, _process_dispatcher_helper.__file__, payload] ++ [sys.executable, _process_dispatcher_helper.__file__, payload], ++ env={"PYTHONPATH": python_path}, + ) + + cls._last_process = p From ca7a71747d195affa8217401e26f8f81dbf02691 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 19 Nov 2021 10:25:21 -0500 Subject: [PATCH 07/10] moz-phab: enable tests, remove pkgs dependency --- pkgs/applications/misc/moz-phab/D131618.diff | 13 ++++++++ pkgs/applications/misc/moz-phab/default.nix | 33 ++++++++++++++----- .../python-modules/glean-parser/default.nix | 30 ++++++++++++----- .../python-modules/glean-sdk/default.nix | 20 ++++++----- .../python-modules/python-hglib/default.nix | 23 +++++++------ pkgs/top-level/all-packages.nix | 2 +- 6 files changed, 85 insertions(+), 36 deletions(-) create mode 100644 pkgs/applications/misc/moz-phab/D131618.diff diff --git a/pkgs/applications/misc/moz-phab/D131618.diff b/pkgs/applications/misc/moz-phab/D131618.diff new file mode 100644 index 000000000000..6d415242f465 --- /dev/null +++ b/pkgs/applications/misc/moz-phab/D131618.diff @@ -0,0 +1,13 @@ +diff --git a/setup.py b/setup.py +--- a/setup.py ++++ b/setup.py +@@ -15,7 +15,7 @@ + install_requires=[ + "distro", + "glean-sdk>=36.0.0", +- "python-hglib==2.6.1", ++ "python-hglib>=2.6.2", + "sentry-sdk>=0.14.3", + "setuptools", + ], + diff --git a/pkgs/applications/misc/moz-phab/default.nix b/pkgs/applications/misc/moz-phab/default.nix index 217bbe537083..3ed14b69d612 100644 --- a/pkgs/applications/misc/moz-phab/default.nix +++ b/pkgs/applications/misc/moz-phab/default.nix @@ -1,27 +1,44 @@ -{ lib, python3Packages, pkgs }: +{ lib +, buildPythonApplication +, fetchPypi +, mercurial +# build inputs +, distro +, glean-sdk +, python-hglib +, sentry-sdk +, setuptools +}: -python3Packages.buildPythonApplication rec { +buildPythonApplication rec { pname = "MozPhab"; version = "0.1.99"; - src = python3Packages.fetchPypi { + src = fetchPypi { inherit pname version; sha256 = "sha256-uKoMMSp5AIvB1qTRYAh7n1+2dDLneFbssfkfTTshfcs="; }; - propagatedBuildInputs = with python3Packages; [ + patches = [ + # Relax python-hglib requirement + # https://phabricator.services.mozilla.com/D131618 + ./D131618.diff + ]; + + propagatedBuildInputs = [ distro glean-sdk python-hglib sentry-sdk setuptools ]; - buildInputs = [ - pkgs.mercurial + checkInputs = [ + mercurial ]; - # https://bugzilla.mozilla.org/show_bug.cgi?id=1741683 - doCheck = false; + preCheck = '' + export HOME=$(mktemp -d) + ''; meta = with lib; { description = "Phabricator CLI from Mozilla to support submission of a series of commits"; diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index 4b631a45ded0..a9b475971490 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -1,28 +1,38 @@ { lib -, pkgs -, python3Packages +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pytest +, pytest-runner +, pythonOlder , setuptools-scm +# build inputs +, appdirs +, click +, diskcache +, jinja2 +, jsonschema +, pyyaml +, yamllint }: -python3Packages.buildPythonPackage rec { +buildPythonPackage rec { pname = "glean_parser"; version = "4.3.1"; - disabled = python3Packages.pythonOlder "3.6"; + disabled = pythonOlder "3.6"; - src = python3Packages.fetchPypi { + src = fetchPypi { inherit pname version; sha256 = "sha256-wZSro1pX/50TlSfFMh71JlmXlJlONVutTDFL06tkw+s="; }; - propagatedBuildInputs = with python3Packages; [ + propagatedBuildInputs = [ appdirs click diskcache jinja2 jsonschema - pytest - pytest-runner pyyaml yamllint ]; @@ -31,7 +41,9 @@ python3Packages.buildPythonPackage rec { ]; checkInputs = [ - python3Packages.pytestCheckHook + pytestCheckHook + pytest + pytest-runner ]; disabledTests = [ # https://bugzilla.mozilla.org/show_bug.cgi?id=1741668 diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix index 551efd480124..ac9d4b5c7784 100644 --- a/pkgs/development/python-modules/glean-sdk/default.nix +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -1,16 +1,20 @@ { lib -, pkgs -, python3Packages +, buildPythonPackage +, fetchPypi , rustPlatform +, rustc +, cargo , setuptools-rust -, fetchpatch +# build inputs +, cffi +, glean-parser }: -python3Packages.buildPythonPackage rec { +buildPythonPackage rec { pname = "glean-sdk"; version = "42.2.0"; - src = python3Packages.fetchPypi { + src = fetchPypi { inherit pname version; sha256 = "sha256-X2p6KQnEB6ZHdCHGFVEoEMiI+0R2vfGqel+jFKTcx74="; }; @@ -28,12 +32,12 @@ python3Packages.buildPythonPackage rec { }; nativeBuildInputs = [ - pkgs.rustc - pkgs.cargo + rustc + cargo setuptools-rust rustPlatform.cargoSetupHook ]; - propagatedBuildInputs = with python3Packages; [ + propagatedBuildInputs = [ cffi glean-parser ]; diff --git a/pkgs/development/python-modules/python-hglib/default.nix b/pkgs/development/python-modules/python-hglib/default.nix index cf0cf42124ab..9d667dcba853 100644 --- a/pkgs/development/python-modules/python-hglib/default.nix +++ b/pkgs/development/python-modules/python-hglib/default.nix @@ -1,22 +1,25 @@ { lib -, python3Packages +, buildPythonPackage +, fetchPypi +, mercurial +, nose }: -python3Packages.buildPythonPackage rec { +buildPythonPackage rec { pname = "python-hglib"; - # https://bugzilla.mozilla.org/show_bug.cgi?id=1741686 - version = "2.6.1"; + version = "2.6.2"; - src = python3Packages.fetchPypi { + src = fetchPypi { inherit pname version; - sha256 = "sha256-fB+gy00zLdbshAmwR4fOukYj6X+zeGVvfKsLmWxso7I="; + sha256 = "sha256-sYvR7VPJDuV9VxTWata7crZOkw1K7KmDCJLAi7KNpgg="; }; - buildInputs = [ - ]; + checkInputs = [ mercurial nose ]; - # attempts to create a temporary `HGTMP` folder - doCheck = false; + preCheck = '' + export HGTMP=$(mktemp -d) + export HGUSER=test + ''; pythonImportsCheck = [ "hglib" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 184f3696834e..1e5e961327e4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7047,7 +7047,7 @@ with pkgs; motion = callPackage ../applications/video/motion { }; - moz-phab = callPackage ../applications/misc/moz-phab { }; + moz-phab = python3Packages.callPackage ../applications/misc/moz-phab { }; mtail = callPackage ../servers/monitoring/mtail { }; From 836ba699decfea81318f5219830182884312b812 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 19 Nov 2021 12:25:50 -0500 Subject: [PATCH 08/10] moz-phab: rename patch files --- pkgs/applications/misc/moz-phab/default.nix | 9 +++++---- .../moz-phab/{D131618.diff => relax-hglib-version.diff} | 0 pkgs/development/python-modules/glean-parser/default.nix | 2 -- pkgs/development/python-modules/glean-sdk/default.nix | 2 +- ...-1542.patch => fix-spawned-process-environment.patch} | 0 5 files changed, 6 insertions(+), 7 deletions(-) rename pkgs/applications/misc/moz-phab/{D131618.diff => relax-hglib-version.diff} (100%) rename pkgs/development/python-modules/glean-sdk/{pr-1542.patch => fix-spawned-process-environment.patch} (100%) diff --git a/pkgs/applications/misc/moz-phab/default.nix b/pkgs/applications/misc/moz-phab/default.nix index 3ed14b69d612..9666f974957a 100644 --- a/pkgs/applications/misc/moz-phab/default.nix +++ b/pkgs/applications/misc/moz-phab/default.nix @@ -11,18 +11,19 @@ }: buildPythonApplication rec { - pname = "MozPhab"; + pname = "moz-phab"; version = "0.1.99"; src = fetchPypi { - inherit pname version; + pname = "MozPhab"; + inherit version; sha256 = "sha256-uKoMMSp5AIvB1qTRYAh7n1+2dDLneFbssfkfTTshfcs="; }; patches = [ # Relax python-hglib requirement # https://phabricator.services.mozilla.com/D131618 - ./D131618.diff + ./relax-hglib-version.diff ]; propagatedBuildInputs = [ @@ -50,6 +51,6 @@ buildPythonApplication rec { homepage = "https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html"; license = licenses.mpl20; maintainers = [ maintainers.kvark ]; - platforms = platforms.all; + platforms = platforms.unix; }; } diff --git a/pkgs/applications/misc/moz-phab/D131618.diff b/pkgs/applications/misc/moz-phab/relax-hglib-version.diff similarity index 100% rename from pkgs/applications/misc/moz-phab/D131618.diff rename to pkgs/applications/misc/moz-phab/relax-hglib-version.diff diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index a9b475971490..feca6979b429 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , fetchPypi , pytestCheckHook -, pytest , pytest-runner , pythonOlder , setuptools-scm @@ -42,7 +41,6 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook - pytest pytest-runner ]; disabledTests = [ diff --git a/pkgs/development/python-modules/glean-sdk/default.nix b/pkgs/development/python-modules/glean-sdk/default.nix index ac9d4b5c7784..e729d927cdae 100644 --- a/pkgs/development/python-modules/glean-sdk/default.nix +++ b/pkgs/development/python-modules/glean-sdk/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { patches = [ # Fix the environment for spawned process # https://github.com/mozilla/glean/pull/1542 - ./pr-1542.patch + ./fix-spawned-process-environment.patch ]; cargoDeps = rustPlatform.fetchCargoTarball { diff --git a/pkgs/development/python-modules/glean-sdk/pr-1542.patch b/pkgs/development/python-modules/glean-sdk/fix-spawned-process-environment.patch similarity index 100% rename from pkgs/development/python-modules/glean-sdk/pr-1542.patch rename to pkgs/development/python-modules/glean-sdk/fix-spawned-process-environment.patch From cbfec29e810db7d49221cd4e840df66c9fd9402d Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 25 Nov 2021 11:18:07 -0500 Subject: [PATCH 09/10] moz-phab: use substituteInPlace instead of a patch --- pkgs/applications/misc/moz-phab/default.nix | 11 ++++++----- .../misc/moz-phab/relax-hglib-version.diff | 13 ------------- 2 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 pkgs/applications/misc/moz-phab/relax-hglib-version.diff diff --git a/pkgs/applications/misc/moz-phab/default.nix b/pkgs/applications/misc/moz-phab/default.nix index 9666f974957a..886e06a382bd 100644 --- a/pkgs/applications/misc/moz-phab/default.nix +++ b/pkgs/applications/misc/moz-phab/default.nix @@ -20,11 +20,12 @@ buildPythonApplication rec { sha256 = "sha256-uKoMMSp5AIvB1qTRYAh7n1+2dDLneFbssfkfTTshfcs="; }; - patches = [ - # Relax python-hglib requirement - # https://phabricator.services.mozilla.com/D131618 - ./relax-hglib-version.diff - ]; + # Relax python-hglib requirement + # https://phabricator.services.mozilla.com/D131618 + postPatch = '' + substituteInPlace setup.py \ + --replace "==" ">=" + ''; propagatedBuildInputs = [ distro diff --git a/pkgs/applications/misc/moz-phab/relax-hglib-version.diff b/pkgs/applications/misc/moz-phab/relax-hglib-version.diff deleted file mode 100644 index 6d415242f465..000000000000 --- a/pkgs/applications/misc/moz-phab/relax-hglib-version.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/setup.py b/setup.py ---- a/setup.py -+++ b/setup.py -@@ -15,7 +15,7 @@ - install_requires=[ - "distro", - "glean-sdk>=36.0.0", -- "python-hglib==2.6.1", -+ "python-hglib>=2.6.2", - "sentry-sdk>=0.14.3", - "setuptools", - ], - From 6bd0a5beac9618aeb25124074c4bc197df3b8703 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 29 Nov 2021 08:32:07 -0500 Subject: [PATCH 10/10] glean-parser: disable pytest-runner --- pkgs/development/python-modules/glean-parser/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/glean-parser/default.nix b/pkgs/development/python-modules/glean-parser/default.nix index feca6979b429..8a774e660751 100644 --- a/pkgs/development/python-modules/glean-parser/default.nix +++ b/pkgs/development/python-modules/glean-parser/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , fetchPypi , pytestCheckHook -, pytest-runner , pythonOlder , setuptools-scm # build inputs @@ -26,6 +25,10 @@ buildPythonPackage rec { sha256 = "sha256-wZSro1pX/50TlSfFMh71JlmXlJlONVutTDFL06tkw+s="; }; + postPatch = '' + substituteInPlace setup.py --replace "pytest-runner" "" + ''; + propagatedBuildInputs = [ appdirs click @@ -41,7 +44,6 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook - pytest-runner ]; disabledTests = [ # https://bugzilla.mozilla.org/show_bug.cgi?id=1741668