1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytest-asyncio
5, pytestCheckHook
6, pythonOlder
7}:
8
9# This package provides a binary "apython" which sometimes invokes
10# [sys.executable, '-m', 'aioconsole'] as a subprocess. If apython is
11# run directly out of this derivation, it won't work, because
12# sys.executable will point to a Python binary that is not wrapped to
13# be able to find aioconsole.
14# However, apython will work fine when using python##.withPackages,
15# because with python##.withPackages the sys.executable is already
16# wrapped to be able to find aioconsole and any other packages.
17buildPythonPackage rec {
18 pname = "aioconsole";
19 version = "0.5.1";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "vxgmichel";
26 repo = pname;
27 rev = "refs/tags/v${version}";
28 sha256 = "sha256-PSXYXIWb2zTVC6kwMgkDovF+BVtEnqQh8NFPb96tFRY=";
29 };
30
31 checkInputs = [
32 pytest-asyncio
33 pytestCheckHook
34 ];
35
36 postPatch = ''
37 substituteInPlace setup.cfg \
38 --replace "--cov aioconsole --count 2" ""
39 '';
40
41 disabledTests = [
42 "test_interact_syntax_error"
43 # Output and the sandbox don't work well together
44 "test_interact_multiple_indented_lines"
45 ];
46
47 pythonImportsCheck = [
48 "aioconsole"
49 ];
50
51 meta = with lib; {
52 description = "Asynchronous console and interfaces for asyncio";
53 homepage = "https://github.com/vxgmichel/aioconsole";
54 license = licenses.gpl3Only;
55 maintainers = with maintainers; [ catern ];
56 };
57}