Merge pull request #37439 from dotlambda/python-fixes

Python fixes, cc #36453
This commit is contained in:
Robert Schütz 2018-03-20 18:10:05 +01:00 committed by GitHub
commit dceb9ee393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 245 additions and 169 deletions

View File

@ -0,0 +1,49 @@
{ lib, buildPythonPackage, fetchPypi, isPy3k
, pbr, six, simplegeneric, netaddr, pytz, webob
, cornice, nose, webtest, pecan, transaction, cherrypy, sphinx
, flask, flask-restful, suds-jurko, glibcLocales }:
buildPythonPackage rec {
pname = "WSME";
version = "0.9.2";
src = fetchPypi {
inherit pname version;
sha256 = "e790ac755a7e36eaa796d3966d3878677896dbc7d1c2685cb85c06b744c21976";
};
postPatch = ''
# remove turbogears tests as we don't have it packaged
rm tests/test_tg*
# WSME seems incompatible with recent SQLAlchemy version
rm wsmeext/tests/test_sqlalchemy*
# https://bugs.launchpad.net/wsme/+bug/1510823
${if isPy3k then "rm tests/test_cornice.py" else ""}
'';
checkPhae = ''
nosetests --exclude test_buildhtml \
--exlcude test_custom_clientside_error \
--exclude test_custom_non_http_clientside_error
'';
# UnicodeEncodeError, ImportError, ...
doCheck = !isPy3k;
nativeBuildInputs = [ pbr ];
propagatedBuildInputs = [
six simplegeneric netaddr pytz webob
];
checkInputs = [
cornice nose webtest pecan transaction cherrypy sphinx
flask flask-restful suds-jurko glibcLocales
];
meta = with lib; {
description = "Simplify the writing of REST APIs, and extend them with additional protocols";
homepage = http://git.openstack.org/cgit/openstack/wsme;
license = licenses.mit;
};
}

View File

