From dfb0349a78fc60be082db19aa885167d8f8e234b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 1 May 2023 23:44:58 +0200 Subject: [PATCH] python310Packages.strawberry-graphql: 0.159.0 -> 0.176.0 Changelog: https://github.com/strawberry-graphql/strawberry/blob/0.176.0/CHANGELOG.md --- .../strawberry-graphql/default.nix | 151 +++++++++++++++++- 1 file changed, 143 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index 9d25284b9c25..6f4dfd7689f7 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -1,20 +1,56 @@ -{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, poetry-core, pythonOlder -, click, backports-cached-property, graphql-core, pygments, python-dateutil, python-multipart, typing-extensions -, aiohttp, asgiref, chalice, django, fastapi, flask, pydantic, sanic, starlette, uvicorn +{ lib +, aiohttp +, asgiref +, backports-cached-property +, buildPythonPackage +, chalice +, channels +, click +, daphne +, django +, email-validator +, fastapi +, fetchFromGitHub +, fetchpatch +, flask +, freezegun +, graphql-core +, libcst +, mypy +, poetry-core +, pydantic +, pygments +, pyinstrument +, pytest-aiohttp +, pytest-asyncio +, pytest-django +, pytest-emoji +, pytest-flask +, pytest-snapshot +, pytestCheckHook +, python-dateutil +, python-multipart +, pythonOlder +, rich +, sanic +, sanic-testing +, starlette +, typing-extensions +, uvicorn }: buildPythonPackage rec { pname = "strawberry-graphql"; - version = "0.159.0"; + version = "0.176.0"; format = "pyproject"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "strawberry-graphql"; repo = "strawberry"; rev = "refs/tags/${version}"; - hash = "sha256-3fyls1W2Vx0nDtp7mta/8QeKM6RRsAbw3dWOnH1/jk0="; + hash = "sha256-e61wLFqc3HLCWUiVW3Gzbay1Oi8b7HsLT3+jPnbA4YY="; }; patches = [ @@ -25,22 +61,121 @@ buildPythonPackage rec { }) ]; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --emoji --mypy-ini-file=mypy.ini --benchmark-disable" "" \ + ''; + nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ - click backports-cached-property graphql-core pygments python-dateutil python-multipart typing-extensions - aiohttp asgiref chalice django fastapi flask pydantic sanic starlette uvicorn + graphql-core + python-dateutil + typing-extensions ]; + passthru.optional-dependencies = { + aiohttp = [ + aiohttp + pytest-aiohttp + ]; + asgi = [ + starlette + python-multipart + ]; + debug = [ + rich + libcst + ]; + debug-server = [ + click + libcst + pygments + python-multipart + rich + starlette + uvicorn + ]; + django = [ + django + pytest-django + asgiref + ]; + channels = [ + channels + asgiref + ]; + flask = [ + flask + pytest-flask + ]; + # opentelemetry = [ + # opentelemetry-api + # opentelemetry-sdk + # ]; + pydantic = [ + pydantic + ]; + sanic = [ + sanic + ]; + fastapi = [ + fastapi + python-multipart + ]; + chalice = [ + chalice + ]; + cli = [ + click + pygments + rich + libcst + ]; + # starlite = [ + # starlite + # ]; + pyinstrument = [ + pyinstrument + ]; + }; + + nativeCheckInputs = [ + daphne + email-validator + freezegun + mypy + pytest-asyncio + pytest-emoji + pytest-snapshot + pytestCheckHook + sanic-testing + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + pythonImportsCheck = [ "strawberry" ]; + disabledTestPaths = [ + "tests/benchmarks/" + "tests/cli/" + "tests/django/test_dataloaders.py" + "tests/exceptions/" + "tests/http/" + "tests/schema/extensions/" + "tests/schema/test_dataloaders.py" + "tests/schema/test_lazy/" + "tests/starlite/" + "tests/test_dataloaders.py" + "tests/utils/test_pretty_print.py" + ]; + meta = with lib; { description = "A GraphQL library for Python that leverages type annotations"; homepage = "https://strawberry.rocks"; + changelog = "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md"; license = with licenses; [ mit ]; maintainers = with maintainers; [ izorkin ]; };