Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 cargo,
6 fetchFromGitHub,
7 libiconv,
8 rustc,
9 rustPlatform,
10}:
11
12buildPythonPackage rec {
13 pname = "ruff-api";
14 version = "0.2.1";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "amyreese";
19 repo = "ruff-api";
20 tag = "v${version}";
21 hash = "sha256-4ekNPgOOqRIVjIR8LNSALE7fByjMEn8y25y9Rdvf+ms=";
22 };
23
24 cargoDeps = rustPlatform.fetchCargoVendor {
25 inherit pname version src;
26 hash = "sha256-SqouHcEDehxNnNPdrkDUYx8AieHiPMs04RgrkdqYcpU=";
27 };
28
29 nativeBuildInputs = [
30 cargo
31 rustPlatform.cargoSetupHook
32 rustPlatform.maturinBuildHook
33 rustc
34 ];
35
36 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
37 libiconv
38 ];
39
40 # Tests have issues at the moment, check with next update
41 doCheck = false;
42
43 pythonImportsCheck = [ "ruff_api" ];
44
45 meta = {
46 description = "Experimental Python API for Ruff";
47 homepage = "https://github.com/amyreese/ruff-api";
48 changelog = "https://github.com/amyreese/ruff-api/blob/${src.rev}/CHANGELOG.md";
49 license = lib.licenses.mit;
50 maintainers = with lib.maintainers; [ fab ];
51 };
52}