@ -1,17 +1,20 @@
{ stdenv, buildPythonPackage, fetchPypi
, pytest, vega, pandas, ipython, traitlets }:
, pytest, glibcLocales, vega, pandas, ipython, traitlets }:
buildPythonPackage rec {
pname = "altair";
version = "1.2.1";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "c1303f77f1ba4d632f2958c83c0f457b2b969860b1ac9adfb872aefa1780baa7";
};
buildInputs = [ pytest ];
postPatch = ''
sed -i "s/vega==/vega>=/g" setup.py
'';
checkInputs = [ pytest glibcLocales ];
checkPhase = ''
export LANG=en_US.UTF-8
@ -19,8 +22,6 @@ buildPythonPackage rec {
'';
propagatedBuildInputs = [ vega pandas ipython traitlets ];
# Disabling checks, MockRequest object has no method send()
doCheck = false;
meta = with stdenv.lib; {
description = "A declarative statistical visualization library for Python.";

View File

@ -1,16 +1,18 @@
{ lib
, fetchPypi
, buildPythonPackage
, isPy3k
, numpy
, pytest }:
buildPythonPackage rec {
pname = "astropy";
version = "3.0";
name = "${pname}-${version}";
disabled = !isPy3k; # according to setup.py
doCheck = false; #Some tests are failing. More importantly setup.py hangs on completion. Needs fixing with a proper shellhook.
src = fetchPypi {
inherit pname version;
sha256 = "9e0ad19b9d6d227bdf0932bbe64a8c5dd4a47d4ec078586cf24bf9f0c61d9ecf";
@ -18,7 +20,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [ pytest numpy ]; # yes it really has pytest in install_requires
meta = {
description = "Astronomy/Astrophysics library for Python";
homepage = http://www.astropy.org;

View File

@ -0,0 +1,41 @@
{ lib, buildPythonPackage, fetchPypi
, chameleon, colander, iso8601, peppercorn, translationstring, zope_deprecation
, nose, coverage, beautifulsoup4, flaky }:
buildPythonPackage rec {
pname = "deform";
version = "2.0.5";
src = fetchPypi {
inherit pname version;
sha256 = "874d3346a02c500432efdcc73b1a7174aa0ea69cd52a99bb9a812967f54f6f79";
};
postPatch = ''
substituteInPlace setup.py \
--replace "iso8601<=0.1.11" iso8601
'';
propagatedBuildInputs = [
chameleon
colander
iso8601
peppercorn
translationstring
zope_deprecation
];
checkInputs = [
nose
coverage
beautifulsoup4
flaky
];
meta = with lib; {
description = "Form library with advanced features like nested forms";
homepage = https://docs.pylonsproject.org/projects/deform/en/latest/;
license = licenses.free; # http://www.repoze.org/LICENSE.txt
maintainers = with maintainers; [ garbas domenkozar ];
};
}

View File

@ -0,0 +1,36 @@
{ lib, buildPythonPackage, fetchFromGitHub, isPy3k
, django, futures, mock, jinja2, jsmin, slimit }:
buildPythonPackage rec {
pname = "django-pipeline";
version = "1.6.14";
# no tests on PyPI
src = fetchFromGitHub {
owner = "jazzband";
repo = pname;
rev = version;
sha256 = "1xf732bd17mgha75jfhlnms46ib2pffhpfa0ca7bmng9jhbvsl9j";
};
postPatch = ''
substituteInPlace tests/tests/test_compiler.py \
--replace "/usr/bin/env" ""
'';
propagatedBuildInputs = [ django ] ++ lib.optional (!isPy3k) futures;
checkInputs = [ jinja2 jsmin slimit ] ++ lib.optional (!isPy3k) mock;
checkPhase = ''
export PYTHONPATH=.:$PYTHONPATH
export DJANGO_SETTINGS_MODULE=tests.settings
${django}/bin/django-admin.py test tests
'';
meta = with lib; {
description = "Pipeline is an asset packaging library for Django";
homepage = https://github.com/cyberdelia/django-pipeline;
license = licenses.mit;
};
}

View File

@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchPypi
, six, twisted, werkzeug, incremental
, mock }:
buildPythonPackage rec {
pname = "klein";
version = "17.10.0";
src = fetchPypi {
inherit pname version;
sha256 = "30aaf0d78a987d5dbfe0968a07367ad0c73e02823cc8eef4c54f80ab848370d0";
};
propagatedBuildInputs = [ six twisted werkzeug incremental ];
checkInputs = [ mock ];
checkPhase = ''
trial klein
'';
meta = with lib; {
description = "Klein Web Micro-Framework";
homepage = "https://github.com/twisted/klein";
license = licenses.mit;
};
}

View File

@ -0,0 +1,36 @@
{ lib, buildPythonPackage, fetchPypi, isPy3k, fetchpatch, python, ply }:
buildPythonPackage rec {
pname = "slimit";
version = "0.8.1";
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "f433dcef899f166b207b67d91d3f7344659cb33b8259818f084167244e17720b";
};
# Some patches from https://github.com/rspivak/slimit/pull/65
patches = lib.optionals isPy3k [
(fetchpatch {
url = https://github.com/lelit/slimit/commit/a61e12d88cc123c4b7af2abef21d06fd182e561a.patch;
sha256 = "0lbhvkgn4l8g9fwvb81rfwjx7hsaq2pid8a5gczdk1ba65wfvdq5";
})
(fetchpatch {
url = https://github.com/lelit/slimit/commit/e8331659fb89e8a4613c5e4e338c877fead9c551.patch;
sha256 = "1hv4ysn09c9bfd5bxhhrp51hsi81hdidmx0y7zcrjjiich9ayrni";
})
];
propagatedBuildInputs = [ ply ];
checkPhase = ''
${python.interpreter} -m unittest discover -s src/slimit
'';
meta = with lib; {
description = "JavaScript minifier";
homepage = http://slimit.readthedocs.org/;
license = licenses.mit;
};
}

View File

@ -0,0 +1,30 @@
{ lib, buildPythonPackage, fetchPypi, python, mock }:
buildPythonPackage rec {
pname = "stem";
version = "1.6.0";
src = fetchPypi {
inherit pname version;
sha256 = "1va9p3ij7lxg6ixfsvaql06dn11l3fgpxmss1dhlvafm7sqizznp";
};
postPatch = ''
rm test/unit/installation.py
sed -i "/test.unit.installation/d" test/settings.cfg
'';
checkInputs = [ mock ];
checkPhase = ''
touch .gitignore
${python.interpreter} run_tests.py -u
'';
meta = with lib; {
description = "Controller library that allows applications to interact with Tor";
homepage = https://stem.torproject.org/;
license = licenses.gpl3;
maintainers = with maintainers; [ phreedom ];
};
}

View File

@ -8,20 +8,23 @@
buildPythonPackage rec {
pname = "zope_copy";
version = "4.0.2";
pname = "zope.copy";
version = "4.1.0";
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "eb2a95866df1377741876a3ee62d8600e80089e6246e1a235e86791b29534457";
sha256 = "702dbb52e2427a1cc2e2b4b3f5a40c64dcbf9ebed85888ae8fa67172263a6994";
};
propagatedBuildInputs = [ zope_interface ];
checkInputs = [ zope_location zope_schema ];
checkPhase = ''
python -m unittest discover -s src/zope/copy
'';
meta = {
maintainers = with lib.maintainers; [ domenkozar ];
};
}
}

View File

@ -3657,32 +3657,7 @@ in {
decorator = callPackage ../development/python-modules/decorator { };
deform = buildPythonPackage rec {
name = "deform-2.0a2";
src = pkgs.fetchurl {
url = "mirror://pypi/d/deform/${name}.tar.gz";
sha256 = "3fa4d287c8da77a83556e4a5686de006ddd69da359272120b915dc8f5a70cabd";
};
buildInputs = with self; [] ++ optional isPy26 unittest2;
propagatedBuildInputs =
[ self.beautifulsoup4
self.peppercorn
self.colander
self.translationstring
self.chameleon
self.zope_deprecation
self.coverage
self.nose
];
meta = {
maintainers = with maintainers; [ garbas domenkozar ];
platforms = platforms.all;
};
};
deform = callPackage ../development/python-modules/deform { };
demjson = callPackage ../development/python-modules/demjson { };
@ -6330,23 +6305,7 @@ in {
schema = callPackage ../development/python-modules/schema {};
stem = buildPythonPackage rec {
name = "stem-${version}";
version = "1.6.0";
src = pkgs.fetchurl {
url = "mirror://pypi/s/stem/${name}.tar.gz";
sha256 = "1va9p3ij7lxg6ixfsvaql06dn11l3fgpxmss1dhlvafm7sqizznp";
};
meta = {
description = "Controller library that allows applications to interact with Tor (https://www.torproject.org/";
homepage = https://stem.torproject.org/;
license = licenses.gpl3;
maintainers = with maintainers; [ phreedom ];
};
};
stem = callPackage ../development/python-modules/stem { };
svg-path = callPackage ../development/python-modules/svg-path { };
@ -6874,52 +6833,7 @@ in {
};
};
django_pipeline = buildPythonPackage rec {
name = "django-pipeline-${version}";
version = "1.5.1";
src = pkgs.fetchurl {
url = "mirror://pypi/d/django-pipeline/${name}.tar.gz";
sha256 = "1y49fa8jj7x9qjj5wzhns3zxwj0s73sggvkrv660cqw5qb7d8hha";
};
propagatedBuildInputs = with self; [ django futures ];
meta = with stdenv.lib; {
description = "Pipeline is an asset packaging library for Django";
homepage = https://github.com/cyberdelia/django-pipeline;
license = stdenv.lib.licenses.mit;
};
};
django_pipeline_1_3 = self.django_pipeline.overrideDerivation (super: rec {
name = "django-pipeline-1.3.27";
src = pkgs.fetchurl {
url = "mirror://pypi/d/django-pipeline/${name}.tar.gz";
sha256 = "0iva3cmnh5jw54c7w83nx9nqv523hjvkbjchzd2pb6vzilxf557k";
};
});
djblets = if (versionOlder self.django.version "1.6.11") ||
(versionAtLeast self.django.version "1.9")
then throw "djblets only suported for Django<1.8.999,>=1.6.11"
else buildPythonPackage rec {
name = "Djblets-0.9";
src = pkgs.fetchurl {
url = "http://downloads.reviewboard.org/releases/Djblets/0.9/${name}.tar.gz";
sha256 = "1rr5vjwiiw3kih4k9nawislf701l838dbk5xgizadvwp6lpbpdpl";
};
propagatedBuildInputs = with self; [
django feedparser django_pipeline_1_3 pillowfight pytz ];
meta = {
description = "A collection of useful extensions for Django";
homepage = https://github.com/djblets/djblets;
};
};
django_pipeline = callPackage ../development/python-modules/django-pipeline { };
dj-database-url = callPackage ../development/python-modules/dj-database-url { };
@ -8895,24 +8809,8 @@ in {
keyutils = callPackage ../development/python-modules/keyutils { };
klein = buildPythonPackage rec {
name = "klein-15.3.1";
src = pkgs.fetchurl {
url = "mirror://pypi/k/klein/${name}.tar.gz";
sha256 = "1hl2psnn1chm698rimyn9dgcpl1mxgc8dj11b3ipp8z37yfjs3z9";
};
disabled = isPy3k;
propagatedBuildInputs = with self; [ werkzeug twisted ];
meta = {
description = "Klein Web Micro-Framework";
homepage = "https://github.com/twisted/klein";
license = licenses.mit;
};
};
klein = callPackage ../development/python-modules/klein { };
koji = callPackage ../development/python-modules/koji { };
kombu = buildPythonPackage rec {
@ -11245,34 +11143,7 @@ in {
};
};
WSME = buildPythonPackage rec {
name = "WSME-${version}";
version = "0.8.0";
src = pkgs.fetchurl {
url = "mirror://pypi/W/WSME/${name}.tar.gz";
sha256 = "1nw827iz5g9jlfnfbdi8kva565v0kdjzba2lccziimj09r71w900";
};
checkPhase = ''
# remove turbogears tests as we don't have it packaged
rm tests/test_tg*
# remove flask since we don't have flask-restful
rm tests/test_flask*
# https://bugs.launchpad.net/wsme/+bug/1510823
${if isPy3k then "rm tests/test_cornice.py" else ""}
nosetests tests/
'';
propagatedBuildInputs = with self; [
pbr six simplegeneric netaddr pytz webob
];
buildInputs = with self; [
cornice nose webtest pecan transaction cherrypy sphinx
];
};
WSME = callPackage ../development/python-modules/WSME { };
zake = buildPythonPackage rec {
name = "zake-${version}";
@ -14402,27 +14273,6 @@ in {
django-multiselectfield = callPackage ../development/python-modules/django-multiselectfield { };
reviewboard = buildPythonPackage rec {
name = "ReviewBoard-2.5.1.1";
src = pkgs.fetchurl {
url = "http://downloads.reviewboard.org/releases/ReviewBoard/2.5/${name}.tar.gz";
sha256 = "14m8yy2aqxnnzi822b797wc9nmkfkp2fqmq24asdnm66bxhyzjwn";
};
patchPhase = ''
sed -i 's/mimeparse/python-mimeparse/' setup.py
sed -i 's/markdown>=2.4.0,<2.4.999/markdown/' setup.py
'';
propagatedBuildInputs = with self;
[ django recaptcha_client pytz memcached dateutil_1_5 paramiko flup
pygments djblets django_evolution pycrypto pysvn pillow
psycopg2 django-haystack python_mimeparse markdown django-multiselectfield
];
};
rdflib = callPackage ../development/python-modules/rdflib { };
isodate = buildPythonPackage rec {
@ -15019,6 +14869,8 @@ in {
};
};
slimit = callPackage ../development/python-modules/slimit { };
slob = buildPythonPackage rec {
name = "slob-unstable-2016-11-03";