2022-08-01 10:28:12 +00:00
|
|
|
{ pkgs ? import <nixpkgs> { } }:
|
2022-01-24 19:56:48 +00:00
|
|
|
let
|
|
|
|
sp-python = pkgs.python39.withPackages (p: with p; [
|
2022-06-24 17:25:49 +00:00
|
|
|
setuptools
|
|
|
|
portalocker
|
|
|
|
pytz
|
|
|
|
pytest
|
|
|
|
pytest-mock
|
|
|
|
pytest-datadir
|
|
|
|
huey
|
2022-01-24 19:56:48 +00:00
|
|
|
gevent
|
|
|
|
mnemonic
|
|
|
|
coverage
|
2022-01-27 12:13:00 +00:00
|
|
|
pylint
|
2022-06-24 12:26:51 +00:00
|
|
|
pydantic
|
|
|
|
typing-extensions
|
2022-07-25 14:08:31 +00:00
|
|
|
psutil
|
|
|
|
black
|
2022-08-25 17:03:56 +00:00
|
|
|
fastapi
|
|
|
|
uvicorn
|
2022-10-28 08:09:36 +00:00
|
|
|
redis
|
2022-06-24 12:26:51 +00:00
|
|
|
(buildPythonPackage rec {
|
|
|
|
pname = "strawberry-graphql";
|
2022-08-01 10:28:12 +00:00
|
|
|
version = "0.123.0";
|
2022-06-24 12:26:51 +00:00
|
|
|
format = "pyproject";
|
|
|
|
patches = [
|
|
|
|
./strawberry-graphql.patch
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
typing-extensions
|
|
|
|
python-multipart
|
|
|
|
python-dateutil
|
2022-08-25 17:03:56 +00:00
|
|
|
# flask
|
2022-06-24 12:26:51 +00:00
|
|
|
pydantic
|
|
|
|
pygments
|
|
|
|
poetry
|
2022-08-25 17:03:56 +00:00
|
|
|
# flask-cors
|
2022-08-01 10:28:12 +00:00
|
|
|
(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"
|
|
|
|
];
|
|
|
|
})
|
2022-06-24 12:26:51 +00:00
|
|
|
];
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-08-01 10:28:12 +00:00
|
|
|
sha256 = "KsmZ5Xv8tUg6yBxieAEtvoKoRG60VS+iVGV0X6oCExo=";
|
2022-06-24 12:26:51 +00:00
|
|
|
};
|
|
|
|
})
|
2022-01-24 19:56:48 +00:00
|
|
|
]);
|
|
|
|
in
|
|
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = [
|
|
|
|
sp-python
|
|
|
|
pkgs.black
|
2022-11-28 11:33:28 +00:00
|
|
|
pkgs.redis
|
2022-01-24 19:56:48 +00:00
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
PYTHONPATH=${sp-python}/${sp-python.sitePackages}
|
2022-11-28 11:33:28 +00:00
|
|
|
# envs set with export and as attributes are treated differently.
|
|
|
|
# for example. printenv <Name> will not fetch the value of an attribute.
|
|
|
|
export USE_REDIS_PORT=6379
|
2022-11-30 11:20:08 +00:00
|
|
|
pkill redis-server
|
|
|
|
redis-server --bind 127.0.0.1 --port $USE_REDIS_PORT >/dev/null &
|
2022-01-24 19:56:48 +00:00
|
|
|
# maybe set more env-vars
|
|
|
|
'';
|
2022-06-24 17:25:49 +00:00
|
|
|
}
|