Skip to content

Commit

Permalink
Merge pull request #28884 from FRidh/python-fixes
Browse files Browse the repository at this point in the history
Python: several fixes
  • Loading branch information
FRidh committed Sep 6, 2017
1 parent 036bafe commit 67651d8
Show file tree
Hide file tree
Showing 71 changed files with 1,365 additions and 761 deletions.
44 changes: 29 additions & 15 deletions pkgs/applications/networking/flexget/default.nix
Expand Up @@ -9,14 +9,14 @@
with python.pkgs;

buildPythonApplication rec {
version = "2.10.40";
version = "2.10.82";
name = "FlexGet-${version}";

src = fetchFromGitHub {
owner = "Flexget";
repo = "Flexget";
rev = version;
sha256 = "0hh21yv1lvdfi198snwjabfsdh04fnpjszpgg28wvg5pd1qq8lqv";
sha256 = "15508ihswfjbkzhf1f0qhn2ar1aiibz2ggp5d6r33icy8xwhpv09";
};

doCheck = true;
Expand All @@ -27,30 +27,44 @@ buildPythonApplication rec {
sed -i '/def test_non_ascii/i\ import pytest\
@pytest.mark.skip' flexget/tests/test_filesystem.py
substituteInPlace requirements.txt --replace "guessit<=2.0.4" "guessit"
substituteInPlace requirements.txt \
--replace "chardet==3.0.3" "chardet" \
--replace "rebulk==0.8.2" "rebulk" \
--replace "cherrypy==10.2.2" "cherrypy" \
--replace "portend==1.8" "portend" \
--replace "sqlalchemy==1.1.10" "sqlalchemy" \
--replace "zxcvbn-python==4.4.15" "zxcvbn-python" \
--replace "flask-cors==3.0.2" "flask-cors" \
--replace "certifi==2017.4.17" "certifi"
'';

# Disable 3 failing tests caused by guessit upgrade
# https://github.com/Flexget/Flexget/issues/1804
checkPhase = ''
export HOME=.
py.test --disable-pytest-warnings -k "not test_date_options and not test_ep_as_quality and not testFromGroup"
py.test --disable-pytest-warnings -k "not test_quality_failures \
and not test_group_quality \
and not crash_report \
and not test_multi_episode \
and not test_double_episodes \
and not test_inject_force \
and not test_double_prefered \
and not test_double"
'';

buildInputs = [ pytest mock vcrpy pytest-catchlog boto3 ];
propagatedBuildInputs = [
feedparser sqlalchemy pyyaml
feedparser sqlalchemy pyyaml chardet
beautifulsoup4 html5lib PyRSS2Gen pynzb
rpyc jinja2 requests dateutil jsonschema
pathpy guessit APScheduler
rpyc jinja2 jsonschema requests dateutil jsonschema
pathpy guessit_2_0 APScheduler
terminaltables colorclass
cherrypy flask flask-restful flask-restplus_0_8
cherrypy flask flask-restful flask-restplus
flask-compress flask_login flask-cors
pyparsing safe future zxcvbn-python ]
++ lib.optional (pythonOlder "3.4") pathlib
# enable deluge and transmission plugin support, if they're installed
++ lib.optional (config.deluge or false) deluge
++ lib.optional (transmission != null) transmissionrpc;
pyparsing safe future zxcvbn-python
werkzeug tempora cheroot rebulk portend
] ++ lib.optional (pythonOlder "3.4") pathlib
# enable deluge and transmission plugin support, if they're installed
++ lib.optional (config.deluge or false) deluge
++ lib.optional (transmission != null) transmissionrpc;

meta = {
homepage = https://flexget.com/;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/Cython/default.nix
Expand Up @@ -14,11 +14,11 @@
buildPythonPackage rec {
pname = "Cython";
name = "${pname}-${version}";
version = "0.26";
version = "0.26.1";

src = fetchPypi {
inherit pname version;
sha256 = "4c24e2c22ddaed624d35229dc5db25049e9e225c6f64f3364326836cad8f2c66";
sha256 = "c2e63c4794161135adafa8aa4a855d6068073f421c83ffacc39369497a189dd5";
};

# With Python 2.x on i686-linux or 32-bit ARM this test fails because the
Expand Down
30 changes: 30 additions & 0 deletions pkgs/development/python-modules/GeoIP/default.nix
@@ -0,0 +1,30 @@
{lib, buildPythonPackage, fetchPypi, isPy3k, incremental, ipaddress, twisted
, automat, zope_interface, idna, pyopenssl, service-identity, pytest, mock, lsof
, geoip, nose}:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "GeoIP";
version = "1.3.2";

checkInputs = [ nose ];
propagatedBuildInputs = [
geoip
];

src = fetchPypi {
inherit pname version;
sha256 = "1rphxf3vrn8wywjgr397f49s0s22m83lpwcq45lm0h2p45mdm458";
};

# Tests cannot be run because they require data that isn't included in the
# release tarball.
checkPhase = "true";

meta = {
description = "MaxMind GeoIP Legacy Database - Python API";
homepage = http://www.maxmind.com/;
maintainers = with lib.maintainers; [ jluttine ];
license = lib.licenses.lgpl21Plus;
};
}
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/adal/default.nix
Expand Up @@ -3,12 +3,12 @@

buildPythonPackage rec {
pname = "adal";
version = "0.4.6";
version = "0.4.7";
name = "${pname}-${version}";

src = fetchPypi {
inherit pname version;
sha256 = "7c5bbf4d8a17d535e6e857b28a41cedddc2767fc57424c15d484fa779bb97325";
sha256 = "114046ac85d0054791c21b00922f26286822bc6f2ba3716db42e7e57f762ef20";
};

propagatedBuildInputs = [ requests pyjwt dateutil ];
Expand Down
36 changes: 36 additions & 0 deletions pkgs/development/python-modules/aiohttp/default.nix
@@ -0,0 +1,36 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, chardet
, multidict
, async-timeout
, yarl
, pytest
, gunicorn
, pytest-raisesregexp
}:

buildPythonPackage rec {
pname = "aiohttp";
version = "2.2.5";
name = "${pname}-${version}";

src = fetchPypi {
inherit pname version;
sha256 = "af5bfdd164256118a0a306b3f7046e63207d1f8cba73a67dcc0bd858dcfcd3bc";
};

disabled = pythonOlder "3.4";

doCheck = false; # Too many tests fail.

checkInputs = [ pytest gunicorn pytest-raisesregexp ];
propagatedBuildInputs = [ async-timeout chardet multidict yarl ];

meta = {
description = "Http client/server for asyncio";
license = with lib.licenses; [ asl20 ];
homepage = https://github.com/KeepSafe/aiohttp/;
};
}
28 changes: 28 additions & 0 deletions pkgs/development/python-modules/attrs/default.nix
@@ -0,0 +1,28 @@
{ lib, stdenv, buildPythonPackage, fetchPypi, pytest, hypothesis, zope_interface
, pympler, coverage, six, clang }:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "attrs";
version = "17.2.0";

src = fetchPypi {
inherit pname version;
sha256 = "04gx08ikpk26wnq22f7l42gapcvk8iz1512r927k6sadz6cinkax";
};

# macOS needs clang for testing
buildInputs = [
pytest hypothesis zope_interface pympler coverage six
] ++ lib.optionals (stdenv.isDarwin) [ clang ];

checkPhase = ''
py.test
'';

meta = with lib; {
description = "Python attributes without boilerplate";
homepage = https://github.com/hynek/attrs;
license = licenses.mit;
};
}
@@ -0,0 +1,22 @@
{ stdenv, buildPythonPackage, fetchPypi, setuptools_scm, mock }:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "backports.unittest_mock";
version = "1.3";

src = fetchPypi {
inherit pname version;
sha256 = "0xdkx5wf5a2w2zd2pshk7z2cvbv6db64c1x6v9v1a18ja7bn9nf6";
};

propagatedBuildInputs = [ mock ];

buildInputs = [ setuptools_scm ];

meta = with stdenv.lib; {
description = "Provides a function install() which makes the mock module";
homepage = https://github.com/jaraco/backports.unittest_mock;
license = licenses.mit;
};
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/beautifulsoup4/default.nix
@@ -0,0 +1,24 @@
{ stdenv, buildPythonPackage, fetchPypi, nose }:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "beautifulsoup4";
version = "4.6.0";

src = fetchPypi {
inherit pname version;
sha256 = "12cf0ygpz9srpfh9gx2f9ba0swa1rzypv3sm4r0hmjyw6b4nm2w0";
};

buildInputs = [ nose ];
checkPhase = ''
nosetests build
'';

meta = with stdenv.lib; {
homepage = http://crummy.com/software/BeautifulSoup/bs4/;
description = "HTML and XML parser";
license = licenses.mit;
maintainers = with maintainers; [ domenkozar ];
};
}
29 changes: 29 additions & 0 deletions pkgs/development/python-modules/bkcharts/default.nix
@@ -0,0 +1,29 @@
{ lib
, buildPythonPackage
, fetchPypi
, numpy
, pandas
}:


