From fb31567c10075a74f931c92d1a9de2e2dcebb1e4 Mon Sep 17 00:00:00 2001 From: shobu13 Date: Tue, 22 Oct 2024 10:38:21 +0000 Subject: [PATCH 1/5] strawberry-graphql: adding typer to CLI optional deps --- pkgs/development/python-modules/strawberry-graphql/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index 95fd2c9161b9..cb46289f48b0 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -129,6 +129,7 @@ buildPythonPackage rec { pygments rich libcst + typer ]; # starlite = [ starlite ]; # litestar = [ litestar ]; From 93a20f606a1ca3fd591710d53cffda716fd92dbb Mon Sep 17 00:00:00 2001 From: shobu13 Date: Tue, 22 Oct 2024 10:58:19 +0000 Subject: [PATCH 2/5] strawberry-graphql: updated cli optionnal deps removed: unused click dependencie added: new graphlib-backport dependencie --- pkgs/development/python-modules/strawberry-graphql/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index cb46289f48b0..d765d02504d4 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -125,11 +125,11 @@ buildPythonPackage rec { ]; chalice = [ chalice ]; cli = [ - click pygments rich libcst typer + graphlib-backport ]; # starlite = [ starlite ]; # litestar = [ litestar ]; From cee263c4fd18788f8cb088b1d9f6b5361a8b5e2e Mon Sep 17 00:00:00 2001 From: shobu13 Date: Tue, 22 Oct 2024 11:23:58 +0000 Subject: [PATCH 3/5] strawberry-graphql: added typer and graphlib-backport to build input, replaced click by typer in debug-server optional-dep --- .../python-modules/strawberry-graphql/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index d765d02504d4..2112951633d2 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -5,7 +5,6 @@ buildPythonPackage, chalice, channels, - click, daphne, django, email-validator, @@ -40,6 +39,8 @@ starlette, typing-extensions, uvicorn, + typer, + graphlib-backport }: buildPythonPackage rec { @@ -92,7 +93,7 @@ buildPythonPackage rec { libcst ]; debug-server = [ - click + typer libcst pygments python-multipart From 6de540601690e149388036e3c8e861d15871d65a Mon Sep 17 00:00:00 2001 From: Shobu Ser'Hao Date: Tue, 22 Oct 2024 13:52:12 +0200 Subject: [PATCH 4/5] strawberry-graphql: nixfmt --- .../strawberry-graphql/default.nix | 122 ++++-------------- 1 file changed, 23 insertions(+), 99 deletions(-) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index 2112951633d2..b58c4eb00bcd 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -1,46 +1,10 @@ -{ - lib, - aiohttp, - asgiref, - buildPythonPackage, - chalice, - channels, - daphne, - django, - email-validator, - fastapi, - fetchFromGitHub, - fetchpatch, - flask, - freezegun, - graphql-core, - inline-snapshot, - libcst, - opentelemetry-api, - opentelemetry-sdk, - 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, - typer, - graphlib-backport +{ lib, aiohttp, asgiref, buildPythonPackage, chalice, channels, daphne, django +, email-validator, fastapi, fetchFromGitHub, fetchpatch, flask, freezegun +, graphql-core, inline-snapshot, libcst, opentelemetry-api, opentelemetry-sdk +, 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, typer, graphlib-backport }: buildPythonPackage rec { @@ -61,7 +25,8 @@ buildPythonPackage rec { (fetchpatch { # https://github.com/strawberry-graphql/strawberry/pull/2199 name = "switch-to-poetry-core.patch"; - url = "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch"; + url = + "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch"; hash = "sha256-ekUZ2hDPCqwXp9n0YjBikwSkhCmVKUzQk7LrPECcD7Y="; }) ]; @@ -73,65 +38,23 @@ buildPythonPackage rec { build-system = [ poetry-core ]; - dependencies = [ - graphql-core - python-dateutil - typing-extensions - ]; + dependencies = [ graphql-core python-dateutil typing-extensions ]; optional-dependencies = { - aiohttp = [ - aiohttp - pytest-aiohttp - ]; - asgi = [ - starlette - python-multipart - ]; - debug = [ - rich - libcst - ]; - debug-server = [ - typer - libcst - pygments - python-multipart - rich - starlette - uvicorn - ]; - django = [ - django - pytest-django - asgiref - ]; - channels = [ - channels - asgiref - ]; - flask = [ - flask - pytest-flask - ]; - opentelemetry = [ - opentelemetry-api - opentelemetry-sdk - ]; + aiohttp = [ aiohttp pytest-aiohttp ]; + asgi = [ starlette python-multipart ]; + debug = [ rich libcst ]; + debug-server = + [ typer 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 - ]; + fastapi = [ fastapi python-multipart ]; chalice = [ chalice ]; - cli = [ - pygments - rich - libcst - typer - graphlib-backport - ]; + cli = [ pygments rich libcst typer graphlib-backport ]; # starlite = [ starlite ]; # litestar = [ litestar ]; pyinstrument = [ pyinstrument ]; @@ -173,7 +96,8 @@ buildPythonPackage rec { meta = with lib; { description = "GraphQL library for Python that leverages type annotations"; homepage = "https://strawberry.rocks"; - changelog = "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md"; + changelog = + "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ izorkin ]; mainProgram = "strawberry"; From 7fa2d5374ccbb17c78e9767d7965bebe83192e33 Mon Sep 17 00:00:00 2001 From: Shobu Ser'Hao Date: Tue, 22 Oct 2024 13:56:52 +0200 Subject: [PATCH 5/5] strawberry-graphql: nixfmt --- .../strawberry-graphql/default.nix | 122 ++++++++++++++---- 1 file changed, 99 insertions(+), 23 deletions(-) diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index b58c4eb00bcd..f104df7af0e9 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -1,10 +1,46 @@ -{ lib, aiohttp, asgiref, buildPythonPackage, chalice, channels, daphne, django -, email-validator, fastapi, fetchFromGitHub, fetchpatch, flask, freezegun -, graphql-core, inline-snapshot, libcst, opentelemetry-api, opentelemetry-sdk -, 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, typer, graphlib-backport +{ + lib, + aiohttp, + asgiref, + buildPythonPackage, + chalice, + channels, + daphne, + django, + email-validator, + fastapi, + fetchFromGitHub, + fetchpatch, + flask, + freezegun, + graphql-core, + inline-snapshot, + libcst, + opentelemetry-api, + opentelemetry-sdk, + 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, + typer, + graphlib-backport, }: buildPythonPackage rec { @@ -25,8 +61,7 @@ buildPythonPackage rec { (fetchpatch { # https://github.com/strawberry-graphql/strawberry/pull/2199 name = "switch-to-poetry-core.patch"; - url = - "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch"; + url = "https://github.com/strawberry-graphql/strawberry/commit/710bb96f47c244e78fc54c921802bcdb48f5f421.patch"; hash = "sha256-ekUZ2hDPCqwXp9n0YjBikwSkhCmVKUzQk7LrPECcD7Y="; }) ]; @@ -38,23 +73,65 @@ buildPythonPackage rec { build-system = [ poetry-core ]; - dependencies = [ graphql-core python-dateutil typing-extensions ]; + dependencies = [ + graphql-core + python-dateutil + typing-extensions + ]; optional-dependencies = { - aiohttp = [ aiohttp pytest-aiohttp ]; - asgi = [ starlette python-multipart ]; - debug = [ rich libcst ]; - debug-server = - [ typer libcst pygments python-multipart rich starlette uvicorn ]; - django = [ django pytest-django asgiref ]; - channels = [ channels asgiref ]; - flask = [ flask pytest-flask ]; - opentelemetry = [ opentelemetry-api opentelemetry-sdk ]; + aiohttp = [ + aiohttp + pytest-aiohttp + ]; + asgi = [ + starlette + python-multipart + ]; + debug = [ + rich + libcst + ]; + debug-server = [ + typer + 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 ]; + fastapi = [ + fastapi + python-multipart + ]; chalice = [ chalice ]; - cli = [ pygments rich libcst typer graphlib-backport ]; + cli = [ + pygments + rich + libcst + typer + graphlib-backport + ]; # starlite = [ starlite ]; # litestar = [ litestar ]; pyinstrument = [ pyinstrument ]; @@ -96,8 +173,7 @@ buildPythonPackage rec { meta = with lib; { description = "GraphQL library for Python that leverages type annotations"; homepage = "https://strawberry.rocks"; - changelog = - "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md"; + changelog = "https://github.com/strawberry-graphql/strawberry/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ izorkin ]; mainProgram = "strawberry";