about summary refs log tree commit diff
path: root/pkgs/development/python-modules/usort/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/usort/default.nix')
-rw-r--r--pkgs/development/python-modules/usort/default.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/usort/default.nix b/pkgs/development/python-modules/usort/default.nix
new file mode 100644
index 0000000000000..2f61e8847ac66
--- /dev/null
+++ b/pkgs/development/python-modules/usort/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, attrs
+, buildPythonPackage
+, click
+, fetchFromGitHub
+, hatch-vcs
+, hatchling
+, libcst
+, moreorless
+, pythonOlder
+, stdlibs
+, toml
+, trailrunner
+, unittestCheckHook
+, volatile
+}:
+
+buildPythonPackage rec {
+  pname = "usort";
+  version = "1.1.0b2";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = "usort";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-c3gQ+f/BRgM+Nwc+mEP7dcmig7ws7FqL5zwQhNJJlsI=";
+  };
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  nativeBuildInputs = [
+    hatch-vcs
+    hatchling
+  ];
+
+  propagatedBuildInputs = [
+    attrs
+    click
+    libcst
+    moreorless
+    stdlibs
+    toml
+    trailrunner
+  ];
+
+  nativeCheckInputs = [
+    unittestCheckHook
+    volatile
+  ];
+
+  pythonImportsCheck = [
+    "usort"
+  ];
+
+  meta = with lib; {
+    description = "Safe, minimal import sorting for Python projects";
+    homepage = "https://github.com/facebook/usort";
+    changelog = "https://github.com/facebook/usort/blob/${version}/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}