Merge pull request #212466 from fabaff/python-engineio-fix

python311Packages.python-engineio: add patch for mocking issue
This commit is contained in:
Fabian Affolter
2023-01-25 11:08:02 +01:00
committed by GitHub
3 changed files with 49 additions and 11 deletions
@@ -1,5 +1,6 @@
{ lib
, buildPythonPackage
, pythonAtLeast
, pythonOlder
, fetchFromGitHub
@@ -22,6 +23,7 @@ buildPythonPackage rec {
pname = "graphene-django";
version = "3.0.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
@@ -58,9 +60,18 @@ buildPythonPackage rec {
pytestCheckHook
];
disabledTests = lib.optionals (pythonAtLeast "3.11") [
# Pèython 3.11 support, https://github.com/graphql-python/graphene-django/pull/1365
"test_django_objecttype_convert_choices_enum_naming_collisions"
"test_django_objecttype_choices_custom_enum_name"
"test_django_objecttype_convert_choices_enum_list"
"test_schema_representation"
];
meta = with lib; {
description = "Integrate GraphQL into your Django project";
homepage = "https://github.com/graphql-python/graphene-django";
changelog = "https://github.com/graphql-python/graphene-django/releases/tag/v{version}";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
@@ -1,23 +1,37 @@
{ buildPythonPackage
{ lib
, buildPythonPackage
, fetchFromGitHub
, lib
, six
, pytestCheckHook
, fetchpatch
, mock
, pytest-asyncio
, pytestCheckHook
, pythonOlder
, six
}:
buildPythonPackage rec {
pname = "promise";
version = "2.3.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "syrusakbary";
repo = "promise";
rev = "v${version}";
sha256 = "17mq1bm78xfl0x1g50ng502m5ldq6421rzz35hlqafsj0cq8dkp6";
rev = "refs/tags/v${version}";
hash = "sha256-5s6GMANSO4UpLOP/HAQxuNFSBSjPgvJCB9R1dOoKuJ4=";
};
patches = [
# Convert @asyncio.coroutine to async def, https://github.com/syrusakbary/promise/pull/99
(fetchpatch {
name = "use-async-def.patch";
url = "https://github.com/syrusakbary/promise/commit/3cde549d30b38dcff81b308e18c7f61783003791.patch";
hash = "sha256-XCbTo6RCv75nNrpbK3TFdV0h7tBJ0QK+WOAR8S8w9as=";
})
];
postPatch = ''
substituteInPlace tests/test_extra.py \
--replace "assert_exc.traceback[-1].path.strpath" "str(assert_exc.traceback[-1].path)"
@@ -28,21 +42,24 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
pytestCheckHook
mock
pytest-asyncio
pytestCheckHook
];
disabledTestPaths = [
"tests/test_benchmark.py"
];
pythonImportsCheck = [
"promise"
];
meta = with lib; {
description = "Ultra-performant Promise implementation in Python";
homepage = "https://github.com/syrusakbary/promise";
changelog = "https://github.com/syrusakbary/promise/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [
kamadorueda
];
maintainers = with maintainers; [ kamadorueda ];
};
}
@@ -4,6 +4,7 @@
, buildPythonPackage
, eventlet
, fetchFromGitHub
, fetchpatch
, iana-etc
, libredirect
, mock
@@ -24,10 +25,19 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "miguelgrinberg";
repo = "python-engineio";
rev = "v${version}";
rev = "refs/tags/v${version}";
hash = "sha256-fymO9WqkYaRsHKCJHQJpySHqZor2t8BfVrfYUfYoJno=";
};
patches = [
# Address Python 3.11 mocking issue, https://github.com/miguelgrinberg/python-engineio/issues/279
(fetchpatch {
name = "mocking-issue-py311.patch";
url = "https://github.com/miguelgrinberg/python-engineio/commit/ac3911356fbe933afa7c11d56141f0e228c01528.patch";
hash = "sha256-LNMhjX8kqOI3y8XugCHxCPEC6lF83NROfIczXWiLuqY=";
})
];
nativeCheckInputs = [
aiohttp
eventlet