Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 click,
6 fetchFromGitHub,
7 hatch-vcs,
8 hatchling,
9 libcst,
10 moreorless,
11 stdlibs,
12 toml,
13 trailrunner,
14 unittestCheckHook,
15 volatile,
16}:
17
18buildPythonPackage (finalAttrs: {
19 pname = "usort";
20 version = "1.2.0";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "facebook";
25 repo = "usort";
26 tag = "v${finalAttrs.version}";
27 hash = "sha256-hoBk8KAml/YOscno9605I3t4z10vQPlh22wH1XHcQqY=";
28 };
29
30 build-system = [
31 hatch-vcs
32 hatchling
33 ];
34
35 dependencies = [
36 attrs
37 click
38 libcst
39 moreorless
40 stdlibs
41 toml
42 trailrunner
43 ];
44
45 nativeCheckInputs = [
46 unittestCheckHook
47 volatile
48 ];
49
50 pythonImportsCheck = [ "usort" ];
51
52 meta = {
53 description = "Safe, minimal import sorting for Python projects";
54 homepage = "https://github.com/facebook/usort";
55 changelog = "https://github.com/facebook/usort/blob/${finalAttrs.src.tag}/CHANGELOG.md";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ fab ];
58 mainProgram = "usort";
59 };
60})