From 304052dd3ee549e0c6469724db181fed5c306576 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 17 Sep 2022 19:49:15 +0000 Subject: [PATCH 1/2] python310Packages.cocotb: 1.6.2 -> 1.7.1 --- pkgs/development/python-modules/cocotb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix index 83ed76ac8669..2de6a853c667 100644 --- a/pkgs/development/python-modules/cocotb/default.nix +++ b/pkgs/development/python-modules/cocotb/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "cocotb"; - version = "1.6.2"; + version = "1.7.1"; # - we need to use the tarball from PyPi # or the full git checkout (with .git) @@ -20,7 +20,7 @@ buildPythonPackage rec { # because it does not include required metadata src = fetchPypi { inherit pname version; - sha256 = "sha256-SY+1727DbWMg6CnmHw8k/VP0dwBRYszn+YyyvZXgvUs="; + sha256 = "sha256-HzkLtkaNcOBKzr65/wW1S+Qsu7u7O9bHXR7Ao2y5fiM="; }; nativeBuildInputs = [ setuptools-scm ]; From 6165ee3d3598c85f27ca81f5e61ad719c227e9b8 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 18 Sep 2022 12:55:50 +0100 Subject: [PATCH 2/2] python3Packages.cocotb: make tests actually run --- .../python-modules/cocotb/default.nix | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix index 2de6a853c667..688fc7c367bc 100644 --- a/pkgs/development/python-modules/cocotb/default.nix +++ b/pkgs/development/python-modules/cocotb/default.nix @@ -1,7 +1,7 @@ { lib , stdenv , buildPythonPackage -, fetchPypi +, fetchFromGitHub , setuptools , setuptools-scm , cocotb-bus @@ -14,13 +14,12 @@ buildPythonPackage rec { pname = "cocotb"; version = "1.7.1"; - # - we need to use the tarball from PyPi - # or the full git checkout (with .git) - # - using fetchFromGitHub will cause a build failure, - # because it does not include required metadata - src = fetchPypi { - inherit pname version; - sha256 = "sha256-HzkLtkaNcOBKzr65/wW1S+Qsu7u7O9bHXR7Ao2y5fiM="; + # pypi source doesn't include tests + src = fetchFromGitHub { + owner = "cocotb"; + repo = "cocotb"; + rev = "v${version}"; + sha256 = "sha256-wACgT5r0YmSYvLhTsuFhTcJqeCtGGLifOmr7/Lz2Vug="; }; nativeBuildInputs = [ setuptools-scm ]; @@ -52,11 +51,13 @@ buildPythonPackage rec { ]; checkInputs = [ cocotb-bus pytestCheckHook swig verilog ]; - - checkPhase = '' + preCheck = '' export PATH=$out/bin:$PATH + mv cocotb cocotb.hidden ''; + pythonImportsCheck = [ "cocotb" ]; + meta = with lib; { description = "Coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python"; homepage = "https://github.com/cocotb/cocotb";