1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pdm-backend,
6 rich-toolkit,
7 typer,
8 uvicorn,
9
10 # checks
11 pytestCheckHook,
12 rich,
13}:
14
15let
16 self = buildPythonPackage rec {
17 pname = "fastapi-cli";
18 version = "0.0.8";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "tiangolo";
23 repo = "fastapi-cli";
24 tag = version;
25 hash = "sha256-7SYsIgRSFZgtIHBC5Ic9Nlh+LtGJDz0Xx1yxMarAuYY=";
26 };
27
28 build-system = [ pdm-backend ];
29
30 dependencies = [
31 rich-toolkit
32 typer
33 uvicorn
34 ]
35 ++ uvicorn.optional-dependencies.standard;
36
37 optional-dependencies = {
38 standard = [
39 uvicorn
40 ]
41 ++ uvicorn.optional-dependencies.standard;
42 };
43
44 doCheck = false;
45
46 passthru.tests.pytest = self.overridePythonAttrs { doCheck = true; };
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 rich
51 ]
52 ++ optional-dependencies.standard;
53
54 # coverage
55 disabledTests = [ "test_script" ];
56
57 pythonImportsCheck = [ "fastapi_cli" ];
58
59 meta = with lib; {
60 description = "Run and manage FastAPI apps from the command line with FastAPI CLI";
61 homepage = "https://github.com/tiangolo/fastapi-cli";
62 changelog = "https://github.com/tiangolo/fastapi-cli/releases/tag/${src.tag}";
63 mainProgram = "fastapi";
64 license = licenses.mit;
65 maintainers = [ ];
66 # This package provides a `fastapi`-executable that is in conflict with the one from
67 # python3Packages.fastapi. Because this package is primarily used for the purpose of
68 # implementing the CLI for python3Packages.fastapi, we reduce the executable's priority
69 priority = 10;
70 };
71 };
72in
73self