2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, asgiref
|
|
|
|
, buildPythonPackage
|
|
|
|
, chalice
|
|
|
|
, channels
|
|
|
|
, click
|
|
|
|
, daphne
|
|
|
|
, django
|
|
|
|
, email-validator
|
|
|
|
, fastapi
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, flask
|
|
|
|
, freezegun
|
|
|
|
, graphql-core
|
|
|
|
, libcst
|
2023-07-15 17:15:38 +00:00
|
|
|
, opentelemetry-api
|
|
|
|
, opentelemetry-sdk
|
2023-05-24 13:37:59 +00:00
|
|
|
, poetry-core
|
|
|
|
, pydantic
|
|
|
|
, pygments
|
|
|
|
, pyinstrument
|
|
|
|
, pytest-aiohttp
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-django
|
|
|
|
, pytest-emoji
|
|
|
|
, pytest-flask
|
|
|
|
, pytest-mock
|
|
|
|
, pytest-snapshot
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dateutil
|
|
|
|
, python-multipart
|
|
|
|
, pythonOlder
|
|
|
|
, rich
|
|
|
|
, sanic
|
|
|
|
, sanic-testing
|
|
|
|
, starlette
|
|
|
|
, typing-extensions
|
|
|
|
, uvicorn
|
2022-08-21 13:32:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "strawberry-graphql";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.208.0";
|
2022-08-21 13:32:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "strawberry-graphql";
|
|
|
|
repo = "strawberry";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Gp58q1oZblbEQftEiq3il12eVIVF68jbGiqLdlolHvU=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2023-10-09 19:29:22 +00:00
|
|
|
# https://github.com/strawberry-graphql/strawberry/pull/2199
|
2022-12-02 08:20:57 +00:00
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch";
|
|
|
|
hash = "sha256-ekUZ2hDPCqwXp9n0YjBikwSkhCmVKUzQk7LrPECcD7Y=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2023-10-09 19:29:22 +00:00
|
|
|
--replace "--emoji --mypy-ini-file=mypy.ini" "" \
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
2022-12-02 08:20:57 +00:00
|
|
|
poetry-core
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-05-24 13:37:59 +00:00
|
|
|
graphql-core
|
|
|
|
python-dateutil
|
|
|
|
typing-extensions
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
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
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
opentelemetry = [
|
|
|
|
opentelemetry-api
|
|
|
|
opentelemetry-sdk
|
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
pydantic = [
|
|
|
|
pydantic
|
|
|
|
];
|
|
|
|
sanic = [
|
|
|
|
sanic
|
|
|
|
];
|
|
|
|
fastapi = [
|
|
|
|
fastapi
|
|
|
|
python-multipart
|
|
|
|
];
|
|
|
|
chalice = [
|
|
|
|
chalice
|
|
|
|
];
|
|
|
|
cli = [
|
|
|
|
click
|
|
|
|
pygments
|
|
|
|
rich
|
|
|
|
libcst
|
|
|
|
];
|
|
|
|
# starlite = [
|
|
|
|
# starlite
|
|
|
|
# ];
|
|
|
|
pyinstrument = [
|
|
|
|
pyinstrument
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
daphne
|
|
|
|
email-validator
|
|
|
|
freezegun
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-emoji
|
|
|
|
pytest-mock
|
|
|
|
pytest-snapshot
|
|
|
|
pytestCheckHook
|
|
|
|
sanic-testing
|
|
|
|
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"strawberry"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/benchmarks/"
|
|
|
|
"tests/cli/"
|
|
|
|
"tests/django/test_dataloaders.py"
|
|
|
|
"tests/exceptions/"
|
|
|
|
"tests/http/"
|
2023-07-15 17:15:38 +00:00
|
|
|
"tests/mypy/test_plugin.py" # avoid dependency on mypy
|
2023-05-24 13:37:59 +00:00
|
|
|
"tests/schema/extensions/"
|
|
|
|
"tests/schema/test_dataloaders.py"
|
|
|
|
"tests/schema/test_lazy/"
|
|
|
|
"tests/starlite/"
|
|
|
|
"tests/test_dataloaders.py"
|
|
|
|
"tests/utils/test_pretty_print.py"
|
2023-07-15 17:15:38 +00:00
|
|
|
"tests/websockets/test_graphql_transport_ws.py"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A GraphQL library for Python that leverages type annotations";
|
|
|
|
homepage = "https://strawberry.rocks";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ izorkin ];
|
|
|
|
};
|
|
|
|
}
|