Merge pull request #37250 from dotlambda/python-fixes

Python fixes, cc #36453
This commit is contained in:
Robert Schütz
2018-03-18 16:39:04 +01:00
committed by GitHub
20 changed files with 273 additions and 149 deletions

View File

@@ -0,0 +1,25 @@
{ lib, buildPythonPackage, fetchPypi, six, pytest }:
buildPythonPackage rec {
pname = "allpairspy";
version = "2.4.0";
src = fetchPypi {
inherit pname version;
sha256 = "9fb7962ee523bd96c5098cd3c97ac1b8eb73021d3df9314657ee9de00f52e034";
};
propagatedBuildInputs = [ six ];
checkInputs = [ pytest ];
checkPhase = ''
py.test
'';
meta = with lib; {
description = "Pairwise test combinations generator";
homepage = https://github.com/thombashi/allpairspy;
license = licenses.mit;
};
}

View File

@@ -9,11 +9,11 @@
buildPythonPackage rec {
pname = "bleach";
version = "2.1.2";
version = "2.1.3";
src = fetchPypi {
inherit pname version;
sha256 = "38fc8cbebea4e787d8db55d6f324820c7f74362b70db9142c1ac7920452d1a19";
sha256 = "eb7386f632349d10d9ce9d4a838b134d4731571851149f9cc2c05a9a837a9a44";
};
checkInputs = [ pytest pytestrunner ];
@@ -41,4 +41,4 @@ buildPythonPackage rec {
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ prikhi ];
};
}
}

View File

@@ -0,0 +1,21 @@
{ lib, buildPythonPackage, fetchPypi
, translationstring, iso8601 }:
buildPythonPackage rec {
pname = "colander";
version = "1.4";
src = fetchPypi {
inherit pname version;
sha256 = "e20e9acf190e5711cf96aa65a5405dac04b6e841028fc361d953a9923dbc4e72";
};
propagatedBuildInputs = [ translationstring iso8601 ];
meta = with lib; {
description = "A simple schema-based serialization and deserialization library";
homepage = https://docs.pylonsproject.org/projects/colander/en/latest/;
license = licenses.free; # http://repoze.org/LICENSE.txt
maintainers = with maintainers; [ garbas domenkozar ];
};
}

View File

@@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchPypi, isPy3k, glibcLocales, future }:
buildPythonPackage rec {
pname = "CommonMark";
version = "0.7.5";
src = fetchPypi {
inherit pname version;
sha256 = "4dfbbd1dbc669a9b71a015032b2bbe5c4b019ca8b6ca410d89cf7020de46d2c0";
};
preCheck = ''
export LC_ALL="en_US.UTF-8"
'';
# UnicodeEncodeError on Python 2
doCheck = isPy3k;
checkInputs = [ glibcLocales ];
propagatedBuildInputs = [ future ];
meta = with lib; {
description = "Python parser for the CommonMark Markdown spec";
homepage = https://github.com/rolandshoemaker/CommonMark-py;
license = licenses.bsd3;
};
}

View File

@@ -1,15 +1,20 @@
{ stdenv, buildPythonPackage, fetchPypi, cryptography, boto3, pyyaml, docutils }:
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, cryptography, boto3, pyyaml, docutils }:
buildPythonPackage rec {
pname = "credstash";
pname = "credstash";
version = "1.14.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "718b337f7a6fa001e014386071f05c59900525d0507009126d2fe8d75fe0761d";
};
patches = fetchpatch {
url = https://github.com/fugue/credstash/pull/178.patch;
sha256 = "15ih4h5v63g7qfmqdl4zca147wkcrx8vnsh4ns33001dipcfb5sc";
excludes = [ ".travis.yml" ];
};
propagatedBuildInputs = [ cryptography boto3 pyyaml docutils ];
# No tests in archive

View File

