<commit_before>{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
, acme, aiohttp, snitun, attrs, pycognito, warrant
, pytest-aiohttp, asynctest, pytest  }:

buildPythonPackage rec {
  pname = "hass-nabucasa";
  version = "0.32.2";

  src = fetchFromGitHub {
    owner = "nabucasa";
    repo = pname;
    rev = version;
    sha256 = "1hfi5q222kgbgrj5yvr4lbhca49hcs6sc2yhxc4pjxqsc12bv1f1";
  };

  # upstreamed in https://github.com/NabuCasa/hass-nabucasa/pull/119
  postPatch = ''
    sed -i 's/"acme.*/"acme>=0.40.0,<2.0"/' setup.py
    cat setup.py
  '';

  propagatedBuildInputs = [ acme aiohttp snitun attrs warrant pycognito ];

  checkInputs = [ pytest pytest-aiohttp asynctest ];

  checkPhase = ''
    pytest tests/
  '';

  meta = with lib; {
    homepage = "https://github.com/NabuCasa/hass-nabucasa";
    description = "Home Assistant cloud integration by Nabu Casa, inc.";
    license = licenses.gpl3;
    maintainers = with maintainers; [ Scriptkiddi ];
  };
}
<commit_msg>python3.pkgs.hass-nabucasa: fix build<commit_after>{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
, acme, aiohttp, snitun, attrs, pycognito, warrant
, pytest-aiohttp, asynctest, atomicwrites, pytest, pythonOlder }:

buildPythonPackage rec {
  pname = "hass-nabucasa";
  version = "0.34.6";

  src = fetchFromGitHub {
    owner = "nabucasa";
    repo = pname;
    rev = version;
    sha256 = "1lkqwj58qr0vn7zf5mhrhaz973ahj9wjp4mgzvyja1gcdh6amv34";
  };

  postPatch = ''
    sed -i 's/"acme.*"/"acme"/' setup.py
  '';

  patches = [
    # relax pytz dependency
    (fetchpatch {
      url = "https://github.com/NabuCasa/hass-nabucasa/commit/419e80feddc36c68384c032feda0057515b53eaa.patch";
      sha256 = "14dgwci8615cwcf27hg7b42s7da50xhyjys3yx446q7ipk8zw4x6";
    })
  ];

  propagatedBuildInputs = [
    acme aiohttp atomicwrites snitun attrs warrant pycognito
  ];

  checkInputs = [ pytest pytest-aiohttp asynctest ];

  # Asynctest's mocking is broken with python3.8
  # https://github.com/Martiusweb/asynctest/issues/132
  doCheck = pythonOlder "3.8";

  checkPhase = ''
    pytest tests/
  '';

  meta = with lib; {
    homepage = "https://github.com/NabuCasa/hass-nabucasa";
    description = "Home Assistant cloud integration by Nabu Casa, inc.";
    license = licenses.gpl3;
    maintainers = with maintainers; [ Scriptkiddi ];
  };
}

{'fraction_non_alphanumeric': 0.1251067463706234, 'fraction_numerical': 0.04824935952177626, 'mean_word_length': 3.5583657587548636, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '824912', 'n_tokens_mistral': 990, 'n_tokens_neox': 944, 'n_words': 167}