buildPythonPackage rec {
pname = "bkcharts";
version = "0.2";
name = "${pname}-${version}";

src = fetchPypi {
inherit version pname;
sha256 = "a5eaa8e78853dcecaa46345812e4fabe9cd3b96330ebf0809f640a4a0556d72e";
};

propagatedBuildInputs = [ numpy pandas ];

# Circular test dependency on bokeh
doCheck = false;

meta = {
description = "High level chart types built on top of Bokeh";
homepage = http://github.com/bokeh/bkcharts;
license = lib.licenses.bsd3;
};
}
82 changes: 82 additions & 0 deletions pkgs/development/python-modules/bokeh/default.nix
@@ -0,0 +1,82 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPyPy
, mock
, pytest
, flask
, jinja2
, markupsafe
, werkzeug
, itsdangerous
, dateutil
, requests
, six
, pygments
, pystache
, markdown
, pyyaml
, pyzmq
, tornado
, colorama
, isPy3k
, futures
, websocket_client
, numpy
, pandas
, greenlet
, python
, bkcharts
, pillow
, selenium
}:

buildPythonPackage rec {
pname = "bokeh";
name = "${pname}${version}";
version = "0.12.7";

src = fetchPypi {
inherit pname version;
sha256 = "2c42c95bf1a418c758dbff8446b4f5e5fc72ac10ea5da4e6b5010067396d0880";
};

disabled = isPyPy;

# Some test that uses tornado fails
# doCheck = false;

checkInputs = [ mock pytest pillow selenium ];

propagatedBuildInputs = [
flask
jinja2
markupsafe
werkzeug
itsdangerous
dateutil
requests
six
pygments
pystache
markdown
pyyaml
pyzmq
tornado
colorama
bkcharts
]
++ lib.optionals ( !isPy3k ) [ futures ]
++ lib.optionals ( !isPy3k && !isPyPy ) [ websocket_client ]
++ lib.optionals ( !isPyPy ) [ numpy pandas greenlet ];

checkPhase = ''
${python.interpreter} -m unittest discover -s bokeh/tests
'';

meta = {
description = "Statistical and novel interactive HTML plots for Python";
homepage = "http://github.com/bokeh/bokeh";
license = lib.licenses.bsd3;
};
}
22 changes: 22 additions & 0 deletions pkgs/development/python-modules/chardet/default.nix
@@ -0,0 +1,22 @@
{ stdenv, buildPythonPackage, fetchPypi
, pytest, pytestrunner, hypothesis }:

buildPythonPackage rec {
name = "${pname}-${version}";
pname = "chardet";
version = "3.0.4";

src = fetchPypi {
inherit pname version;
sha256 = "1bpalpia6r5x1kknbk11p1fzph56fmmnp405ds8icksd3knr5aw4";
};

buildInputs = [ pytest pytestrunner hypothesis ];

meta = with stdenv.lib; {
homepage = https://github.com/chardet/chardet;
description = "Universal encoding detector";
license = licenses.lgpl2;
maintainers = with maintainers; [ domenkozar ];
};
}

0 comments on commit 67651d8

Please sign in to comment.