Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.{pure-python-adb,adb-shell,androidtv}: init #98452

Merged
merged 4 commits into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions pkgs/development/python-modules/adb-shell/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{ aiofiles, buildPythonPackage, cryptography, fetchFromGitHub, isPy3k, lib
, libusb1, mock, pyasn1, python, pycryptodome, rsa }:

buildPythonPackage rec {
pname = "adb-shell";
version = "0.2.3";

disabled = !isPy3k;

JamieMagee marked this conversation as resolved.
Show resolved Hide resolved
# pypi does not contain tests, using github sources instead
src = fetchFromGitHub {
owner = "JeffLIrion";
repo = "adb_shell";
rev = "v${version}";
sha256 = "1ay598avmg656cxnc9phdx43z1plsrfjf9png9jwjwyhyjjiqxil";
};

propagatedBuildInputs = [ aiofiles cryptography libusb1 pyasn1 rsa ];

checkInputs = [ mock pycryptodome ];
checkPhase = ''
${python.interpreter} -m unittest discover -s tests -t .
'';

meta = with lib; {
description =
"A Python implementation of ADB with shell and FileSync functionality.";
homepage = "https://github.com/JeffLIrion/adb_shell";
license = licenses.asl20;
JamieMagee marked this conversation as resolved.
Show resolved Hide resolved
maintainers = with maintainers; [ jamiemagee ];
};
}
31 changes: 31 additions & 0 deletions pkgs/development/python-modules/androidtv/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ aiofiles, adb-shell, buildPythonPackage, fetchFromGitHub, isPy3k, lib, mock
, pure-python-adb, python }:

buildPythonPackage rec {
pname = "androidtv";
version = "0.0.50";

# pypi does not contain tests, using github sources instead
src = fetchFromGitHub {
owner = "JeffLIrion";
repo = "python-androidtv";
rev = "v${version}";
sha256 = "1iqw40szwgzvhv3fbnx2wwfnw0d3clcwk9vsq1xsn30fjil2vl7b";
};

propagatedBuildInputs = [ adb-shell pure-python-adb ]
++ lib.optionals (isPy3k) [ aiofiles ];

checkInputs = [ mock ];
checkPhase = ''
${python.interpreter} -m unittest discover -s tests -t .
'';

meta = with lib; {
description =
"Communicate with an Android TV or Fire TV device via ADB over a network.";
homepage = "https://github.com/JeffLIrion/python-androidtv/";
license = licenses.mit;
maintainers = with maintainers; [ jamiemagee ];
};
}
26 changes: 26 additions & 0 deletions pkgs/development/python-modules/pure-python-adb/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ aiofiles, buildPythonPackage, fetchPypi, lib, pythonOlder }:

buildPythonPackage rec {
pname = "pure-python-adb";
version = "0.3.0.dev0";

disabled = pythonOlder "3.6";

src = fetchPypi {
inherit pname version;
sha256 = "0kdr7w2fhgjpcf1k3l6an9im583iqkr6v8hb4q1zw30nh3bqkk0f";
};

propagatedBuildInputs = [ aiofiles ];
# Disable tests as they require docker, docker-compose and a dedicated
# android emulator
doCheck = false;
pythonImportsCheck = [ "ppadb.client" "ppadb.client_async" ];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, we're missing a pythonImportsCheck here.

Last gotcha.

meta = with lib; {
description = "Pure python implementation of the adb client";
homepage = "https://github.com/Swind/pure-python-adb";
license = licenses.mit;
maintainers = with maintainers; [ jamiemagee ];
};
}
2 changes: 1 addition & 1 deletion pkgs/servers/home-assistant/component-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"amcrest" = ps: with ps; [ ha-ffmpeg ]; # missing inputs: amcrest
"ampio" = ps: with ps; [ ]; # missing inputs: asmog
"android_ip_webcam" = ps: with ps; [ ]; # missing inputs: pydroid-ipcam
"androidtv" = ps: with ps; [ ]; # missing inputs: adb-shell[async] androidtv[async] pure-python-adb[async]
"androidtv" = ps: with ps; [ adb-shell androidtv pure-python-adb ];
"anel_pwrctrl" = ps: with ps; [ ]; # missing inputs: anel_pwrctrl-homeassistant
"anthemav" = ps: with ps; [ ]; # missing inputs: anthemav
"apache_kafka" = ps: with ps; [ aiokafka ];
Expand Down
6 changes: 6 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ in {

adb-homeassistant = callPackage ../development/python-modules/adb-homeassistant { };

adb-shell = callPackage ../development/python-modules/adb-shell { };

addic7ed-cli = callPackage ../development/python-modules/addic7ed-cli { };

adguardhome= callPackage ../development/python-modules/adguardhome { };
Expand Down Expand Up @@ -280,6 +282,8 @@ in {

amqplib = callPackage ../development/python-modules/amqplib { };

androidtv = callPackage ../development/python-modules/androidtv { };

androguard = callPackage ../development/python-modules/androguard { };

aniso8601 = callPackage ../development/python-modules/aniso8601 { };
Expand Down Expand Up @@ -4692,6 +4696,8 @@ in {

purepng = callPackage ../development/python-modules/purepng { };

pure-python-adb = callPackage ../development/python-modules/pure-python-adb { };

pure-python-adb-homeassistant = callPackage ../development/python-modules/pure-python-adb-homeassistant { };

purl = callPackage ../development/python-modules/purl { };
Expand Down