nixpkgs/pkgs/development/python-modules/fastapi-cli/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

70 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pdm-backend,
typer,
fastapi,
uvicorn,
# checks
pytestCheckHook,
rich,
}:
let
self = buildPythonPackage rec {
pname = "fastapi-cli";
version = "0.0.5";
pyproject = true;
src = fetchFromGitHub {
owner = "tiangolo";
repo = "fastapi-cli";
rev = "refs/tags/${version}";
hash = "sha256-hUS9zkDJJB51X+e31RvyxcGAP8j4oulAPFAvEMPiIn8=";
};
build-system = [ pdm-backend ];
dependencies = [
typer
uvicorn
] ++ uvicorn.optional-dependencies.standard;
optional-dependencies = {
standard = [
uvicorn
] ++ uvicorn.optional-dependencies.standard;
};
doCheck = false;
passthru.tests.pytest = self.overridePythonAttrs { doCheck = true; };
nativeCheckInputs = [
pytestCheckHook
rich
] ++ optional-dependencies.standard;
# coverage
disabledTests = [ "test_script" ];
pythonImportsCheck = [ "fastapi_cli" ];
meta = with lib; {
description = "Run and manage FastAPI apps from the command line with FastAPI CLI";
homepage = "https://github.com/tiangolo/fastapi-cli";
changelog = "https://github.com/tiangolo/fastapi-cli/releases/tag/${version}";
mainProgram = "fastapi";
license = licenses.mit;
maintainers = [ ];
# This package provides a `fastapi`-executable that is in conflict with the one from
# python3Packages.fastapi. Because this package is primarily used for the purpose of
# implementing the CLI for python3Packages.fastapi, we reduce the executable's priority
priority = 10;
};
};
in
self