2018-10-16 18:52:45 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
2019-06-02 19:30:31 +01:00
|
|
|
, python
|
|
|
|
, fetchFromGitHub
|
2018-10-16 18:52:45 +01:00
|
|
|
, django
|
|
|
|
, pygments
|
|
|
|
, simplejson
|
|
|
|
, dateutil
|
|
|
|
, requests
|
|
|
|
, sqlparse
|
|
|
|
, jinja2
|
|
|
|
, autopep8
|
|
|
|
, pytz
|
|
|
|
, pillow
|
|
|
|
, mock
|
2019-06-02 19:29:46 +01:00
|
|
|
, gprof2dot
|
2019-06-02 19:30:31 +01:00
|
|
|
, freezegun
|
|
|
|
, contextlib2
|
|
|
|
, networkx
|
|
|
|
, pydot
|
|
|
|
, factory_boy
|
2018-10-16 18:52:45 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "django-silk";
|
2019-04-24 17:42:48 +01:00
|
|
|
version = "3.0.2";
|
2018-10-16 18:52:45 +01:00
|
|
|
|
2019-06-02 19:30:31 +01:00
|
|
|
# pypi tarball doesn't include test project
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jazzband";
|
|
|
|
repo = "django-silk";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1fbaafc2gx01gscdalp6hj6bz4b0cmq59lgmvsydw7jkds4mps7c";
|
2018-10-16 18:52:45 +01:00
|
|
|
};
|
2019-06-02 19:30:31 +01:00
|
|
|
# "test_time_taken" tests aren't suitable for reproducible execution, but django's
|
|
|
|
# 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"
|
|
|
|
'';
|
2018-10-16 18:52:45 +01:00
|
|
|
|
|
|
|
buildInputs = [ mock ];
|
2019-06-02 19:29:46 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
django pygments simplejson dateutil requests
|
|
|
|
sqlparse jinja2 autopep8 pytz pillow gprof2dot
|
|
|
|
];
|
|
|
|
|
2019-06-02 19:30:31 +01:00
|
|
|
checkInputs = [ freezegun contextlib2 networkx pydot factory_boy ];
|
|
|
|
checkPhase = ''
|
|
|
|
cd project
|
|
|
|
DB=sqlite3 DB_NAME=db.sqlite3 ${python.interpreter} manage.py test
|
|
|
|
'';
|
2018-10-16 18:52:45 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Silky smooth profiling for the Django Framework";
|
|
|
|
homepage = https://github.com/mtford90/silk;
|
|
|
|
license = licenses.mit;
|
2019-06-02 19:31:02 +01:00
|
|
|
maintainers = with maintainers; [ ris ];
|
2018-10-16 18:52:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|