summary refs log tree commit diff
path: root/pkgs/development/python-modules/myfitnesspal/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/myfitnesspal/default.nix')
-rw-r--r--pkgs/development/python-modules/myfitnesspal/default.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/myfitnesspal/default.nix b/pkgs/development/python-modules/myfitnesspal/default.nix
new file mode 100644
index 00000000000..f6df7b88f85
--- /dev/null
+++ b/pkgs/development/python-modules/myfitnesspal/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, fetchPypi
+, buildPythonPackage
+, blessed
+, keyring
+, keyrings-alt
+, lxml
+, measurement
+, python-dateutil
+, requests
+, rich
+, pytestCheckHook
+, mock
+, nose
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "myfitnesspal";
+  version = "1.17.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-UXFvKQtC44EvscYWXK7KI/do3U0wTWI3zKwvsRdzKrs=";
+  };
+
+  propagatedBuildInputs = [
+    blessed
+    keyring
+    keyrings-alt
+    lxml
+    measurement
+    python-dateutil
+    requests
+    rich
+  ];
+
+  checkInputs = [
+    mock
+    nose
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # Remove overly restrictive version constraints
+    sed -i -e "s/>=.*//" requirements.txt
+  '';
+
+  disabledTests = [
+    # Integration tests require an account to be set
+    "test_integration"
+  ];
+
+  pythonImportsCheck = [
+    "myfitnesspal"
+  ];
+
+  meta = with lib; {
+    description = "Python module to access meal tracking data stored in MyFitnessPal";
+    homepage = "https://github.com/coddingtonbear/python-myfitnesspal";
+    license = licenses.mit;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}