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
commit 3d183c14d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; {

View File

@ -0,0 +1,40 @@
{ lib, python, fetchFromGitHub }:
python.pkgs.buildPythonApplication rec {
pname = "klaus";
version = "1.2.2";
src = fetchFromGitHub {
owner = "jonashaag";
repo = pname;
rev = version;
sha256 = "0hkl1ycyd5ccijmknr3yfp3ga43y01m7390xnibqqgaisfvcm9wp";
};
prePatch = ''
substituteInPlace runtests.sh \
--replace "mkdir -p \$builddir" "mkdir -p \$builddir && pwd"
'';
propagatedBuildInputs = with python.pkgs; [
six flask pygments dulwich httpauth humanize
];
checkInputs = with python.pkgs; [
pytest requests python-ctags3
] ++ lib.optional (!isPy3k) mock;
checkPhase = ''
./runtests.sh
'';
# Needs to set up some git repos
doCheck = false;
meta = with lib; {
description = "The first Git web viewer that Just Works";
homepage = https://github.com/jonashaag/klaus;
license = licenses.isc;
maintainers = with maintainers; [ matthiasbeyer ];
};
}

View File

@ -1280,6 +1280,8 @@ with pkgs;
kisslicer = callPackage ../tools/misc/kisslicer { };
klaus = callPackage ../servers/web-apps/klaus { };
lcdproc = callPackage ../servers/monitoring/lcdproc { };
languagetool = callPackage ../tools/text/languagetool { };

View File

@ -456,6 +456,8 @@ in {
alembic = callPackage ../development/python-modules/alembic {};
allpairspy = callPackage ../development/python-modules/allpairspy { };
ansicolors = callPackage ../development/python-modules/ansicolors {};
aniso8601 = callPackage ../development/python-modules/aniso8601 {};
@ -1461,6 +1463,8 @@ in {
inherit (pkgs.dlib) name src nativeBuildInputs meta;
buildInputs = pkgs.dlib.buildInputs ++ [ self.boost ];
checkInputs = with self; [ pytest ];
};
datadog = buildPythonPackage rec {
@ -2349,36 +2353,15 @@ in {
colorlover = callPackage ../development/python-modules/colorlover { };
CommonMark = buildPythonPackage rec {
name = "CommonMark-${version}";
version = "0.6.3";
CommonMark = callPackage ../development/python-modules/commonmark { };
src = pkgs.fetchurl {
url = "mirror://pypi/C/CommonMark/${name}.tar.gz";
sha256 = "ee5a88f23678794592efe3fc11033f17fc77b3296a85f5e1d5b715f8e110a773";
};
LC_ALL="en_US.UTF-8";
doCheck = false;
buildInputs = with self; [ flake8 pkgs.glibcLocales ];
propagatedBuildInputs = with self; [ future ];
meta = {
description = "Python parser for the CommonMark Markdown spec";
homepage = https://github.com/rolandshoemaker/CommonMark-py;
license = licenses.bsd3;
};
};
CommonMark_54 = self.CommonMark.override rec {
name = "CommonMark-0.5.4";
src = pkgs.fetchurl {
url = "mirror://pypi/C/CommonMark/${name}.tar.gz";
CommonMark_54 = self.CommonMark.overridePythonAttrs (oldAttrs: rec {
version = "0.5.4";
src = oldAttrs.src.override {
inherit version;
sha256 = "34d73ec8085923c023930dfc0bcd1c4286e28a2a82de094bb72fabcc0281cbe5";
};
};
});
coilmq = buildPythonPackage (rec {
@ -2405,21 +2388,7 @@ in {
});
colander = buildPythonPackage rec {
name = "colander-1.0";
src = pkgs.fetchurl {
url = "mirror://pypi/c/colander/${name}.tar.gz";
sha256 = "7389413266b9e680c9529c16d56284edf87e0d5de557948e75f41d65683c23b3";
};
propagatedBuildInputs = with self; [ self.translationstring self.iso8601 ];
meta = {
maintainers = with maintainers; [ garbas domenkozar ];
platforms = platforms.all;
};
};
colander = callPackage ../development/python-modules/colander { };
# Backported version of the ConfigParser library of Python 3.3
configparser = if isPy3k then null else buildPythonPackage rec {
@ -6115,6 +6084,8 @@ in {
};
};
python-ctags3 = callPackage ../development/python-modules/python-ctags3 { };
junos-eznc = callPackage ../development/python-modules/junos-eznc {};
raven = callPackage ../development/python-modules/raven { };
@ -8397,17 +8368,7 @@ in {
};
};
hvac = buildPythonPackage rec {
name = "hvac-${version}";
version = "0.2.15";
src = pkgs.fetchurl {
url = "https://pypi.python.org/packages/11/ba/6101780891b9d55f6174fa78b47d462c8c1f0cde34072b45fc39f7f8a77c/hvac-0.2.15.tar.gz";
sha256 = "0qxa4g1ij1bj27mbp8l54lcr7d5krkb2rayisc6shkpf2b51ip4c";
};
propagatedBuildInputs = with self; [ requests ];
};
hvac = callPackage ../development/python-modules/hvac { };
hypothesis = callPackage ../development/python-modules/hypothesis { };
@ -8960,27 +8921,6 @@ in {
keyutils = callPackage ../development/python-modules/keyutils { };
klaus = buildPythonPackage rec {
version = "0.9.1";
name = "klaus-${version}";
src = pkgs.fetchurl {
url = "https://github.com/jonashaag/klaus/archive/${version}.tar.gz";
sha256 = "0k3v3p56hq8alm083grrp98znxkz1zqx0pczm2lah8qddbyrdkgm";
};
propagatedBuildInputs = with self;
[ humanize httpauth dulwich pygments flask six ];
meta = {
description = "The first Git web viewer that Just Works";
homepage = "https://github.com/jonashaag/klaus";
#license = licenses.mit; # I'm not sure about the license
maintainers = with maintainers; [ matthiasbeyer ];
platforms = platforms.linux; # Can only test linux
};
};
klein = buildPythonPackage rec {
name = "klein-15.3.1";
src = pkgs.fetchurl {
@ -11886,22 +11826,7 @@ in {
pathpy = callPackage ../development/python-modules/path.py { };
paypalrestsdk = buildPythonPackage rec {
name = "paypalrestsdk-0.7.0";
src = pkgs.fetchurl {
url = "mirror://pypi/p/paypalrestsdk/${name}.tar.gz";
sha256 = "117kfipzfahf9ysv414bh1mmm5cc9ck5zb6rhpslx1f8gk3frvd6";
};
propagatedBuildInputs = with self; [ httplib2 ];
meta = {
homepage = https://developer.paypal.com/;
description = "Python APIs to create, process and manage payment";
license = "PayPal SDK License";
};
};
paypalrestsdk = callPackage ../development/python-modules/paypalrestsdk { };
pbr = callPackage ../development/python-modules/pbr { };
@ -13915,23 +13840,6 @@ in {
};
};
pysphere = buildPythonPackage rec {
name = "pysphere-0.1.8";
src = pkgs.fetchurl {
url = "http://pysphere.googlecode.com/files/${name}.zip";
sha256 = "b3f9ba1f67afb17ac41725b01737cd42e8a39d9e745282dd9b692ae631af0add";
};
disabled = isPy3k;
meta = {
homepage = "https://code.google.com/p/pysphere/";
license = "BSD";
description = "Python API for interaction with the VMWare vSphere";
};
};
pysqlite = buildPythonPackage rec {
name = "pysqlite-2.8.3";
@ -18727,17 +18635,7 @@ EOF
};
};
pushbullet = buildPythonPackage rec {
name = "pushbullet.py-${version}";
version = "0.10.0";
src = pkgs.fetchurl {
url = "mirror://pypi/p/pushbullet.py/pushbullet.py-0.10.0.tar.gz";
sha256 = "537d3132e1dbc91e31ade4cccf4c7def6f9d48e904a67f341d35b8a54a9be74d";
};
propagatedBuildInputs = with self; [requests websocket_client python_magic ];
};
pushbullet = callPackage ../development/python-modules/pushbullet { };
power = buildPythonPackage rec {
name = "power-1.4";