Merge pull request #120704 from dotlambda/pylxd-fix

python3Packages.pylxd: fix build
This commit is contained in:
Robert Schütz 2021-04-27 15:24:49 +02:00 committed by GitHub
commit f21f86911c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 92 additions and 10 deletions

View file

@ -0,0 +1,56 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, attrs
, funcsigs
, requests-mock
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "mock-services";
version = "0.3.1";
src = fetchFromGitHub {
owner = "peopledoc";
repo = "mock-services";
rev = version;
sha256 = "1rqyyfwngi1xsd9a81irjxacinkj1zf6nqfvfxhi55ky34x5phf9";
};
patches = [
# Fix issues due to internal API breaking in latest versions of requests-mock
(fetchpatch {
url = "https://github.com/peopledoc/mock-services/commit/88d3a0c9ef4dd7d5e011068ed2fdbbecc4a1a03a.patch";
sha256 = "0a4pwxr33kr525sp8q4mb4cr3n2b51mj2a3052lhg6brdbi4gnms";
})
];
propagatedBuildInputs = [
attrs
funcsigs
requests-mock
];
checkInputs = [
pytestCheckHook
];
disabledTests = [
# require networking
"test_real_http_1"
"test_restart_http_mock"
"test_start_http_mock"
"test_stop_http_mock"
];
pythonImportsCheck = [ "mock_services" ];
meta = with lib; {
description = "Mock an entire service API based on requests-mock";
homepage = "https://github.com/peopledoc/mock-services";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -1,24 +1,48 @@
{ lib, buildPythonPackage, fetchPypi, pbr, dateutil, ws4py, requests-unixsocket, requests-toolbelt, mock }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, cryptography
, python-dateutil
, requests
, requests-toolbelt
, requests-unixsocket
, ws4py
, ddt
, mock-services
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pylxd";
version = "2.3.0";
src = fetchPypi {
inherit pname version;
sha256 = "1db88l55q974fm9z5gllx3i8bkj0jzi25xrr5cs6id3bfy4zp8a7";
src = fetchFromGitHub {
owner = "lxc";
repo = "pylxd";
rev = version;
sha256 = "144frnlsb21mglgyisms790hyrdfx1l91lcd7incch4m4a1cbpp6";
};
propagatedBuildInputs = [
pbr
dateutil
ws4py
requests-unixsocket
cryptography
python-dateutil
requests
requests-toolbelt
requests-unixsocket
ws4py
];
checkInputs = [
ddt
mock-services
pytestCheckHook
];
disabledTestPaths = [
"integration"
"migration"
];
# tests require an old version of requests-mock that we do not have a package for
doCheck = false;
pythonImportsCheck = [ "pylxd" ];
meta = with lib; {

View file

@ -4188,6 +4188,8 @@ in {
mock-open = callPackage ../development/python-modules/mock-open { };
mock-services = callPackage ../development/python-modules/mock-services { };
modeled = callPackage ../development/python-modules/modeled { };
moderngl = callPackage ../development/python-modules/moderngl { };