1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, poetry-core
8
9# propagates
10, quart
11, typing-extensions
12
13# tests
14, pytestCheckHook
15, pytest-asyncio
16}:
17
18buildPythonPackage rec {
19 pname = "quart-cors";
20 version = "0.7.0";
21 format = "pyproject";
22
23 src = fetchFromGitHub {
24 owner = "pgjones";
25 repo = "quart-cors";
26 rev = "refs/tags/${version}";
27 hash = "sha256-qUzs0CTZHf3fGADBXPkd3CjZ6dnz1t3cTxflMErvz/k=";
28 };
29
30 nativeBuildInputs = [
31 poetry-core
32 ];
33
34 postPatch = ''
35 substituteInPlace pyproject.toml \
36 --replace "--no-cov-on-fail " ""
37 '';
38
39 propagatedBuildInputs = [
40 quart
41 ] ++ lib.optionals (pythonOlder "3.10") [
42 typing-extensions
43 ];
44
45 pythonImportsCheck = [
46 "quart_cors"
47 ];
48
49 nativeCheckInputs = [
50 pytestCheckHook
51 pytest-asyncio
52 ];
53
54 meta = with lib; {
55 description = "Quart-CORS is an extension for Quart to enable and control Cross Origin Resource Sharing, CORS";
56 homepage = "https://github.com/pgjones/quart-cors/";
57 changelog = "https://github.com/pgjones/quart-cors/blob/${src.rev}/CHANGELOG.rst";
58 license = licenses.mit;
59 maintainers = with maintainers; [ hexa ];
60 };
61}