Skip to content

Commit

Permalink
Merge pull request #332660 from fabaff/pygatt-bump
Browse files Browse the repository at this point in the history
python312Packages.pygatt: 4.0.5 -> 5.0.0, python312Packages.meshtastic: 2.3.11 -> 2.3.14
  • Loading branch information
fabaff authored Aug 7, 2024
2 parents 2de65f4 + 19594df commit 0c07957
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 29 deletions.
24 changes: 20 additions & 4 deletions pkgs/development/python-modules/meshtastic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
buildPythonPackage,
dotmap,
fetchFromGitHub,
hypothesis,
packaging,
parse,
pexpect,
platformdirs,
ppk2-api,
print-color,
protobuf,
pygatt,
pyarrow,
pyparsing,
pypubsub,
pyqrcode,
pyserial,
Expand All @@ -19,6 +25,7 @@
setuptools,
tabulate,
timeago,
webencodings,
}:

buildPythonPackage rec {
Expand All @@ -35,15 +42,22 @@ buildPythonPackage rec {
hash = "sha256-s56apVx7+EXkdw3FUjyGKGFjP+IVbO0/VDB4urXEtXQ=";
};

pythonRelaxDeps = [ "protobuf" ];

build-system = [ setuptools ];

dependencies = [
bleak
dotmap
packaging
parse
pexpect
platformdirs
ppk2-api
print-color
protobuf
pygatt
pyarrow
pyparsing
pypubsub
pyqrcode
pyserial
Expand All @@ -52,16 +66,17 @@ buildPythonPackage rec {
setuptools
tabulate
timeago
webencodings
];

passthru.optional-dependencies = {
tunnel = [ pytap2 ];
};

nativeCheckInputs = [
pytap2
hypothesis
pytestCheckHook
];
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

preCheck = ''
export PATH="$PATH:$out/bin";
Expand All @@ -79,6 +94,7 @@ buildPythonPackage rec {
"test_main_support"
"test_MeshInterface"
"test_message_to_json_shows_all"
"test_node"
"test_SerialInterface_single_port"
"test_support_info"
"test_TCPInterface"
Expand Down
19 changes: 8 additions & 11 deletions pkgs/development/python-modules/modbus-tk/default.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
fetchPypi,
setuptools,
pythonOlder,
pyserial,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "modbus-tk";
version = "1.1.1";
version = "1.1.3";
pyproject = true;

disabled = pythonOlder "3.10";

src = fetchFromGitHub {
owner = "ljean";
repo = "modbus-tk";
rev = "refs/tags/${version}";
hash = "sha256-zikfVMFdlOJvuKVQGEsK03i58X6BGFsGWGrGOJZGC0g=";
src = fetchPypi {
pname = "modbus_tk";
inherit version;
hash = "sha256-aQ+nu4bql4mSRl0tYci1rMY5zg6LgzoKqW1N0XLFZEo=";
};

build-system = [ setuptools ];

dependencies = [ pyserial ];

nativeCheckInputs = [ pytestCheckHook ];
# Source no tagged anymore and PyPI doesn't ship tests
doCheck = false;

pythonImportsCheck = [ "modbus_tk" ];

pytestFlagsArray = [ "tests/unittest_*.py" ];

meta = with lib; {
description = "Module for simple Modbus interactions";
homepage = "https://github.com/ljean/modbus-tk";
Expand Down
20 changes: 6 additions & 14 deletions pkgs/development/python-modules/pygatt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
buildPythonPackage,
fetchFromGitHub,
mock,
nose,
pexpect,
pyserial,
pytestCheckHook,
Expand All @@ -13,40 +12,33 @@

buildPythonPackage rec {
pname = "pygatt";
version = "4.0.5";
version = "5.0.0";
pyproject = true;

disabled = pythonOlder "3.5";
disabled = pythonOlder "3.10";

src = fetchFromGitHub {
owner = "peplin";
repo = "pygatt";
rev = "refs/tags/v${version}";
hash = "sha256-DUZGsztZViVNZwmhXoRN5FOQ7BgUeI0SsYgCHlvsrv0=";
hash = "sha256-TMIqC+JvNOLU38a9jkacRAbdmAAd4UekFUDRoAWhHFo=";
};

postPatch = ''
# Not support for Python < 3.4
substituteInPlace setup.py \
--replace-fail "'enum-compat'" "" \
--replace-fail "'coverage >= 3.7.1'," "" \
--replace-fail "'nose >= 1.3.7'" ""
substituteInPlace tests/bgapi/test_bgapi.py \
--replace-fail "assertEquals" "assertEqual"
--replace-fail "setup_requires" "test_requires"
'';

pythonRemoveDeps = [ "enum-compat" ];

build-system = [ setuptools ];

dependencies = [ pyserial ];

optional-dependencies.GATTTOOL = [ pexpect ];

# tests require nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
mock
nose
pytestCheckHook
] ++ optional-dependencies.GATTTOOL;

Expand Down
50 changes: 50 additions & 0 deletions pkgs/development/python-modules/riden/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
lib,
buildPythonPackage,
click,
fetchFromGitHub,
modbus-tk,
poetry-core,
pyserial,
pythonOlder,
setuptools,
}:

buildPythonPackage rec {
pname = "riden";
version = "1.2.1";
pyproject = true;

disabled = pythonOlder "3.7";

src = fetchFromGitHub {
owner = "geeksville";
repo = "riden";
rev = "refs/tags/${version}";
hash = "sha256-uR1CsVsGn/QC4krHaxl6GqRnTPbFdRaqyMEl2RVMHPU=";
};

build-system = [
poetry-core
setuptools
];

dependencies = [
click
modbus-tk
pyserial
];

# Module has no tests
doCheck = false;

pythonImportsCheck = [ "riden" ];

meta = with lib; {
description = "Module for Riden RD power supplies";
homepage = "https://github.com/geeksville/riden";
changelog = "https://github.com/geeksville/Riden/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13684,6 +13684,8 @@ self: super: with self; {

rich-theme-manager = callPackage ../development/python-modules/rich-theme-manager { };

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

ring-doorbell = callPackage ../development/python-modules/ring-doorbell { };

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

0 comments on commit 0c07957

Please sign in to comment.