diff --git a/pkgs/development/python-modules/chalice/default.nix b/pkgs/development/python-modules/chalice/default.nix index 44edde30a9ad..dfdde6b0d644 100644 --- a/pkgs/development/python-modules/chalice/default.nix +++ b/pkgs/development/python-modules/chalice/default.nix @@ -1,23 +1,24 @@ { lib -, buildPythonPackage -, fetchPypi -, pythonOlder , attrs , botocore +, buildPythonPackage , click -, enum-compat +, fetchFromGitHub , hypothesis , inquirer , jmespath , mock , mypy-extensions , pip -, pytest +, pytestCheckHook +, pythonOlder , pyyaml +, requests , setuptools , six -, typing ? null +, typing , watchdog +, websocket-client , wheel }: @@ -25,17 +26,17 @@ buildPythonPackage rec { pname = "chalice"; version = "1.24.2"; - src = fetchPypi { - inherit pname version; - sha256 = "e4faf2247291407481f7daa8cdb63120d3ea9f454332f3a74eefa33a307ef0e5"; + src = fetchFromGitHub { + owner = "aws"; + repo = pname; + rev = version; + sha256 = "0xpzc3rizdkjxclgxngswz0a22kdv1pw235gsw517ma7i06d0lw6"; }; - checkInputs = [ watchdog pytest hypothesis mock ]; propagatedBuildInputs = [ attrs botocore click - enum-compat inquirer jmespath mypy-extensions @@ -44,12 +45,18 @@ buildPythonPackage rec { setuptools six wheel - ] ++ lib.optionals (pythonOlder "3.5") [ + watchdog + ] ++ lib.optionals (pythonOlder "3.7") [ typing ]; - # conftest.py not included with pypi release - doCheck = false; + checkInputs = [ + hypothesis + mock + pytestCheckHook + requests + websocket-client + ]; postPatch = '' sed -i setup.py -e "/pip>=/c\'pip'," @@ -57,14 +64,35 @@ buildPythonPackage rec { --replace 'typing==3.6.4' 'typing' ''; - checkPhase = '' - pytest tests - ''; + disabledTestPaths = [ + # Don't check the templates and the sample app + "chalice/templates" + "docs/source/samples/todo-app/code/tests/test_db.py" + # Requires credentials + "tests/aws/test_features.py" + # Requires network access + "tests/aws/test_websockets.py" + "tests/integration/test_package.py" + ]; + + disabledTests = [ + # Requires network access + "test_update_domain_name_failed" + "test_can_reload_server" + # Content for the tests is missing + "test_can_import_env_vars" + "test_stack_trace_printed_on_error" + # Don't build + "test_can_generate_pipeline_for_all" + "test_build_wheel" + ]; + + pythonImportsCheck = [ "chalice" ]; meta = with lib; { description = "Python Serverless Microframework for AWS"; homepage = "https://github.com/aws/chalice"; license = licenses.asl20; - maintainers = [ maintainers.costrouc ]; + maintainers = with maintainers; [ costrouc ]; }; }