forked from SelfPrivacy/selfprivacy-nix-repo
Force use nixpkgs 22.05
parent
2abf4b360f
commit
1fc90c36ef
141
default.nix
141
default.nix
|
@ -1,143 +1,16 @@
|
||||||
let
|
let
|
||||||
pkgs = import <nixpkgs> { };
|
hostPkgs = import <nixpkgs> {};
|
||||||
|
pkgs = hostPkgs.fetchFromGitHub {
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
ref = "nixos-22.05";
|
||||||
|
rev = "45c9736ed69800a6ff2164fb4538c9e40dad25d6";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
self: super: rec {
|
self: super: rec {
|
||||||
python39 = super.python39.override {
|
python39 = super.python39.override {
|
||||||
packageOverrides = python-self: python-super: {
|
packageOverrides = python-self: python-super: {
|
||||||
graphql-core = python-super.buildPythonPackage rec {
|
|
||||||
pname = "graphql-core";
|
|
||||||
version = "3.2.0";
|
|
||||||
format = "setuptools";
|
|
||||||
src = python-super.fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "sha256-huKgvgCL/eGe94OI3opyWh2UKpGQykMcJKYIN5c4A84=";
|
|
||||||
};
|
|
||||||
checkInputs = [
|
|
||||||
python-super.pytest-asyncio
|
|
||||||
python-super.pytest-benchmark
|
|
||||||
python-super.pytestCheckHook
|
|
||||||
];
|
|
||||||
pythonImportsCheck = [
|
|
||||||
"graphql"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
starlette = python-super.buildPythonPackage rec {
|
|
||||||
pname = "starlette";
|
|
||||||
version = "0.19.0";
|
|
||||||
format = "setuptools";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "encode";
|
|
||||||
repo = pname;
|
|
||||||
rev = version;
|
|
||||||
sha256 = "sha256-gjRTMzoQ8pqxjIusRwRXGs72VYo6xsp2DSUxmEr9KxU=";
|
|
||||||
};
|
|
||||||
postPatch = ''
|
|
||||||
# remove coverage arguments to pytest
|
|
||||||
sed -i '/--cov/d' setup.cfg
|
|
||||||
'';
|
|
||||||
|
|
||||||
propagatedBuildInputs = with self.python39Packages; [
|
|
||||||
aiofiles
|
|
||||||
anyio
|
|
||||||
itsdangerous
|
|
||||||
jinja2
|
|
||||||
python-multipart
|
|
||||||
pyyaml
|
|
||||||
requests
|
|
||||||
];
|
|
||||||
|
|
||||||
checkInputs = with self.python39Packages; [
|
|
||||||
aiosqlite
|
|
||||||
databases
|
|
||||||
pytestCheckHook
|
|
||||||
trio
|
|
||||||
typing-extensions
|
|
||||||
];
|
|
||||||
|
|
||||||
disabledTests = [
|
|
||||||
# asserts fail due to inclusion of br in Accept-Encoding
|
|
||||||
"test_websocket_headers"
|
|
||||||
"test_request_headers"
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = [
|
|
||||||
"starlette"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
fastapi = python-super.buildPythonPackage rec {
|
|
||||||
pname = "fastapi";
|
|
||||||
version = "0.75.2";
|
|
||||||
format = "flit";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "tiangolo";
|
|
||||||
repo = pname;
|
|
||||||
rev = version;
|
|
||||||
hash = "sha256-B4q3Q256Sj4jTQt1TDm3fiEaQKdVxddCF9+KsxkkTWo=";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = with self.python39Packages; [
|
|
||||||
starlette
|
|
||||||
pydantic
|
|
||||||
];
|
|
||||||
|
|
||||||
checkInputs = with self.python39Packages; [
|
|
||||||
aiosqlite
|
|
||||||
databases
|
|
||||||
flask
|
|
||||||
httpx
|
|
||||||
passlib
|
|
||||||
peewee
|
|
||||||
python-jose
|
|
||||||
pytestCheckHook
|
|
||||||
pytest-asyncio
|
|
||||||
sqlalchemy
|
|
||||||
trio
|
|
||||||
bcrypt
|
|
||||||
];
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
# Bump starlette, https://github.com/tiangolo/fastapi/pull/4483
|
|
||||||
(pkgs.fetchpatch {
|
|
||||||
name = "support-later-starlette.patch";
|
|
||||||
# PR contains multiple commits
|
|
||||||
url = "https://patch-diff.githubusercontent.com/raw/tiangolo/fastapi/pull/4483.patch";
|
|
||||||
sha256 = "sha256-ZWaqAd/QYEYRL1hSQdXdFPgWgdmOill2GtmEn33vz2U=";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace pyproject.toml \
|
|
||||||
--replace "starlette ==" "starlette >="
|
|
||||||
'';
|
|
||||||
|
|
||||||
pytestFlagsArray = [
|
|
||||||
# ignoring deprecation warnings to avoid test failure from
|
|
||||||
# tests/test_tutorial/test_testing/test_tutorial001.py
|
|
||||||
"-W ignore::DeprecationWarning"
|
|
||||||
];
|
|
||||||
|
|
||||||
disabledTestPaths = [
|
|
||||||
# Disabled tests require orjson which requires rust nightly
|
|
||||||
"tests/test_default_response_class.py"
|
|
||||||
# Don't test docs and examples
|
|
||||||
"docs_src"
|
|
||||||
];
|
|
||||||
|
|
||||||
disabledTests = [
|
|
||||||
"test_get_custom_response"
|
|
||||||
# Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
|
|
||||||
"test_websocket_invalid_data"
|
|
||||||
"test_websocket_no_credentials"
|
|
||||||
# TypeError: __init__() missing 1...starlette-releated
|
|
||||||
"test_head"
|
|
||||||
"test_options"
|
|
||||||
"test_trace"
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = [
|
|
||||||
"fastapi"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
strawberry_graphql = python-super.buildPythonPackage rec {
|
strawberry_graphql = python-super.buildPythonPackage rec {
|
||||||
pname = "strawberry-graphql";
|
pname = "strawberry-graphql";
|
||||||
version = "0.123.0";
|
version = "0.123.0";
|
||||||
|
|
Loading…
Reference in New Issue