Merge pull request #91087 from Mic92/python-fixes

This commit is contained in:
Jörg Thalheim 2020-06-19 11:36:25 +01:00 committed by GitHub
commit e5bdf9c27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 28 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, isPy27, pytz, requests, pytest }:
{ stdenv, buildPythonPackage, fetchPypi, isPy27, pytz, requests, pytest, freezegun }:
buildPythonPackage rec {
pname = "astral";
@ -10,7 +10,7 @@ buildPythonPackage rec {
sha256 = "e41d9967d5c48be421346552f0f4dedad43ff39a83574f5ff2ad32b6627b6fbe";
};
propagatedBuildInputs = [ pytz requests ];
propagatedBuildInputs = [ pytz requests freezegun ];
checkInputs = [ pytest ];
checkPhase = ''

View File

@ -17,6 +17,9 @@ buildPythonPackage rec {
--replace "test_events_watched_outside_test_are_ignored" "xtest_events_watched_outside_test_are_ignored"
'';
# https://github.com/Martiusweb/asynctest/issues/132
doCheck = pythonOlder "3.8";
checkPhase = ''
${python.interpreter} -m unittest test
'';

View File

@ -1,15 +1,14 @@
{ stdenv
, buildPythonPackage
, fetchPypi
, pythonAtLeast
, pythonOlder
, paver
, python
, isPyPy
, six
, pathlib
, python_magic
, lib
, filetype
, deprecation
, dataclasses
}:
buildPythonPackage rec {
@ -22,18 +21,13 @@ buildPythonPackage rec {
sha256 = "faf5806197f2093e82c2830d41f2378f07b3a9da07a16fafb14fc6fbdebac50a";
};
# https://github.com/nicfit/eyeD3/pull/284
postPatch = lib.optionalString (pythonAtLeast "3.4") ''
sed -ie '/pathlib/d' requirements/requirements.yml
'';
buildInputs = [ paver ];
# requires special test data:
# https://github.com/nicfit/eyeD3/blob/103198e265e3279384f35304e8218be6717c2976/Makefile#L97
doCheck = false;
propagatedBuildInputs = [ six python_magic ] ++ lib.optional (pythonOlder "3.4") pathlib;
propagatedBuildInputs = [
six filetype deprecation
] ++ lib.optional (pythonOlder "3.7") dataclasses;
postInstall = ''
for prog in "$out/bin/"*; do
@ -55,5 +49,4 @@ buildPythonPackage rec {
and v2.3/v2.4.
'';
};
}

View File

@ -1,28 +1,40 @@
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
, acme, aiohttp, snitun, attrs, pycognito, warrant
, pytest-aiohttp, asynctest, pytest }:
, pytest-aiohttp, asynctest, atomicwrites, pytest, pythonOlder }:
buildPythonPackage rec {
pname = "hass-nabucasa";
version = "0.32.2";
version = "0.34.6";
src = fetchFromGitHub {
owner = "nabucasa";
repo = pname;
rev = version;
sha256 = "1hfi5q222kgbgrj5yvr4lbhca49hcs6sc2yhxc4pjxqsc12bv1f1";
sha256 = "1lkqwj58qr0vn7zf5mhrhaz973ahj9wjp4mgzvyja1gcdh6amv34";
};
# 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
sed -i 's/"acme.*"/"acme"/' setup.py
'';
propagatedBuildInputs = [ acme aiohttp snitun attrs warrant pycognito ];
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/
'';

View File

@ -1,4 +1,4 @@
{ lib, buildPythonPackage, fetchPypi, pytest, pythonOlder }:
{ lib, buildPythonPackage, fetchPypi, pytestCheckHook, pythonOlder, pytest-asyncio }:
buildPythonPackage rec {
pname = "janus";
@ -11,7 +11,10 @@ buildPythonPackage rec {
disabled = pythonOlder "3.6";
checkInputs = [ pytest ];
checkInputs = [ pytest-asyncio pytestCheckHook ];
# also fails upstream: https://github.com/aio-libs/janus/pull/258
disabledTests = [ "test_format" ];
meta = with lib; {
description = "Mixed sync-async queue";

View File

@ -12,13 +12,13 @@
buildPythonPackage rec {
pname = "pycognito";
version = "0.1.2";
version = "0.1.3";
src = fetchFromGitHub {
owner = "pvizeli";
repo = "pycognito";
rev = version;
sha256 = "01zns522awm5yp5cbk1y7k7px534i5akiivip709i1naph3hvnfk";
sha256 = "0wy6d274xda7v6dazv10h2vwig2avfyz8mh2lpd1a5k7i06r335r";
};
postPatch = ''

View File

@ -13,13 +13,13 @@
buildPythonPackage rec {
pname = "python-engineio";
version = "3.10.0";
version = "3.13.0";
src = fetchFromGitHub {
owner = "miguelgrinberg";
repo = "python-engineio";
rev = "v${version}";
sha256 = "1495r55177c38wq88pb28l50dfd4213iyxwq1k5rmsgp66vww09s";
sha256 = "1fgfrgcvjg3fyza5lhl1l9cfq073xrwwhh3xs178csrjz4s8s378";
};
propagatedBuildInputs = [