From 13a2d8faca0704758a35230fc0412001ba5edc85 Mon Sep 17 00:00:00 2001 From: inexcode Date: Tue, 9 May 2023 11:54:47 +0300 Subject: [PATCH 1/2] chore: Update dev nix shell --- shell.nix | 48 +++----------------- strawberry-graphql.patch | 96 ---------------------------------------- 2 files changed, 5 insertions(+), 139 deletions(-) delete mode 100644 strawberry-graphql.patch diff --git a/shell.nix b/shell.nix index 5f19502..d7f08b4 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,6 @@ -{ pkgs ? import { } }: +{ pkgs ? import { } }: let - sp-python = pkgs.python39.withPackages (p: with p; [ + sp-python = pkgs.python310.withPackages (p: with p; [ setuptools portalocker pytz @@ -19,45 +19,7 @@ let fastapi uvicorn redis - (buildPythonPackage rec { - pname = "strawberry-graphql"; - version = "0.123.0"; - format = "pyproject"; - patches = [ - ./strawberry-graphql.patch - ]; - propagatedBuildInputs = [ - typing-extensions - python-multipart - python-dateutil - # flask - pydantic - pygments - poetry - # flask-cors - (buildPythonPackage rec { - pname = "graphql-core"; - version = "3.2.0"; - format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-huKgvgCL/eGe94OI3opyWh2UKpGQykMcJKYIN5c4A84="; - }; - checkInputs = [ - pytest-asyncio - pytest-benchmark - pytestCheckHook - ]; - pythonImportsCheck = [ - "graphql" - ]; - }) - ]; - src = fetchPypi { - inherit pname version; - sha256 = "KsmZ5Xv8tUg6yBxieAEtvoKoRG60VS+iVGV0X6oCExo="; - }; - }) + strawberry-graphql ]); in pkgs.mkShell { @@ -65,6 +27,7 @@ pkgs.mkShell { sp-python pkgs.black pkgs.redis + pkgs.restic ]; shellHook = '' PYTHONPATH=${sp-python}/${sp-python.sitePackages} @@ -72,8 +35,7 @@ pkgs.mkShell { # for example. printenv will not fetch the value of an attribute. export USE_REDIS_PORT=6379 pkill redis-server - sleep 2 - setsid redis-server --bind 127.0.0.1 --port $USE_REDIS_PORT >/dev/null 2>/dev/null & + redis-server --bind 127.0.0.1 --port $USE_REDIS_PORT >/dev/null & # maybe set more env-vars ''; } diff --git a/strawberry-graphql.patch b/strawberry-graphql.patch deleted file mode 100644 index a731522..0000000 --- a/strawberry-graphql.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff --git a/pyproject.toml b/pyproject.toml -index 0cbf2ef..7736e92 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -51,7 +51,6 @@ python-multipart = "^0.0.5" - sanic = {version = ">=20.12.2,<22.0.0", optional = true} - aiohttp = {version = "^3.7.4.post0", optional = true} - fastapi = {version = ">=0.65.2", optional = true} --"backports.cached-property" = "^1.0.1" - - [tool.poetry.dev-dependencies] - pytest = "^7.1" -diff --git a/strawberry/directive.py b/strawberry/directive.py -index 491e390..26ba345 100644 ---- a/strawberry/directive.py -+++ b/strawberry/directive.py -@@ -1,10 +1,10 @@ - from __future__ import annotations - - import dataclasses -+from functools import cached_property - import inspect - from typing import Any, Callable, List, Optional, TypeVar - --from backports.cached_property import cached_property - from typing_extensions import Annotated - - from graphql import DirectiveLocation -diff --git a/strawberry/extensions/tracing/datadog.py b/strawberry/extensions/tracing/datadog.py -index 01fba20..7c06950 100644 ---- a/strawberry/extensions/tracing/datadog.py -+++ b/strawberry/extensions/tracing/datadog.py -@@ -1,8 +1,8 @@ - import hashlib -+from functools import cached_property - from inspect import isawaitable - from typing import Optional - --from backports.cached_property import cached_property - from ddtrace import tracer - - from strawberry.extensions import Extension -diff --git a/strawberry/field.py b/strawberry/field.py -index 80ed12a..f1bf2e9 100644 ---- a/strawberry/field.py -+++ b/strawberry/field.py -@@ -1,5 +1,6 @@ - import builtins - import dataclasses -+from functools import cached_property - import inspect - import sys - from typing import ( -@@ -18,7 +19,6 @@ from typing import ( - overload, - ) - --from backports.cached_property import cached_property - from typing_extensions import Literal - - from strawberry.annotation import StrawberryAnnotation -diff --git a/strawberry/types/fields/resolver.py b/strawberry/types/fields/resolver.py -index c5b3edd..f4112ce 100644 ---- a/strawberry/types/fields/resolver.py -+++ b/strawberry/types/fields/resolver.py -@@ -1,6 +1,7 @@ - from __future__ import annotations as _ - - import builtins -+from functools import cached_property - import inspect - import sys - import warnings -@@ -22,7 +23,6 @@ from typing import ( # type: ignore[attr-defined] - _eval_type, - ) - --from backports.cached_property import cached_property - from typing_extensions import Annotated, Protocol, get_args, get_origin - - from strawberry.annotation import StrawberryAnnotation -diff --git a/strawberry/types/info.py b/strawberry/types/info.py -index a172c04..475a3ee 100644 ---- a/strawberry/types/info.py -+++ b/strawberry/types/info.py -@@ -1,9 +1,8 @@ - import dataclasses -+from functools import cached_property - import warnings - from typing import TYPE_CHECKING, Any, Dict, Generic, List, Optional, TypeVar, Union - --from backports.cached_property import cached_property -- - from graphql import GraphQLResolveInfo, OperationDefinitionNode - from graphql.language import FieldNode - from graphql.pyutils.path import Path From 670911a92af20d89145a778ca38afb42b1b6f1da Mon Sep 17 00:00:00 2001 From: inexcode Date: Tue, 9 May 2023 11:58:30 +0300 Subject: [PATCH 2/2] feat(dns): Add deSec as a DNS provider --- selfprivacy_api/graphql/queries/providers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/selfprivacy_api/graphql/queries/providers.py b/selfprivacy_api/graphql/queries/providers.py index 5583c4e..1759d7b 100644 --- a/selfprivacy_api/graphql/queries/providers.py +++ b/selfprivacy_api/graphql/queries/providers.py @@ -7,6 +7,7 @@ import strawberry class DnsProvider(Enum): CLOUDFLARE = "CLOUDFLARE" DIGITALOCEAN = "DIGITALOCEAN" + DESEC = "DESEC" @strawberry.enum