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