@@ -1,15 +1,24 @@
{ lib, fetchurl, buildPythonPackage, flake8, nose }:
{ lib, fetchPypi, buildPythonPackage, flake8, pycodestyle, pytestrunner, pytest }:
buildPythonPackage rec {
pname = "flake8-debugger";
name = "${pname}-${version}";
version = "3.1.0";
src = fetchurl {
url = "mirror://pypi/f/flake8-debugger/${name}.tar.gz";
src = fetchPypi {
inherit pname version;
sha256 = "be4fb88de3ee8f6dd5053a2d347e2c0a2b54bab6733a2280bb20ebd3c4ca1d97";
};
buildInputs = [ nose ];
propagatedBuildInputs = [ flake8 ];
nativeBuildInputs = [ pytestrunner ];
propagatedBuildInputs = [ flake8 pycodestyle ];
checkInputs = [ pytest ];
# Tests not included in PyPI tarball
# FIXME: Remove when https://github.com/JBKahn/flake8-debugger/pull/15 is merged
doCheck = false;
meta = {
homepage = https://github.com/jbkahn/flake8-debugger;
description = "ipdb/pdb statement checker plugin for flake8";

View File

@@ -0,0 +1,22 @@
{ lib, buildPythonPackage, fetchPypi, requests }:
buildPythonPackage rec {
pname = "hvac";
version = "0.5.0";
src = fetchPypi {
inherit pname version;
sha256 = "2c9308334301daee3b5c6d56a032ca2c81eeb97d2777b73d795e201e8d037687";
};
propagatedBuildInputs = [ requests ];
# Requires running a Vault server
doCheck = false;
meta = with lib; {
description = "HashiCorp Vault API client";
homepage = https://github.com/ianunruh/hvac;
license = licenses.asl20;
};
}

View File

@@ -1,13 +1,16 @@
{ lib, buildPythonPackage, fetchurl, fetchpatch
{ lib, buildPythonPackage, fetchurl, fetchpatch, isPy3k
, pytest, werkzeug, pygments
}:
buildPythonPackage rec {
name = "moinmoin-${ver}";
ver = "1.9.9";
name = "moinmoin";
version = "1.9.9";
# SyntaxError in setup.py
disabled = isPy3k;
src = fetchurl {
url = "http://static.moinmo.in/files/moin-${ver}.tar.gz";
url = "http://static.moinmo.in/files/moin-${version}.tar.gz";
sha256 = "197ga41qghykmir80ik17f9hjpmixslv3zjgj7bj9qvs1dvdg5s3";
};

View File

@@ -37,5 +37,8 @@ buildPythonPackage rec {
description = "Data migration utilities";
license = lib.licenses.bsdOriginal;
maintainers = with lib.maintainers; [ fridh ];
# incomaptible with Networkx 2
# see https://github.com/blaze/odo/pull/601
broken = true;
};
}
}

View File

@@ -0,0 +1,20 @@
{ buildPythonPackage, fetchPypi
, requests, six, pyopenssl }:
buildPythonPackage rec {
pname = "paypalrestsdk";
version = "1.13.1";
src = fetchPypi {
inherit pname version;
sha256 = "238713208031e8981bf70b3350b3d7f85ed64d34e0f21e4c1184444a546fee7f";
};
propagatedBuildInputs = [ requests six pyopenssl ];
meta = {
homepage = https://developer.paypal.com/;
description = "Python APIs to create, process and manage payment";
license = "PayPal SDK License";
};
}

View File

@@ -0,0 +1,27 @@
{ lib, buildPythonPackage, fetchPypi
, requests, websocket_client, python_magic
, pytest, mock }:
buildPythonPackage rec {
pname = "pushbullet.py";
version = "0.11.0";
src = fetchPypi {
inherit pname version;
sha256 = "aa9dc7bb46e083e3497d46241154f12944a8f540e29d150330ca94db0b453b8d";
};
propagatedBuildInputs = [ requests websocket_client python_magic ];
checkInputs = [ pytest mock ];
checkPhase = ''
PUSHBULLET_API_KEY="" py.test -k "not test_e2e and not test_auth"
'';
meta = with lib; {
description = "A simple python client for pushbullet.com";
homepage = https://github.com/randomchars/pushbullet.py;
license = licenses.mit;
};
}

View File

@@ -1,10 +1,12 @@
{ stdenv, fetchPypi, buildPythonPackage, defusedxml }:
{ stdenv, fetchPypi, buildPythonPackage, isPy3k, defusedxml }:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "PyAMF";
version = "0.8.0";
# according to setup.py
disabled = isPy3k;
src = fetchPypi {
inherit pname version;
sha256 = "1r3lp9gkph48g9lijby5rs5daa3lhxs204r14zw4kvp3hf4xcm84";

View File

@@ -14,6 +14,9 @@ buildPythonPackage rec {
sha256 = "1g181x2mrhxcaswr6vi2m7if97wv4rf2g2pny60334sciga8njfz";
};
# Unreliable timing: https://github.com/danielperna84/pyhomematic/issues/126
doCheck = false;
meta = with stdenv.lib; {
description = "Python 3 Interface to interact with Homematic devices";
homepage = https://github.com/danielperna84/pyhomematic;

View File

@@ -0,0 +1,17 @@
{ lib, buildPythonPackage, fetchPypi }:
buildPythonPackage rec {
pname = "python-ctags3";
version = "1.2.4";
src = fetchPypi {
inherit pname version;
sha256 = "62e1d48a8cd88756767f3f5e3f1b1a81bc84deeb736f0c9480a5b5d066f63c3e";
};
meta = with lib; {
description = "Ctags indexing python bindings";
homepage = https://github.com/jonashaag/python-ctags3;
license = licenses.lgpl3Plus;
};
}

View File

@@ -2,6 +2,7 @@
, buildPythonPackage
, fetchPypi
, pytest
, CommonMark
, bleach
, docutils
, pygments
@@ -10,18 +11,17 @@
buildPythonPackage rec {
pname = "readme_renderer";
version = "17.2";
name = "${pname}-${version}";
version = "17.4";
src = fetchPypi {
inherit pname version;
sha256 = "9deab442963a63a71ab494bf581b1c844473995a2357f4b3228a1df1c8cba8da";
sha256 = "82d68175feec897af2a38fe8590778f14c3be5324cc62e3ce5752a9b1e4b60ab";
};
checkInputs = [ pytest ];
propagatedBuildInputs = [
bleach docutils pygments six
CommonMark bleach docutils pygments six
];
checkPhase = ''
@@ -33,4 +33,4 @@ buildPythonPackage rec {
homepage = https://github.com/pypa/readme_renderer;
license = lib.licenses.asl20;
};
}
}

View File

@@ -1,16 +1,15 @@
{ stdenv, fetchurl, buildPythonPackage, pyparsing, argparse, robotframework }:
{ stdenv, fetchPypi, buildPythonPackage, pyparsing, argparse, robotframework, allpairspy }:
buildPythonPackage rec {
pname = "robomachine";
pname = "RoboMachine";
version = "0.8.0";
name = pname + "-" + version;
src = fetchurl {
url = "mirror://pypi/R/RoboMachine/RoboMachine-0.6.tar.gz";
src = fetchPypi {
inherit pname version;
sha256 = "242cfd9be0f7591138eaeba03c9c190f894ce045e1767ab7b90eca330259fc45";
};
propagatedBuildInputs = [ pyparsing argparse robotframework ];
propagatedBuildInputs = [ pyparsing argparse robotframework allpairspy ];
# Remove Windows .bat files
postInstall = ''

View File

@@ -21,8 +21,9 @@ buildPythonPackage rec {
LC_ALL="en_US.UTF-8";
# Disable doctests on OSX: https://github.com/scikit-learn/scikit-learn/issues/10213
# Disable doctests everywhere: https://github.com/NixOS/nixpkgs/issues/35436
checkPhase = ''
HOME=$TMPDIR OMP_NUM_THREADS=1 nosetests ${stdenv.lib.optionalString stdenv.isDarwin "--doctest-options=+SKIP"} $out/${python.sitePackages}/sklearn/
HOME=$TMPDIR OMP_NUM_THREADS=1 nosetests --doctest-options=+SKIP $out/${python.sitePackages}/sklearn/
'';
meta = with stdenv.lib; {