diff --git a/pkgs/development/python-modules/pyuseragents/default.nix b/pkgs/development/python-modules/pyuseragents/default.nix new file mode 100644 index 000000000000..ffa3a5302ae5 --- /dev/null +++ b/pkgs/development/python-modules/pyuseragents/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pyuseragents"; + version = "1.0.5"; + + src = fetchFromGitHub { + owner = "Animenosekai"; + repo = "useragents"; + rev = "v${version}"; + sha256 = "D7Qs3vsfkRH2FDkbfakrR+FfWzQFiOCQM7q9AdJavyU="; + }; + + checkInputs = [ pytestCheckHook ]; + pytestFlagsArray = [ "test.py" ]; + pythonImportsCheck = [ "pyuseragents" ]; + + meta = with lib; { + description = "Giving you a random User-Agent Header"; + homepage = "https://github.com/Animenosekai/useragents"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ angustrau ]; + }; +} diff --git a/pkgs/development/python-modules/translatepy/default.nix b/pkgs/development/python-modules/translatepy/default.nix new file mode 100644 index 000000000000..8428f0b06e4c --- /dev/null +++ b/pkgs/development/python-modules/translatepy/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, requests +, beautifulsoup4 +, pyuseragents +, inquirer +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "translatepy"; + version = "2.0"; + + src = fetchFromGitHub { + owner = "Animenosekai"; + repo = "translate"; + rev = "v${version}"; + sha256 = "Rt6FvB4kZVaB/jxxqOHsnkReTFCCyiEaZf240n0zVZs="; + }; + + propagatedBuildInputs = [ + requests + beautifulsoup4 + pyuseragents + inquirer + ]; + + checkInputs = [ pytestCheckHook ]; + disabledTestPaths = [ + # Requires network connection + "tests/test_translators.py" + ]; + pythonImportsCheck = [ "translatepy" ]; + + meta = with lib; { + description = "A module grouping multiple translation APIs"; + homepage = "https://github.com/Animenosekai/translate"; + license = with licenses; [ agpl3Only ]; + maintainers = with maintainers; [ angustrau ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 008e74b0c3ca..079569e40f18 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9558,6 +9558,8 @@ with pkgs; translate-shell = callPackage ../applications/misc/translate-shell { }; + translatepy = with python3.pkgs; toPythonApplication translatepy; + trash-cli = callPackage ../tools/misc/trash-cli { }; trebleshot = libsForQt5.callPackage ../applications/networking/trebleshot { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5c5c71396ec0..abd21cf5c92d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7338,6 +7338,8 @@ in { inherit (pkgs) libusb1; }; + pyuseragents = callPackage ../development/python-modules/pyuseragents { }; + pyutilib = callPackage ../development/python-modules/pyutilib { }; pyuv = callPackage ../development/python-modules/pyuv { }; @@ -8848,6 +8850,8 @@ in { transitions = callPackage ../development/python-modules/transitions { }; + translatepy = callPackage ../development/python-modules/translatepy { }; + translationstring = callPackage ../development/python-modules/translationstring { }; transmission-rpc = callPackage ../development/python-modules/transmission-rpc { };