Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 19.09 62 lines 1.4 kB view raw
1{ stdenv 2, buildPythonPackage 3, python 4, fetchFromGitHub 5, django 6, pygments 7, simplejson 8, dateutil 9, requests 10, sqlparse 11, jinja2 12, autopep8 13, pytz 14, pillow 15, mock 16, gprof2dot 17, freezegun 18, contextlib2 19, networkx 20, pydot 21, factory_boy 22}: 23 24buildPythonPackage rec { 25 pname = "django-silk"; 26 version = "3.0.3"; 27 28 # pypi tarball doesn't include test project 29 src = fetchFromGitHub { 30 owner = "jazzband"; 31 repo = "django-silk"; 32 rev = version; 33 sha256 = "0j1r88zv7fvmlnrzr2h65czzdcpvl7n847ra1pfc52bfa4lf8b9j"; 34 }; 35 # "test_time_taken" tests aren't suitable for reproducible execution, but django's 36 # test runner doesn't have an easy way to ignore tests - so instead prevent it from picking 37 # them up as tests 38 postPatch = '' 39 substituteInPlace project/tests/test_silky_profiler.py \ 40 --replace "def test_time_taken" "def _test_time_taken" 41 ''; 42 43 buildInputs = [ mock ]; 44 propagatedBuildInputs = [ 45 django pygments simplejson dateutil requests 46 sqlparse jinja2 autopep8 pytz pillow gprof2dot 47 ]; 48 49 checkInputs = [ freezegun contextlib2 networkx pydot factory_boy ]; 50 checkPhase = '' 51 cd project 52 DB=sqlite3 DB_NAME=db.sqlite3 ${python.interpreter} manage.py test 53 ''; 54 55 meta = with stdenv.lib; { 56 description = "Silky smooth profiling for the Django Framework"; 57 homepage = https://github.com/mtford90/silk; 58 license = licenses.mit; 59 maintainers = with maintainers; [ ris ]; 60 }; 61 62}