Merge pull request #62544 from risicle/ris-django-silk-fix
pythonPackages.django_silk: fix build, enable tests
This commit is contained in:
commit
6e448db9d6
@ -1,6 +1,7 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchPypi
|
, python
|
||||||
|
, fetchFromGitHub
|
||||||
, django
|
, django
|
||||||
, pygments
|
, pygments
|
||||||
, simplejson
|
, simplejson
|
||||||
@ -12,26 +13,50 @@
|
|||||||
, pytz
|
, pytz
|
||||||
, pillow
|
, pillow
|
||||||
, mock
|
, mock
|
||||||
|
, gprof2dot
|
||||||
|
, freezegun
|
||||||
|
, contextlib2
|
||||||
|
, networkx
|
||||||
|
, pydot
|
||||||
|
, factory_boy
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "django-silk";
|
pname = "django-silk";
|
||||||
version = "3.0.2";
|
version = "3.0.2";
|
||||||
|
|
||||||
src = fetchPypi {
|
# pypi tarball doesn't include test project
|
||||||
inherit pname version;
|
src = fetchFromGitHub {
|
||||||
sha256 = "8dd5b78531360bd8c3d571384f9f4f82ef03e1764e30dd4621c5638f5c973a1d";
|
owner = "jazzband";
|
||||||
|
repo = "django-silk";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "1fbaafc2gx01gscdalp6hj6bz4b0cmq59lgmvsydw7jkds4mps7c";
|
||||||
};
|
};
|
||||||
|
# "test_time_taken" tests aren't suitable for reproducible execution, but django's
|
||||||
doCheck = false;
|
# test runner doesn't have an easy way to ignore tests - so instead prevent it from picking
|
||||||
|
# them up as tests
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace project/tests/test_silky_profiler.py \
|
||||||
|
--replace "def test_time_taken" "def _test_time_taken"
|
||||||
|
'';
|
||||||
|
|
||||||
buildInputs = [ mock ];
|
buildInputs = [ mock ];
|
||||||
propagatedBuildInputs = [ django pygments simplejson dateutil requests sqlparse jinja2 autopep8 pytz pillow ];
|
propagatedBuildInputs = [
|
||||||
|
django pygments simplejson dateutil requests
|
||||||
|
sqlparse jinja2 autopep8 pytz pillow gprof2dot
|
||||||
|
];
|
||||||
|
|
||||||
|
checkInputs = [ freezegun contextlib2 networkx pydot factory_boy ];
|
||||||
|
checkPhase = ''
|
||||||
|
cd project
|
||||||
|
DB=sqlite3 DB_NAME=db.sqlite3 ${python.interpreter} manage.py test
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Silky smooth profiling for the Django Framework";
|
description = "Silky smooth profiling for the Django Framework";
|
||||||
homepage = https://github.com/mtford90/silk;
|
homepage = https://github.com/mtford90/silk;
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ ris ];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lib, fetchFromGitHub, buildPythonApplication }:
|
{ lib, fetchFromGitHub, buildPythonApplication, python, graphviz }:
|
||||||
|
|
||||||
buildPythonApplication {
|
buildPythonApplication {
|
||||||
name = "gprof2dot-2017-09-19";
|
name = "gprof2dot-2017-09-19";
|
||||||
@ -10,11 +10,13 @@ buildPythonApplication {
|
|||||||
sha256 = "1b5wvjv5ykbhz7aix7l3y7mg1hxi0vgak4a49gr92sdlz8blj51v";
|
sha256 = "1b5wvjv5ykbhz7aix7l3y7mg1hxi0vgak4a49gr92sdlz8blj51v";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkInputs = [ graphviz ];
|
||||||
|
checkPhase = "${python.interpreter} tests/test.py";
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = https://github.com/jrfonseca/gprof2dot;
|
homepage = https://github.com/jrfonseca/gprof2dot;
|
||||||
description = "Python script to convert the output from many profilers into a dot graph";
|
description = "Python script to convert the output from many profilers into a dot graph";
|
||||||
license = licenses.lgpl3Plus;
|
license = licenses.lgpl3Plus;
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = [ maintainers.pmiddend ];
|
maintainers = [ maintainers.pmiddend ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,9 @@ in {
|
|||||||
|
|
||||||
grandalf = callPackage ../development/python-modules/grandalf { };
|
grandalf = callPackage ../development/python-modules/grandalf { };
|
||||||
|
|
||||||
gprof2dot = callPackage ../development/python-modules/gprof2dot { };
|
gprof2dot = callPackage ../development/python-modules/gprof2dot {
|
||||||
|
inherit (pkgs) graphviz;
|
||||||
|
};
|
||||||
|
|
||||||
gsd = callPackage ../development/python-modules/gsd { };
|
gsd = callPackage ../development/python-modules/gsd { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user