git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #116168 from prusnak/cocotb

python3Packages.cocotb: 1.5.1 -> 1.5.2

commit4753aa83712b2870f091d57fbe06f823465228b5 authorPavol Rusnak <pavol@rusnak.io> dateSun 23 May 2021, 11:37 (5 years ago) parent5478c840f22011
3 files changed+64−17
pkgs/development/python-modules/cocotb-bus/default.nix+35 pkgs/development/python-modules/cocotb/default.nix+27−17 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/cocotb-bus/default.nixnew file+35
@@ -0,0 +1,35 @@
1+{ lib
2+, stdenv
3+, buildPythonPackage
4+, fetchPypi
5+}:
6+
7+buildPythonPackage rec {
8+ pname = "cocotb-bus";
9+ version = "0.1.1";
10+
11+ src = fetchPypi {
12+ inherit pname version;
13+ sha256 = "cc9b0bb00c95061a67f650caf96e3a294bb74ef437124dea456dd9e2a9431854";
14+ };
15+
16+ postPatch = ''
17+ # remove circular dependency cocotb from setup.py
18+ substituteInPlace setup.py --replace '"cocotb>=1.5.0.dev,<2.0"' ""
19+ '';
20+
21+ # tests require cocotb, disable for now to avoid circular dependency
22+ doCheck = false;
23+
24+ # checkPhase = ''
25+ # export PATH=$out/bin:$PATH
26+ # make test
27+ # '';
28+
29+ meta = with lib; {
30+ description = "Pre-packaged testbenching tools and reusable bus interfaces for cocotb";
31+ homepage = "https://github.com/cocotb/cocotb-bus";
32+ license = licenses.bsd3;
33+ maintainers = with maintainers; [ prusnak ];
34+ };
35+}
pkgs/development/python-modules/cocotb/default.nix+27−17
@@ -1,19 +1,31 @@
1−{ lib, stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
1+{ lib
2+, stdenv
3+, buildPythonPackage
4+, fetchPypi
5+, setuptools
6+, setuptools-scm
7+, cocotb-bus
8+, pytest
9+, swig
10+, verilog
11+}:
212
313buildPythonPackage rec {
414 pname = "cocotb";
5− version = "1.5.1";
6−
7− src = fetchFromGitHub {
8− owner = pname;
9− repo = pname;
10− rev = "v${version}";
11− sha256 = "02bw2i03vd4rcvdk10qdjl2lbvvy81cn9qpr8vzq8cm9h45689mv";
15+ version = "1.5.2";
16+
17+ # - we need to use the tarball from PyPi
18+ # or the full git checkout (with .git)
19+ # - using fetchFromGitHub will cause a build failure,
20+ # because it does not include required metadata
21+ src = fetchPypi {
22+ inherit pname version;
23+ sha256 = "9f4f3e6eb9caeb479e98d604770645b57469cd25b39e28df1916ffcd593efbe6";
1224 };
1325
14− propagatedBuildInputs = [
15− setuptools
16− ];
26+ nativeBuildInputs = [ setuptools-scm ];
27+
28+ buildInputs = [ setuptools ];
1729
1830 postPatch = ''
1931 patchShebangs bin/*.py
@@ -25,16 +37,14 @@ buildPythonPackage rec {
2537 do
2638 substituteInPlace $f --replace 'shell which' 'shell command -v'
2739 done
40+
41+ # remove circular dependency cocotb-bus from setup.py
42+ substituteInPlace setup.py --replace "'cocotb-bus<1.0'" ""
2843 '';
2944
30− checkInputs = [ swig verilog ];
45+ checkInputs = [ cocotb-bus pytest swig verilog ];
3146
3247 checkPhase = ''
33− # test expected failures actually pass because of a fix in our icarus version
34− # https://github.com/cocotb/cocotb/issues/1952
35− substituteInPlace tests/test_cases/test_discovery/test_discovery.py \
36− --replace 'def access_single_bit' $'def foo(x): pass\ndef foo'
37−
3848 export PATH=$out/bin:$PATH
3949 make test
4050 '';
pkgs/top-level/python-packages.nix+2
@@ -1481,6 +1481,8 @@ in {
14811481
14821482 cocotb = callPackage ../development/python-modules/cocotb { };
14831483
1484+ cocotb-bus = callPackage ../development/python-modules/cocotb-bus { };
1485+
14841486 codecov = callPackage ../development/python-modules/codecov { };
14851487
14861488 codespell = callPackage ../development/python-modules/codespell { };