Merge remote-tracking branch 'upstream/master' into staging

This commit is contained in:
Matthew Bauer
2018-07-09 11:58:38 -04:00
441 changed files with 11813 additions and 9152 deletions

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

@@ -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,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

@@ -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

@@ -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,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

@@ -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,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

@@ -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;