Compare commits

...

16 Commits

Author SHA1 Message Date
Inex Code c6c151faec Register migration 2022-09-22 19:42:02 +03:00
Inex Code d454a943e9 API 2.0.9 2022-09-22 19:39:20 +03:00
Inex Code 4e5d16a99f API 2.0.8 2022-09-22 18:35:23 +03:00
Inex Code 2b4b015406 API 2.0.7 2022-09-19 03:50:59 +03:00
Inex Code 57ba561738 API 2.0.6 2022-09-19 03:05:23 +03:00
Inex Code 5650f3abf3 API 2.0.5 2022-09-19 02:57:36 +03:00
Inex Code c59ce2be35 API 2.0.4 2022-09-19 02:43:22 +03:00
Inex Code bef86b0271 API 2.0.3 2022-09-19 02:33:01 +03:00
Inex Code 0e553f8211 SelfPrivacy API 2.0.2 2022-09-09 17:52:04 +03:00
Inex Code bb10bf3539 SelfPrivacy API 2.0.1 2022-09-09 17:48:16 +03:00
inexcode c1ce8eab5d Fix permissions issue 2022-08-25 22:43:03 +04:00
inexcode 33910708dd SelfPrivacy API 2.0 2022-08-25 22:27:14 +04:00
Inex Code da20f28521 API 1.2.6 2022-05-26 18:45:07 +03:00
Inex Code 83b147a763 API 1.2.5 2022-05-12 18:56:45 +03:00
Inex Code f81b4ea832 API 1.2.4 2022-05-02 14:49:46 +03:00
Inex Code 7426512305 API 1.2.3 2022-05-02 11:03:11 +03:00
4 changed files with 192 additions and 4 deletions

View File

@ -1,7 +1,38 @@
let
pkgs = import <nixpkgs> {};
pkgs = import <nixpkgs> { };
in
self: super: rec {
selfprivacy-api = super.callPackage ./pkgs/selfprivacy-api {};
python39 = super.python39.override {
packageOverrides = python-self: python-super: {
strawberry_graphql = python-super.buildPythonPackage rec {
pname = "strawberry-graphql";
version = "0.123.0";
format = "pyproject";
patches = [
./strawberry-graphql.patch
];
propagatedBuildInputs = with self.python39Packages; [
typing-extensions
graphql-core
python-multipart
python-dateutil
flask
pydantic
pygments
poetry
];
src = python-super.fetchPypi {
inherit pname version;
sha256 = "sha256-KsmZ5Xv8tUg6yBxieAEtvoKoRG60VS+iVGV0X6oCExo=";
};
};
};
};
pythonPackages = python39.pkgs;
selfprivacy-api = super.callPackage ./pkgs/selfprivacy-api {};
selfprivacy-graphql-api = super.callPackage ./pkgs/selfprivacy-graphql-api {
nixpkgs = pkgs;
pythonPkgs = pythonPackages;
};
}

View File

@ -22,10 +22,10 @@ let
}:
buildPythonPackage rec {
pname = "selfprivacy-api";
version = "1.2.2";
version = "1.2.6";
src = builtins.fetchGit {
url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git";
rev = "6cd896f977bc6f450cea51dd23c740b2308ca70e";
rev = "401dff23fb9223e8a0a4bd3ee942c61e471a07ab";
};
propagatedBuildInputs = [
flask

View File

@ -0,0 +1,61 @@
{ nixpkgs ? import <nixpkgs> { }, pythonPkgs ? nixpkgs.pkgs.python39Packages }:
let
inherit (nixpkgs) pkgs;
inherit pythonPkgs;
selfprivacy-graphql-api =
{ buildPythonPackage
, fetchPypi
, setuptools
, portalocker
, pytz
, pytest
, pytest-mock
, pytest-datadir
, huey
, gevent
, mnemonic
, pydantic
, typing-extensions
, strawberry_graphql
, psutil
, fastapi
, uvicorn
}:
pythonPkgs.buildPythonApplication rec {
pname = "selfprivacy-graphql-api";
version = "2.0.9";
src = builtins.fetchGit {
url = "https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git";
rev = "0a09a338b850704f221bd9b451519290584ef209";
};
propagatedBuildInputs = [
setuptools
portalocker
pytz
pytest
pytest-mock
pytest-datadir
huey
gevent
mnemonic
pydantic
typing-extensions
strawberry_graphql
psutil
fastapi
uvicorn
];
meta = {
description = ''
SelfPrivacy Server Management API
'';
};
passthru = {
pythonPath = pythonPkgs.makePythonPath propagatedBuildInputs;
};
};
drv = pythonPkgs.callPackage selfprivacy-graphql-api { };
in
drv

96
strawberry-graphql.patch Normal file
View File

@ -0,0 +1,96 @@
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