pythonPackages.pyhepmc: refactor move to python-modules

added tests
This commit is contained in:
Chris Ostrouchov 2018-10-15 14:58:31 -04:00 committed by Frederik Rietdijk
parent 12067dc30f
commit acfa2e172b
4 changed files with 48 additions and 34 deletions

View File

@ -0,0 +1,47 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, isPy3k
, fetchurl
, pkgs
, python
}:
buildPythonPackage rec {
pname = "pyhepmc";
version = "0.5.0";
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1rbi8gqgclfvaibv9kzhfis11gw101x8amc93qf9y08ny4jfyr1d";
};
patches = [
# merge PR https://bitbucket.org/andybuckley/pyhepmc/pull-requests/1/add-incoming-outgoing-generators-for/diff
./pyhepmc_export_edges.patch
# add bindings to Flow class
./pyhepmc_export_flow.patch
];
# regenerate python wrapper
preConfigure = ''
rm hepmc/hepmcwrap.py
swig -c++ -I${pkgs.hepmc}/include -python hepmc/hepmcwrap.i
'';
buildInputs = [ pkgs.swig pkgs.hepmc ];
HEPMCPATH = pkgs.hepmc;
checkPhase = ''
${python.interpreter} test/test1.py
'';
meta = with stdenv.lib; {
description = "A simple wrapper on the main classes of the HepMC event simulation representation, making it possible to create, read and manipulate HepMC events from Python code";
license = licenses.gpl2;
maintainers = with maintainers; [ veprbl ];
};
}

View File

@ -1500,40 +1500,7 @@ in {
python-ly = callPackage ../development/python-modules/python-ly {}; python-ly = callPackage ../development/python-modules/python-ly {};
pyhepmc = buildPythonPackage rec { pyhepmc = callPackage ../development/python-modules/pyhepmc { };
name = "pyhepmc-${version}";
version = "0.5.0";
disabled = isPy3k;
src = pkgs.fetchurl {
url = "mirror://pypi/p/pyhepmc/${name}.tar.gz";
sha256 = "1rbi8gqgclfvaibv9kzhfis11gw101x8amc93qf9y08ny4jfyr1d";
};
patches = [
# merge PR https://bitbucket.org/andybuckley/pyhepmc/pull-requests/1/add-incoming-outgoing-generators-for/diff
../development/python-modules/pyhepmc_export_edges.patch
# add bindings to Flow class
../development/python-modules/pyhepmc_export_flow.patch
];
# regenerate python wrapper
preConfigure = ''
rm hepmc/hepmcwrap.py
swig -c++ -I${pkgs.hepmc}/include -python hepmc/hepmcwrap.i
'';
buildInputs = with pkgs; [ swig hepmc ];
HEPMCPATH = pkgs.hepmc;
meta = {
description = "A simple wrapper on the main classes of the HepMC event simulation representation, making it possible to create, read and manipulate HepMC events from Python code";
license = licenses.gpl2;
maintainers = with maintainers; [ veprbl ];
platforms = platforms.all;
};
};
pytest = self.pytest_37; pytest = self.pytest_37;