1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, tokenize-rt
7}:
8
9buildPythonPackage rec {
10 pname = "pyupgrade";
11 version = "3.1.0";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "asottile";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-OzU3Qv6qdEw0hJdbQ7Q3T6zOGpUt2uZyfy1Fxm3GT0Q=";
21 };
22
23 propagatedBuildInputs = [
24 tokenize-rt
25 ];
26
27 checkInputs = [
28 pytestCheckHook
29 ];
30
31 pythonImportsCheck = [
32 "pyupgrade"
33 ];
34
35 meta = with lib; {
36 description = "Tool to automatically upgrade syntax for newer versions of the language";
37 homepage = "https://github.com/asottile/pyupgrade";
38 license = licenses.mit;
39 maintainers = with maintainers; [ lovesegfault ];
40 };
41}