From 65d7bef16dae3f21b9b2b06cb1715a83907c9ca4 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 29 Jan 2025 20:06:14 +0200 Subject: [PATCH] {smi,tools-common}: pin textual --- pkgs/smi/default.nix | 2 +- pkgs/tools-common/default.nix | 33 ++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/pkgs/smi/default.nix b/pkgs/smi/default.nix index 325e4b0..d2ac140 100644 --- a/pkgs/smi/default.nix +++ b/pkgs/smi/default.nix @@ -39,7 +39,6 @@ buildPythonPackage rec { propagatedBuildInputs = [ setuptools requests - textual black distro elasticsearch @@ -51,6 +50,7 @@ buildPythonPackage rec { importlib-resources pkgs.pre-commit tools-common + tools-common.textual ]; dontUsePytestCheck = true; # no tests diff --git a/pkgs/tools-common/default.nix b/pkgs/tools-common/default.nix index dac5b00..a5706e9 100644 --- a/pkgs/tools-common/default.nix +++ b/pkgs/tools-common/default.nix @@ -1,13 +1,28 @@ -{ pkgs }: +{ fetchFromGitHub, python3Packages }: -with pkgs.python3Packages; +let + # Can be unpinned once https://github.com/tenstorrent/tt-tools-common/blob/main/pyproject.toml#L32 + # is v1 + textual_0_82 = python3Packages.textual.overridePythonAttrs (old: rec { + version = "0.82.0"; + src = fetchFromGitHub { + owner = "Textualize"; + repo = "textual"; + rev = "refs/tags/v${version}"; + hash = "sha256-belpoXQ+CkTchK+FjI/Ur8v4cNgzX39xLdNfPCwaU6E="; + }; + disabledTests = old.disabledTests ++ [ + "test_selection" + ]; + }); +in -buildPythonPackage rec { +python3Packages.buildPythonPackage rec { pname = "tools-common"; # https://github.com/tenstorrent/tt-smi/blob/main/pyproject.toml#L31 version = "1.4.11"; - src = pkgs.fetchFromGitHub { + src = fetchFromGitHub { owner = "tenstorrent"; repo = "tt-tools-common"; rev = "refs/tags/v${version}"; @@ -16,7 +31,7 @@ buildPythonPackage rec { format = "pyproject"; - nativeBuildInputs = [ pythonRelaxDepsHook ]; + nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ]; pythonRelaxDeps = [ "distro" @@ -29,14 +44,14 @@ buildPythonPackage rec { "tqdm" ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3Packages; [ setuptools distro elasticsearch psutil pyyaml rich - textual + textual_0_82 requests jsons tqdm @@ -46,4 +61,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "tt_tools_common" ]; + + passthru = { + textual = textual_0_82; + }; }