diff --git a/pkgs/development/python-modules/pyupgrade/default.nix b/pkgs/development/python-modules/pyupgrade/default.nix new file mode 100644 index 000000000000..95aa57491ca8 --- /dev/null +++ b/pkgs/development/python-modules/pyupgrade/default.nix @@ -0,0 +1,31 @@ +{ buildPythonPackage +, fetchFromGitHub +, isPy27 +, lib +, pytestCheckHook +, tokenize-rt +}: + +buildPythonPackage rec { + pname = "pyupgrade"; + version = "2.10.0"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = "asottile"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-XYeqyyfwtS7dHLxeVvmcifW6UCOlnSMxqF1vxezBjT8="; + }; + + checkInputs = [ pytestCheckHook ]; + + propagatedBuildInputs = [ tokenize-rt ]; + + meta = with lib; { + description = "A tool to automatically upgrade syntax for newer versions of the language"; + homepage = "https://github.com/asottile/pyupgrade"; + license = licenses.mit; + maintainers = with maintainers; [ lovesegfault ]; + }; +} diff --git a/pkgs/development/python-modules/tokenize-rt/default.nix b/pkgs/development/python-modules/tokenize-rt/default.nix new file mode 100644 index 000000000000..7aee895c6cb6 --- /dev/null +++ b/pkgs/development/python-modules/tokenize-rt/default.nix @@ -0,0 +1,28 @@ +{ buildPythonPackage +, lib +, fetchFromGitHub +, isPy27 +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "tokenize-rt"; + version = "4.1.0"; + disabled = isPy27; + + src = fetchFromGitHub { + owner = "asottile"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-9qamHk2IZRmgGNFlYkSRks6mRVNlYfetpK/7rsfK9tc="; + }; + + checkInputs = [ pytestCheckHook ]; + + meta = with lib; { + description = "A wrapper around the stdlib `tokenize` which roundtrips"; + homepage = "https://github.com/asottile/tokenize-rt"; + license = licenses.mit; + maintainers = with maintainers; [ lovesegfault ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e91769b59904..6480a6525f5b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29432,6 +29432,8 @@ in pyload = callPackage ../applications/networking/pyload {}; + pyupgrade = with python3Packages; toPythonApplication pyupgrade; + pwntools = with python3Packages; toPythonApplication pwntools; uae = callPackage ../misc/emulators/uae { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 03de03171af1..cbf0d3b6674d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6646,6 +6646,8 @@ in { pyupdate = callPackage ../development/python-modules/pyupdate { }; + pyupgrade = callPackage ../development/python-modules/pyupgrade { }; + pyusb = callPackage ../development/python-modules/pyusb { libusb1 = pkgs.libusb1; }; pyutil = callPackage ../development/python-modules/pyutil { }; @@ -7982,6 +7984,8 @@ in { tokenizers = disabledIf (!isPy3k) (toPythonModule (callPackage ../development/python-modules/tokenizers { })); + tokenize-rt = disabledIf (!isPy3k) (toPythonModule (callPackage ../development/python-modules/tokenize-rt { })); + tokenlib = callPackage ../development/python-modules/tokenlib { }; tokenserver = callPackage ../development/python-modules/tokenserver { };