Unverified Commit c50ec1f6 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #313647 from fabaff/automate-home-fix

python312Packages.automate-home: disable on Python 3.12
parents 86c6b7e9 cd24c5e0
Loading
Loading
Loading
Loading
+30 −27
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pythonOlder
, apscheduler
, hiredis
, aioredis
, ephem
, pytz
, pyyaml
{
  lib,
  aioredis,
  apscheduler,
  buildPythonPackage,
  ephem,
  fetchPypi,
  hiredis,
  pytestCheckHook,
  pythonAtLeast,
  pythonOlder,
  pytz,
  pyyaml,
  setuptools,
}:

buildPythonPackage rec {
  pname = "automate-home";
  version = "0.9.1";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.8";
  # Typing issue
  disabled = pythonOlder "3.8" || pythonAtLeast "3.12";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-41qd+KPSrOrczkovwXht3irbcYlYehBZ1HZ44yZe4cM=";
  };

  propagatedBuildInputs = [
  postPatch = ''
    # Rename pyephem, https://github.com/majamassarini/automate-home/pull/3
    substituteInPlace setup.py \
      --replace-fail "pyephem" "ephem" \
      --replace-fail "aioredis==1.3.1" "aioredis"
  '';

  build-system = [ setuptools ];

  dependencies = [
    apscheduler
    hiredis
    aioredis
@@ -32,24 +45,14 @@ buildPythonPackage rec {
    pyyaml
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];
  nativeCheckInputs = [ pytestCheckHook ];

  postPatch = ''
    # Rename pyephem, https://github.com/majamassarini/automate-home/pull/3
    substituteInPlace setup.py \
      --replace "pyephem" "ephem" \
      --replace "aioredis==1.3.1" "aioredis"
  '';

  pythonImportsCheck = [
    "home"
  ];
  pythonImportsCheck = [ "home" ];

  meta = with lib; {
    description = "Python module to automate (home) devices";
    homepage = "https://github.com/majamassarini/automate-home";
    changelog = "https://github.com/majamassarini/automate-home/releases/tag/${version}";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ fab ];
  };