Merge branch 'master' into staging-next

Hydra: ?compare=1468896
This commit is contained in:
Vladimír Čunát
2018-07-14 18:12:49 +02:00
721 changed files with 20508 additions and 20874 deletions

View File

@@ -44,7 +44,7 @@ in buildPythonPackage rec {
checkPhase = ''
export HOME="$NIX_BUILD_TOP"
${python.interpreter} runtests.py \
${python.interpreter} runtests.py -j$NIX_BUILD_CORES \
${stdenv.lib.optionalString (builtins.length excludedTests != 0)
''--exclude="(${builtins.concatStringsSep "|" excludedTests})"''}
'';

View File

@@ -1,26 +1,37 @@
{ stdenv, fetchPypi, buildPythonPackage, isPy3k,
discid, six, parsedatetime, isodate, Babel, pytimeparse,
leather, python-slugify }:
{ lib, fetchFromGitHub, buildPythonPackage, isPy3k
, six, pytimeparse, parsedatetime, Babel
, isodate, python-slugify, leather
, glibcLocales, nose, lxml, cssselect, unittest2 }:
buildPythonPackage rec {
pname = "agate";
version = "1.6.1";
pname = "agate";
version = "1.6.1";
src = fetchPypi {
inherit pname version;
sha256 = "c93aaa500b439d71e4a5cf088d0006d2ce2c76f1950960c8843114e5f361dfd3";
};
# PyPI tarball does not include all test files
# https://github.com/wireservice/agate/pull/716
src = fetchFromGitHub {
owner = "wireservice";
repo = pname;
rev = version;
sha256 = "077zj8xad8hsa3nqywvf7ircirmx3krxdipl8wr3dynv3l3khcpl";
};
propagatedBuildInputs = [ discid six parsedatetime
isodate Babel pytimeparse leather python-slugify ];
propagatedBuildInputs = [
six pytimeparse parsedatetime Babel
isodate python-slugify leather
];
doCheck = !isPy3k;
# (only) on python3 unittest loader (loadTestsFromModule) fails
checkInputs = [ glibcLocales nose lxml cssselect ]
++ lib.optional (!isPy3k) unittest2;
meta = with stdenv.lib; {
description = "A Python data analysis library that is optimized for humans instead of machines";
homepage = https://github.com/wireservice/agate;
license = with licenses; [ mit ];
maintainers = with maintainers; [ vrthra ];
};
checkPhase = ''
LC_ALL="en_US.UTF-8" nosetests tests
'';
meta = with lib; {
description = "A Python data analysis library that is optimized for humans instead of machines";
homepage = https://github.com/wireservice/agate;
license = with licenses; [ mit ];
maintainers = with maintainers; [ vrthra ];
};
}

View File

@@ -5,11 +5,11 @@
buildPythonPackage rec {
pname = "alembic";
version = "0.9.9";
version = "0.9.10";
src = fetchPypi {
inherit pname version;
sha256 = "85bd3ea7633024e4930900bc64fb58f9742dedbc6ebb6ecf25be2ea9a3c1b32e";
sha256 = "1cd32df9a3b8c1749082ef60ffbe05ff16617b6afadfdabc680dcb9344af33d7";
};
buildInputs = [ pytest pytestcov mock coverage ];

View File

@@ -4,17 +4,14 @@
buildPythonPackage rec {
pname = "asyncssh";
version = "1.13.1";
version = "1.13.2";
disabled = pythonOlder "3.4";
src = fetchPypi {
inherit pname version;
sha256 = "a44736830741e2bb9c4e3992819288b77ac4af217a46d12f415bb57c18ed9c22";
sha256 = "e4c07577d021c68d4c8e6d1897987424cc25b58e0726f31ff72476a34ddb6deb";
};
# See https://github.com/ronf/asyncssh/commit/6a92930e00f3bbc67d9cdf66816917e64f2450e9#r29559647
patches = ./mock_getnameinfo.patch;
propagatedBuildInputs = [
bcrypt
cryptography

View File

@@ -1,159 +0,0 @@
diff --git a/tests/server.py b/tests/server.py
index fbd7e37..e7542dc 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -208,12 +208,10 @@ class ServerTestCase(AsyncTestCase):
cls._server = yield from cls.start_server()
sock = cls._server.sockets[0]
- cls._client_host, _ = yield from cls.loop.getnameinfo(('127.0.0.1', 0))
cls._server_addr = '127.0.0.1'
cls._server_port = sock.getsockname()[1]
- host = '[%s]:%d,%s ' % (cls._server_addr, cls._server_port,
- cls._client_host)
+ host = '[%s]:%d,localhost ' % (cls._server_addr, cls._server_port)
with open('known_hosts', 'w') as known_hosts:
known_hosts.write(host)
diff --git a/tests/test_auth_keys.py b/tests/test_auth_keys.py
index 1d625ef..72a49f7 100644
--- a/tests/test_auth_keys.py
+++ b/tests/test_auth_keys.py
@@ -13,13 +13,13 @@
"""Unit tests for matching against authorized_keys file"""
import unittest
-from unittest.mock import patch
import asyncssh
-from .util import TempDirTestCase, x509_available
+from .util import TempDirTestCase, patch_getnameinfo, x509_available
+@patch_getnameinfo
class _TestAuthorizedKeys(TempDirTestCase):
"""Unit tests for auth_keys module"""
@@ -69,36 +69,22 @@ class _TestAuthorizedKeys(TempDirTestCase):
def match_keys(self, tests, x509=False):
"""Match against authorized keys"""
- def getnameinfo(sockaddr, flags):
- """Mock reverse DNS lookup of client address"""
-
- # pylint: disable=unused-argument
-
- host, port = sockaddr
-
- if host == '127.0.0.1':
- return ('localhost', port)
- else:
- return sockaddr
-
- with patch('socket.getnameinfo', getnameinfo):
- for keys, matches in tests:
- auth_keys = self.build_keys(keys, x509)
- for (msg, keynum, client_addr,
- cert_principals, match) in matches:
- with self.subTest(msg, x509=x509):
- if x509:
- result, trusted_cert = auth_keys.validate_x509(
- self.imported_certlist[keynum], client_addr)
- if (trusted_cert and trusted_cert.subject !=
- self.imported_certlist[keynum].subject):
- result = None
- else:
- result = auth_keys.validate(
- self.imported_keylist[keynum], client_addr,
- cert_principals, keynum == 1)
-
- self.assertEqual(result is not None, match)
+ for keys, matches in tests:
+ auth_keys = self.build_keys(keys, x509)
+ for (msg, keynum, client_addr, cert_principals, match) in matches:
+ with self.subTest(msg, x509=x509):
+ if x509:
+ result, trusted_cert = auth_keys.validate_x509(
+ self.imported_certlist[keynum], client_addr)
+ if (trusted_cert and trusted_cert.subject !=
+ self.imported_certlist[keynum].subject):
+ result = None
+ else:
+ result = auth_keys.validate(
+ self.imported_keylist[keynum], client_addr,
+ cert_principals, keynum == 1)
+
+ self.assertEqual(result is not None, match)
def test_matches(self):
"""Test authorized keys matching"""
diff --git a/tests/test_connection_auth.py b/tests/test_connection_auth.py
index 3da8a5b..ff3e3cc 100644
--- a/tests/test_connection_auth.py
+++ b/tests/test_connection_auth.py
@@ -23,8 +23,8 @@ from asyncssh.packet import String
from asyncssh.public_key import CERT_TYPE_USER, CERT_TYPE_HOST
from .server import Server, ServerTestCase
-from .util import asynctest, gss_available, patch_gss, make_certificate
-from .util import x509_available
+from .util import asynctest, gss_available, patch_getnameinfo, patch_gss
+from .util import make_certificate, x509_available
class _FailValidateHostSSHServerConnection(asyncssh.SSHServerConnection):
@@ -455,6 +455,7 @@ class _TestGSSFQDN(ServerTestCase):
yield from conn.wait_closed()
+@patch_getnameinfo
class _TestHostBasedAuth(ServerTestCase):
"""Unit tests for host-based authentication"""
@@ -579,7 +580,7 @@ class _TestHostBasedAuth(ServerTestCase):
"""Test stripping of trailing dot from client host"""
with (yield from self.connect(username='user', client_host_keys='skey',
- client_host=self._client_host + '.',
+ client_host='localhost.',
client_username='user')) as conn:
pass
@@ -667,6 +668,7 @@ class _TestHostBasedAsyncServerAuth(_TestHostBasedAuth):
client_username='user')
+@patch_getnameinfo
class _TestLimitedHostBasedSignatureAlgs(ServerTestCase):
"""Unit tests for limited host key signature algorithms"""
diff --git a/tests/util.py b/tests/util.py
index 42bb596..4d92ec3 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -84,6 +84,24 @@ def asynctest35(func):
return async_wrapper
+def patch_getnameinfo(cls):
+ """Decorator for patching socket.getnameinfo"""
+
+ def getnameinfo(sockaddr, flags):
+ """Mock reverse DNS lookup of client address"""
+
+ # pylint: disable=unused-argument
+
+ host, port = sockaddr
+
+ if host == '127.0.0.1':
+ return ('localhost', port)
+ else:
+ return sockaddr
+
+ return patch('socket.getnameinfo', getnameinfo)(cls)
+
+
def patch_gss(cls):
"""Decorator for patching GSSAPI classes"""

View File

@@ -0,0 +1,28 @@
{ stdenv, fetchPypi, buildPythonPackage, python }:
buildPythonPackage rec {
pname = "authres";
version = "1.1.0";
src = fetchPypi {
inherit pname version;
sha256 = "1mcllhrwr23hwa2jn3m15k29ks1205ymwafjzchh8ma664hnzv6v";
};
checkPhase = ''
# run doctests
${python.interpreter} -m authres
'';
meta = with stdenv.lib; {
description = "Email Authentication-Results Headers generation and parsing for Python/Python3";
longDescription = ''
Python module that implements various internet RFC's: 5451/7001/7601
Authentication-Results Headers generation and parsing for
Python/Python3.
'';
homepage = https://launchpad.net/authres;
license = licenses.bsd3;
maintainers = with maintainers; [ leenaars ];
};
}

View File

@@ -13,13 +13,13 @@
buildPythonPackage rec {
pname = "boto3";
version = "1.7.48";
version = "1.7.57";
src = fetchFromGitHub {
owner = "boto";
repo = "boto3";
rev = version;
sha256 = "0pag37yy6693k8xvlyx4f06asab52i89xljy2ip121i60ih3jfw4";
sha256 = "0rp3vclx7mvfl6isa47m7dzlrf33qb9vj53p0gj4cw3mgl14cnbl";
};
propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ];

View File

@@ -11,11 +11,11 @@
buildPythonPackage rec {
pname = "botocore";
version = "1.10.48";
version = "1.10.57";
src = fetchPypi {
inherit pname version;
sha256 = "1432drc7482nwrppwkk1i6ars3wz9w2g9rsxkz5nlxmyf9qm260j";
sha256 = "0mif7c12643hac6zxq89gv0wjf4r3vqlmm01bm68psljaj40jnpi";
};
propagatedBuildInputs = [

View File

@@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, iana-etc, libredirect,
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, iana-etc, libredirect,
pytest, case, kombu, billiard, pytz, anyjson, amqp, eventlet
}:
@@ -11,6 +11,13 @@ buildPythonPackage rec {
sha256 = "ff727c115533edbc7b81b2b4ba1ec88d1c2fc4836e1e2f4c3c33a76ff53e5d7f";
};
# Skip test_RedisBackend.test_timeouts_in_url_coerced
# See https://github.com/celery/celery/pull/4847
patches = fetchpatch {
url = https://github.com/celery/celery/commit/b2668607c909c61becd151905b4525190c19ff4a.patch;
sha256 = "11w0z2ycyh8kccj4y69zb7bxppiipcwwigg6jn1q9yrcsvz170jq";
};
# make /etc/protocols accessible to fix socket.getprotobyname('tcp') in sandbox
preCheck = stdenv.lib.optionalString stdenv.isLinux ''
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols \

View File

@@ -1,19 +1,15 @@
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, cryptography, boto3, pyyaml, docutils }:
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, cryptography, boto3, pyyaml, docutils, nose }:
buildPythonPackage rec {
pname = "credstash";
version = "1.14.0";
version = "1.15.0";
src = fetchPypi {
inherit pname version;
sha256 = "718b337f7a6fa001e014386071f05c59900525d0507009126d2fe8d75fe0761d";
sha256 = "814560f99ae2409e2c6d906d878f9dadada5d1d0a950aafb6b2c0d535291bdfb";
};
patches = fetchpatch {
url = https://github.com/fugue/credstash/pull/178.patch;
sha256 = "15ih4h5v63g7qfmqdl4zca147wkcrx8vnsh4ns33001dipcfb5sc";
excludes = [ ".travis.yml" ];
};
nativeBuildInputs = [ nose ];
propagatedBuildInputs = [ cryptography boto3 pyyaml docutils ];

View File

@@ -7,16 +7,15 @@
, gmp
, cython
, cysignals
, six
}:
buildPythonPackage rec {
pname = "cypari2";
version = "1.1.4"; # remove six dependency on upgrade to >1.1.4
version = "1.2.1";
src = fetchPypi {
inherit pname version;
sha256 = "0n0mp8qmvvzmfaawg39d3mkyzf65q2zkz7bnqyk4sfjbz4xwc6mb";
sha256 = "0v2kikwf0advq8j76nwzhlacwj1yys9cvajm4fqgmasjdsnf1q4k";
};
# This differs slightly from the default python installPhase in that it pip-installs
@@ -39,7 +38,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [
cysignals
cython
six # after 1.1.4: will not be needed
];
checkPhase = ''

View File

@@ -9,11 +9,11 @@ assert pariSupport -> pari != null;
buildPythonPackage rec {
pname = "cysignals";
version = "1.7.1";
version = "1.7.2";
src = fetchPypi {
inherit pname version;
sha256 = "15nky8siwlc7s8v23vv4m0mnxa1z6jcs2qfr26m2mkw9j9g2na2j";
sha256 = "0rzwd9bjw6bj01xcmimqfim1g0njjyyyal0f93frm1la4hcmq96v";
};
# explicit check:
@@ -23,6 +23,7 @@ buildPythonPackage rec {
];
# currently fails, probably because of formatting changes in gdb 8.0
# https://trac.sagemath.org/ticket/24692
doCheck = false;
preCheck = ''

View File

@@ -1,24 +1,36 @@
{ stdenv, buildPythonPackage, fetchFromGitHub
, vobject, mock, tox, pytestcov, pytest-django, pytest, shortuuid
, django, six
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
, six, typing
, django, shortuuid, python-dateutil, pytest
, pytest-django, pytestcov, mock, vobject
, werkzeug, glibcLocales
}:
buildPythonPackage rec {
pname = "django-extensions";
version = "1.8.1";
version = "2.0.7";
src = fetchFromGitHub {
owner = "${pname}";
repo = "${pname}";
rev = "${version}";
sha256 = "08rd9zswvjb9dixzyd3p3l3hw3wwhqkgyjvid65niybzjl1xdb5h";
owner = pname;
repo = pname;
rev = version;
sha256 = "1xf84wq7ab1zfb3nmf4qgw6mjf5xafjwr3175dyrqrrn6cpvcr4a";
};
buildInputs = [ vobject mock tox pytestcov pytest-django pytest shortuuid ];
postPatch = ''
substituteInPlace setup.py --replace "'tox'," ""
'';
propagatedBuildInputs = [ django six ];
propagatedBuildInputs = [ six ] ++ lib.optional (pythonOlder "3.5") typing;
meta = with stdenv.lib; {
checkInputs = [
django shortuuid python-dateutil pytest
pytest-django pytestcov mock vobject
werkzeug glibcLocales
];
LC_ALL = "en_US.UTF-8";
meta = with lib; {
description = "A collection of custom extensions for the Django Framework";
homepage = https://github.com/django-extensions/django-extensions;
license = licenses.mit;

View File

@@ -1,5 +1,6 @@
{ lib, buildPythonPackage, fetchPypi,
celery, django, psycopg2
{ lib, buildPythonPackage, fetchPypi
, glibcLocales
, celery, django, psycopg2
}:
buildPythonPackage rec {
@@ -7,7 +8,7 @@ buildPythonPackage rec {
version = "1.1.0";
meta = {
description = "Simple, powerfull and nonobstructive django email middleware.";
description = "Simple, powerfull and nonobstructive django email middleware";
homepage = https://github.com/bameda/djmail;
license = lib.licenses.bsd3;
};
@@ -17,6 +18,10 @@ buildPythonPackage rec {
sha256 = "87d2a8b4bdf67ae9b312e127ccc873a53116cf297ec786460d782ce82eaa76b5";
};
nativeBuildInputs = [ glibcLocales ];
LC_ALL = "en_US.UTF-8";
propagatedBuildInputs = [ celery django psycopg2 ];
# django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

View File

@@ -1,38 +1,25 @@
{ stdenv, fetchurl, openssl, makeWrapper, buildPythonApplication
, pytest, dnspython }:
{ stdenv, fetchPypi, openssl, makeWrapper, buildPythonPackage
, pytest, dnspython, pynacl, authres, python }:
let
majorversion = "0.6";
minorversion = "2";
in buildPythonApplication rec {
buildPythonPackage rec {
pname = "dkimpy";
version = "${majorversion}.${minorversion}";
version = "0.8.1";
src = fetchurl {
url = "https://launchpad.net/${pname}/${majorversion}/${majorversion}.${minorversion}/+download/${pname}-${version}.tar.gz";
sha256 = "1hagz8qk0v4ijfbcdq4z28bpgr2mkpr498z76i1vam2d50chmakl";
};
src = fetchPypi {
inherit pname version;
sha256 = "125xakqg2j5jp4k5kafpnpazh9d97ysgayrsgpvm3nkdj4g8hw1j";
};
checkInputs = [ pytest ];
propagatedBuildInputs = [ openssl dnspython ];
propagatedBuildInputs = [ openssl dnspython pynacl authres ];
patchPhase = ''
substituteInPlace dknewkey.py --replace \
substituteInPlace dkim/dknewkey.py --replace \
/usr/bin/openssl ${openssl}/bin/openssl
'';
checkPhase = ''
python ./test.py
'';
postInstall = ''
mkdir -p $out/bin $out/libexec
mv $out/bin/*.py $out/libexec
makeWrapper "$out/libexec/dkimverify.py" $out/bin/dkimverify
makeWrapper "$out/libexec/dkimsign.py" $out/bin/dkimsign
makeWrapper "$out/libexec/arcverify.py" $out/bin/arcverify
makeWrapper "$out/libexec/arcsign.py" $out/bin/arcsign
makeWrapper "$out/libexec/dknewkey.py" $out/bin/dknewkey
${python.interpreter} ./test.py
'';
meta = with stdenv.lib; {

View File

@@ -0,0 +1,58 @@
{ lib
, buildPythonPackage
, python
, pygobject3
, pyatspi
, pycairo
, at-spi2-core
, gobjectIntrospection
, gtk3
, gsettings-desktop-schemas
, fetchurl
, dbus
, xvfb_run
# , fetchPypi
}:
buildPythonPackage rec {
pname = "dogtail";
version = "0.9.10";
# https://gitlab.com/dogtail/dogtail/issues/1
# src = fetchPypi {
# inherit pname version;
# sha256 = "0p5wfssvzr9w0bvhllzbbd8fnp4cca2qxcpcsc33dchrmh5n552x";
# };
src = fetchurl {
url = https://gitlab.com/dogtail/dogtail/raw/released/dogtail-0.9.10.tar.gz;
sha256 = "14sycidl8ahj3fwlhpwlpnyd43c302yqr7nqg2hj39pyj7kgk15b";
};
patches = [
./nix-support.patch
];
nativeBuildInputs = [ gobjectIntrospection dbus xvfb_run ]; # for setup hooks
propagatedBuildInputs = [ at-spi2-core gtk3 pygobject3 pyatspi pycairo ];
checkPhase = ''
runHook preCheck
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:$XDG_DATA_DIRS
# export NO_AT_BRIDGE=1
gsettings set org.gnome.desktop.interface toolkit-accessibility true
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
${python.interpreter} nix_run_setup test
runHook postCheck
'';
# TODO: Tests require accessibility
doCheck = false;
meta = {
description = "GUI test tool and automation framework that uses Accessibility technologies to communicate with desktop applications";
homepage = https://gitlab.com/dogtail/dogtail;
license = lib.licenses.gpl2;
maintainers = with lib.maintainers; [ jtojnar ];
};
}

View File

@@ -0,0 +1,35 @@
--- a/dogtail/distro.py
+++ b/dogtail/distro.py
@@ -233,6 +233,11 @@
PackageDb.__init__(self)
+class _NixPackageDb(PackageDb): # pragma: no cover
+ def __init__(self):
+ PackageDb.__init__(self)
+
+
class JhBuildPackageDb(PackageDb): # pragma: no cover
def __init__(self):
PackageDb.__init__(self)
@@ -324,6 +329,11 @@
self.packageDb = _SolarisPackageDb()
+class Nix(Distro): # pragma: no cover
+ def __init__(self):
+ self.packageDb = _NixPackageDb()
+
+
class JHBuild(Distro): # pragma: no cover
def __init__(self):
self.packageDb = JhBuildPackageDb()
@@ -358,6 +368,8 @@
elif os.path.exists("/etc/release") and \
re.match(".*Solaris", open("/etc/release").readline()): # pragma: no cover
distro = Solaris() # pragma: no cover
+ elif os.path.exists("/nix/store"): # pragma: no cover
+ distro = Nix() # pragma: no cover
elif os.path.exists("/etc/os-release") and \
re.match(".*GNOME-Continuous", open("/etc/os-release").readline()): # pragma: no cover
distro = GnomeContinuous() # pragma: no cover

View File

@@ -4,17 +4,12 @@
buildPythonPackage rec {
pname = "Eve";
version = "0.8";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "9f926c715f88c7a92dc2b950ccc09cccd91f72fe0e93cde806b85d25b947df2f";
};
patches = [
./setup.patch
];
propagatedBuildInputs = [
cerberus
events

View File

@@ -1,21 +0,0 @@
diff --git i/setup.py w/setup.py
index 0176467..2b74988 100755
--- i/setup.py
+++ w/setup.py
@@ -9,11 +9,11 @@ install_requires = [
'cerberus>=0.9.2,<0.10',
'events>=0.2.1,<0.3',
'simplejson>=3.3.0,<4.0',
- 'werkzeug>=0.9.4,<=0.11.15',
- 'markupsafe>=0.23,<1.0',
- 'jinja2>=2.8,<3.0',
- 'itsdangerous>=0.24,<1.0',
- 'flask>=0.10.1,<=0.12',
+ 'werkzeug>=0.9.4',
+ 'markupsafe>=0.23',
+ 'jinja2>=2.8',
+ 'itsdangerous>=0.24',
+ 'flask>=0.10.1',
'pymongo>=3.4',
'flask-pymongo>=0.4',
]

View File

@@ -0,0 +1,17 @@
{ lib, buildPythonPackage, fetchPypi }:
buildPythonPackage rec {
pname = "Events";
version = "0.3";
src = fetchPypi {
inherit pname version;
sha256 = "f4d9c41a5c160ce504278f219fe56f44242ca63794a0ad638b52d1e087ac2a41";
};
meta = with lib; {
homepage = http://events.readthedocs.org;
description = "Bringing the elegance of C# EventHanlder to Python";
license = licenses.bsd3;
};
}

View File

@@ -1,6 +1,6 @@
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, fetchPypi
, flask
, flask-silk
, future
@@ -8,16 +8,11 @@
buildPythonPackage rec {
pname = "Flask-AutoIndex";
version = "2018-06-28";
version = "0.6.1";
# master fixes various issues (binary generation, flask syntax) and has no
# major changes
# new release requested: https://github.com/sublee/flask-autoindex/issues/38
src = fetchFromGitHub {
owner = "sublee";
repo = "flask-autoindex";
rev = "e3d449a89d56bf4c171c7c8d90af028e579782cf";
sha256 = "0bwq2nid4h8vrxspggk064vra4wd804cl2ryyx4j2d1dyywmgjgy";
src = fetchPypi {
inherit pname version;
sha256 = "0v87sa073hmj64f47sazbiw08kyxsxay100bd5084jwq7c1y92d7";
};
propagatedBuildInputs = [

View File

@@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, isPy3k
{ lib, buildPythonPackage, fetchPypi, fetchpatch, isPy3k
, nose, mock, blinker
, flask, six, pytz, aniso8601, pycrypto
}:
@@ -12,19 +12,27 @@ buildPythonPackage rec {
sha256 = "01rlvl2iq074ciyn4schmjip7cyplkwkysbb8f610zil06am35ap";
};
# TypeError: Only byte strings can be passed to C code
patchPhase = if isPy3k then ''
rm tests/test_crypto.py tests/test_paging.py
'' else null;
# Disable test broken with aniso > 3.0.0, can be removed when updating to a flask-restful version with commit 54979f0
preCheck = ''
substituteInPlace "./tests/test_inputs.py" --replace "test_bad_isointervals" "disabled_bad_isointervals"
'';
buildInputs = [ nose mock blinker ];
propagatedBuildInputs = [ flask six pytz aniso8601 pycrypto ];
PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
patches = [
(fetchpatch {
url = https://github.com/flask-restful/flask-restful/commit/54979f0a49b2217babc53c5b65b5df10b6de8e05.patch;
sha256 = "11s6ag6l42g61ccg5jw9j1f26hwgjfa3sp890cbl5r4hy5ycpyr5";
})
(fetchpatch {
url = https://github.com/flask-restful/flask-restful/commit/f45e81a45ed03922fd225afe27006315811077e6.patch;
sha256 = "16avd369j5r08d1l23mwbba26zjwnmfqvfvnfz02am3gr5l6p3gl";
})
];
meta = with stdenv.lib; {
postPatch = lib.optionalString isPy3k ''
# TypeError: Only byte strings can be passed to C code
rm tests/test_crypto.py tests/test_paging.py
'';
checkInputs = [ nose mock blinker ];
propagatedBuildInputs = [ flask six pytz aniso8601 pycrypto ];
meta = with lib; {
homepage = "http://flask-restful.readthedocs.io/";
description = "REST API building blocks for Flask";
license = licenses.bsd3;

View File

@@ -2,11 +2,13 @@
buildPythonPackage rec {
pname = "geojson";
version = "2.3.0";
version = "2.4.0";
format = "wheel";
src = fetchPypi {
inherit pname version;
sha256 = "06ihcb8839zzgk5jcv18kc6nqld4hhj3nk4f3drzcr8n8893v1y8";
inherit pname version format;
sha256 = "0r9pc8hgnc5hf5rq98vinbrncn08v4kgzdfmfs14rfypvacsmfpj";
};
LC_ALL = "en_US.UTF-8";

View File

@@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchPypi
, httplib2, six, google-auth-httplib2, uritemplate }:
, httplib2, google_auth, google-auth-httplib2, six, uritemplate, oauth2client }:
buildPythonPackage rec {
pname = "google-api-python-client";
@@ -13,7 +13,7 @@ buildPythonPackage rec {
# No tests included in archive
doCheck = false;
propagatedBuildInputs = [ httplib2 google-auth-httplib2 six uritemplate ];
propagatedBuildInputs = [ httplib2 google_auth google-auth-httplib2 six uritemplate oauth2client ];
meta = with lib; {
description = "The core Python library for accessing Google APIs";

View File

@@ -0,0 +1,25 @@
{ stdenv, buildPythonPackage, fetchPypi, lib, grpc, grpcio}:
buildPythonPackage rec {
pname = "grpcio-tools";
version = "1.13.0";
src = fetchPypi {
inherit pname version;
sha256 = "1ck6818kb4nb6skm9lqg492brqs7kfk65f4hh2c7h7c8pkbrpcw1";
};
enableParallelBuilding = true;
propagatedBuildInputs = [ grpc grpcio ];
# no tests in the package
doCheck = false;
meta = with stdenv.lib; {
description = "Protobuf code generator for gRPC";
license = lib.licenses.asl20;
homepage = "https://grpc.io/grpc/python/";
maintainers = with maintainers; [ vanschelven ];
};
}

View File

@@ -16,7 +16,7 @@ buildPythonPackage rec {
meta = with stdenv.lib; {
description = "HTTP/2-based RPC framework";
license = lib.licenses.bsd3;
license = lib.licenses.asl20;
homepage = "https://grpc.io/grpc/python/";
maintainers = with maintainers; [ vanschelven ];
};

View File

@@ -1,31 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytestrunner
, dateutil
, babelfish
, rebulk
}:
buildPythonPackage rec {
pname = "guessit";
version = "3.0.0";
src = fetchPypi {
inherit pname version;
sha256 = "bf17e78783cf13bf903750770de4c3bb6c9ca89baafedb1612794660b6ebe32b";
};
# Tests require more packages.
doCheck = false;
buildInputs = [ pytestrunner ];
propagatedBuildInputs = [
dateutil babelfish rebulk
];
meta = {
homepage = https://pypi.python.org/pypi/guessit;
license = lib.licenses.lgpl3;
description = "A library for guessing information from video files";
};
}

View File

@@ -1,17 +1,19 @@
{ lib, buildPythonPackage, fetchPypi, keyutils, pytestrunner }:
{ lib, buildPythonPackage, fetchFromGitHub, keyutils, pytestrunner, pytest }:
buildPythonPackage rec {
pname = "keyutils";
version = "0.5";
src = fetchPypi {
inherit pname version;
sha256 = "0dskys71vkn59vlsfs1ljli0qnzk7b10iv4pawxawnk2hvyjrf10";
# github version comes bundled with tests
src = fetchFromGitHub {
owner = "sassoftware";
repo = "python-keyutils";
rev = "v${version}";
sha256 = "1gga60w8sb3r5bxa0bfp7d7wzg6s3db5y7aizr14p2pvp92d8bdi";
};
checkInputs = [ keyutils pytestrunner ];
doCheck = false;
buildInputs = [ keyutils ];
checkInputs = [ pytest pytestrunner ];
meta = {
description = "A set of python bindings for keyutils";

View File

@@ -2,13 +2,13 @@
python.pkgs.buildPythonPackage rec {
pname = "klaus";
version = "1.2.2";
version = "1.3.0";
src = fetchFromGitHub {
owner = "jonashaag";
repo = pname;
rev = version;
sha256 = "0hkl1ycyd5ccijmknr3yfp3ga43y01m7390xnibqqgaisfvcm9wp";
sha256 = "04zjvrpx66x2c0v74nvmq8x7s7c8994cv1zwd5hfn9alq82hqcgr";
};
prePatch = ''
@@ -35,6 +35,6 @@ python.pkgs.buildPythonPackage rec {
description = "The first Git web viewer that Just Works";
homepage = https://github.com/jonashaag/klaus;
license = licenses.isc;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ pSub ];
};
}

View File

@@ -0,0 +1,25 @@
{ lib, buildPythonPackage, fetchPypi, pytest, case, pytz, amqp }:
buildPythonPackage rec {
pname = "kombu";
version = "4.2.1";
src = fetchPypi {
inherit pname version;
sha256 = "86adec6c60f63124e2082ea8481bbe4ebe04fde8ebed32c177c7f0cd2c1c9082";
};
postPatch = ''
substituteInPlace requirements/test.txt --replace "pytest-sugar" ""
'';
checkInputs = [ pytest case pytz ];
propagatedBuildInputs = [ amqp ];
meta = with lib; {
description = "Messaging library for Python";
homepage = https://github.com/celery/kombu;
license = licenses.bsd3;
};
}

View File

@@ -2,12 +2,12 @@
buildPythonPackage rec {
pname = "libvirt";
version = "4.4.0";
version = "4.5.0";
src = assert version == libvirt.version; fetchgit {
url = git://libvirt.org/libvirt-python.git;
rev = "v${version}";
sha256 = "01kwwwacbq7kbsslb2ac3wwfs4r8nsv7jhn0df2mmff30izbhq34";
sha256 = "0w2rzkxv7jsq4670m0j5c6p4hpyi0r0ja6wd3wdvixcwc6hhx407";
};
nativeBuildInputs = [ pkgconfig ];

View File

@@ -2,26 +2,22 @@
, buildPythonPackage
, fetchPypi
, requests
, tox, pytest, flake8, responses
, pytest, pytestrunner, responses
}:
buildPythonPackage rec {
pname = "matrix-client";
version = "0.2.0";
pname = "matrix_client";
version = "0.3.2";
src = fetchPypi {
inherit pname version;
sha256 = "b96e87adf1bc2270166b2a4cff1320d2ef283779ea8b3c4edd0d9051fc7b7924";
sha256 = "1mgjd0ymf9mvqjkvgx3xjhxap7rzdmpa21wfy0cxbw2xcswcrqyw";
};
checkInputs = [ tox pytest flake8 responses ];
checkInputs = [ pytest pytestrunner responses ];
propagatedBuildInputs = [ requests ];
checkPhase = ''
pytest
'';
meta = with stdenv.lib; {
description = "Matrix Client-Server SDK";
homepage = https://github.com/matrix-org/matrix-python-sdk;

View File

@@ -0,0 +1,33 @@
{ stdenv, buildPythonPackage, fetchFromGitHub, pdfminer, chardet, pytest }:
buildPythonPackage rec {
pname = "pdfx";
version = "1.3.1";
src = fetchFromGitHub {
owner = "metachris";
repo = "pdfx";
rev = "v${version}";
sha256 = "1183k4h5qdf8y0imbir9ja3yzzsvdmqgbv3bi6dnkgr1wy2xfr0v";
};
# Remove after https://github.com/metachris/pdfx/pull/28
prePatch = ''
sed -i -e "s|pdfminer2|pdfminer.six|" setup.py
'';
propagatedBuildInputs = [ pdfminer chardet ];
checkInputs = [ pytest ];
checkPhase = ''
py.test
'';
meta = with stdenv.lib; {
inherit (src.meta) homepage;
description = "Extract references (pdf, url, doi, arxiv) and metadata from a PDF";
license = licenses.asl20;
maintainers = with maintainers; [ marsam ];
};
}

View File

@@ -0,0 +1,26 @@
{ lib
, buildPythonPackage
, fetchPypi
, libcap
}:
buildPythonPackage rec {
pname = "python-prctl";
version = "1.7";
src = fetchPypi {
inherit pname version;
sha256 = "1njgixnavmwq45r3gpkhn1y760sax204clagg4gzwvvdc5bdbssp";
};
patches = [ ./skip_bad_tests.patch ];
buildInputs = [ libcap ];
meta = {
description = "Python(ic) interface to the linux prctl syscall";
homepage = https://github.com/seveas/python-prctl;
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ catern ];
};
}

View File

@@ -0,0 +1,34 @@
--- ./test_prctl.py 2018-01-26 16:02:52.000000000 -0500
+++ ./test_prctl.py 2018-06-21 18:26:43.370065009 -0400
@@ -154,6 +154,7 @@
prctl.set_keepcaps(False)
self.assertEqual(prctl.get_keepcaps(), False)
+ @unittest.skip("No access to /proc in the Nix build sandbox")
@require('set_mce_kill')
def test_mce_kill(self):
"""Test the MCE_KILL setting"""
@@ -173,6 +174,7 @@
prctl.set_name(name)
self.assertEqual(prctl.get_name(), name[:15])
+ @unittest.skip("The Nix build sandbox has no_new_privs already enabled")
@require('get_no_new_privs')
def test_no_new_privs(self):
"""Test the no_new_privs function"""
@@ -189,6 +191,7 @@
self.assertNotEqual(sp.returncode, 0)
os._exit(0)
+ @unittest.skip("No access to /proc in the Nix build sandbox")
def test_proctitle(self):
"""Test setting the process title, including too long titles"""
title = "This is a test!"
@@ -225,6 +228,7 @@
os._exit(0)
self.assertRaises(OSError, prctl.set_ptracer, new_pid)
+ @unittest.skip("The Nix build sandbox has seccomp already enabled")
@require('get_seccomp')
def test_seccomp(self):
"""Test manipulation of the seccomp setting"""

View File

@@ -14,6 +14,10 @@ buildPythonPackage rec {
sha256 = "5ca0ad32ee04abe0d4ba02c8d89d501b4e5e0304bdf4d45c2e9875a735b323a0";
};
# basically https://github.com/scikit-learn/scikit-learn/pull/10723,
# but rebased onto 0.19.1
patches = [ ./n_iter-should-be-less-than-max_iter-using-lbgfs.patch ];
buildInputs = [ nose pillow gfortran glibcLocales ];
propagatedBuildInputs = [ numpy scipy numpy.blas ];

View File

@@ -0,0 +1,73 @@
diff --git a/sklearn/linear_model/huber.py b/sklearn/linear_model/huber.py
index e17dc1e..665654d 100644
--- a/sklearn/linear_model/huber.py
+++ b/sklearn/linear_model/huber.py
@@ -181,7 +181,11 @@ class HuberRegressor(LinearModel, RegressorMixin, BaseEstimator):
n_iter_ : int
Number of iterations that fmin_l_bfgs_b has run for.
- Not available if SciPy version is 0.9 and below.
+
+ .. versionchanged:: 0.20
+
+ In SciPy <= 1.0.0 the number of lbfgs iterations may exceed
+ ``max_iter``. ``n_iter_`` will now report at most ``max_iter``.
outliers_ : array, shape (n_samples,)
A boolean mask which is set to True where the samples are identified
@@ -272,7 +276,9 @@ class HuberRegressor(LinearModel, RegressorMixin, BaseEstimator):
raise ValueError("HuberRegressor convergence failed:"
" l-BFGS-b solver terminated with %s"
% dict_['task'].decode('ascii'))
- self.n_iter_ = dict_.get('nit', None)
+ # In scipy <= 1.0.0, nit may exceed maxiter.
+ # See https://github.com/scipy/scipy/issues/7854.
+ self.n_iter_ = min(dict_.get('nit', None), self.max_iter)
self.scale_ = parameters[-1]
if self.fit_intercept:
self.intercept_ = parameters[-2]
diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py
index 8646c9a..c72a7d9 100644
--- a/sklearn/linear_model/logistic.py
+++ b/sklearn/linear_model/logistic.py
@@ -718,7 +718,9 @@ def logistic_regression_path(X, y, pos_class=None, Cs=10, fit_intercept=True,
warnings.warn("lbfgs failed to converge. Increase the number "
"of iterations.")
try:
- n_iter_i = info['nit'] - 1
+ # In scipy <= 1.0.0, nit may exceed maxiter.
+ # See https://github.com/scipy/scipy/issues/7854.
+ n_iter_i = min(info['nit'], max_iter)
except:
n_iter_i = info['funcalls'] - 1
elif solver == 'newton-cg':
@@ -1115,6 +1117,11 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin,
it returns only 1 element. For liblinear solver, only the maximum
number of iteration across all classes is given.
+ .. versionchanged:: 0.20
+
+ In SciPy <= 1.0.0 the number of lbfgs iterations may exceed
+ ``max_iter``. ``n_iter_`` will now report at most ``max_iter``.
+
See also
--------
SGDClassifier : incrementally trained logistic regression (when given
diff --git a/sklearn/linear_model/tests/test_huber.py b/sklearn/linear_model/tests/test_huber.py
index 08f4fdf..ca1092f 100644
--- a/sklearn/linear_model/tests/test_huber.py
+++ b/sklearn/linear_model/tests/test_huber.py
@@ -42,6 +42,13 @@ def test_huber_equals_lr_for_high_epsilon():
assert_almost_equal(huber.intercept_, lr.intercept_, 2)
+def test_huber_max_iter():
+ X, y = make_regression_with_outliers()
+ huber = HuberRegressor(max_iter=1)
+ huber.fit(X, y)
+ assert huber.n_iter_ == huber.max_iter
+
+
def test_huber_gradient():
# Test that the gradient calculated by _huber_loss_and_gradient is correct
rng = np.random.RandomState(1)

View File

@@ -4,15 +4,16 @@
, cffi
, numpy
, portaudio
, substituteAll
}:
buildPythonPackage rec {
pname = "sounddevice";
version = "0.3.9";
version = "0.3.11";
src = fetchPypi {
inherit pname version;
sha256 = "1c9e833f8c8ccc67c0291c3448b29e9acc548fe56d15ee6f7fdd7037e00319f8";
sha256 = "0pfcbgbl77nggchxb2i5rb78m7hpgn65aqpz99yfx1fgfbmy9yg1";
};
propagatedBuildInputs = [ cffi numpy portaudio ];
@@ -20,9 +21,12 @@ buildPythonPackage rec {
# No tests included nor upstream available.
doCheck = false;
prePatch = ''
substituteInPlace src/sounddevice.py --replace "'portaudio'" "'${portaudio}/lib/libportaudio.so.2'"
'';
patches = [
(substituteAll {
src = ./fix-portaudio-library-path.patch;
portaudio = "${portaudio}/lib/libportaudio.so.2";
})
];
meta = {
description = "Play and Record Sound with Python";

View File

@@ -0,0 +1,34 @@
diff --git a/sounddevice.py b/sounddevice.py
index f03476c..5745b6e 100644
--- a/sounddevice.py
+++ b/sounddevice.py
@@ -58,28 +58,7 @@ from ctypes.util import find_library as _find_library
from _sounddevice import ffi as _ffi
-try:
- for _libname in (
- 'portaudio', # Default name on POSIX systems
- 'bin\\libportaudio-2.dll', # DLL from conda-forge
- ):
- _libname = _find_library(_libname)
- if _libname is not None:
- break
- else:
- raise OSError('PortAudio library not found')
- _lib = _ffi.dlopen(_libname)
-except OSError:
- if _platform.system() == 'Darwin':
- _libname = 'libportaudio.dylib'
- elif _platform.system() == 'Windows':
- _libname = 'libportaudio' + _platform.architecture()[0] + '.dll'
- else:
- raise
- import _sounddevice_data
- _libname = _os.path.join(
- next(iter(_sounddevice_data.__path__)), 'portaudio-binaries', _libname)
- _lib = _ffi.dlopen(_libname)
+_lib = _ffi.dlopen('@portaudio@')
_sampleformats = {
'float32': _lib.paFloat32,

View File

@@ -1,12 +1,12 @@
{ lib, buildPythonPackage, fetchPypi, isPyPy, python, dateutil }:
buildPythonPackage rec {
version = "0.9.5";
version = "0.9.6";
pname = "vobject";
src = fetchPypi {
inherit pname version;
sha256 = "0f56cae196303d875682b9648b4bb43ffc769d2f0f800958e0a506af867b1243";
sha256 = "cd9ede4363f83c06ba8d8f1541c736efa5c46f9a431430002b2f84f4f4e674d8";
};
disabled = isPyPy;