1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 pytestCheckHook,
8 pytest-asyncio,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "pylaunches";
14 version = "1.4.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "ludeeus";
21 repo = pname;
22 rev = version;
23 sha256 = "sha256-bIcnYcbfAwjet3cg97y+ujFfY2916ANk4sw0sZoU59g=";
24 };
25
26 propagatedBuildInputs = [ aiohttp ];
27
28 nativeCheckInputs = [
29 aresponses
30 pytestCheckHook
31 pytest-asyncio
32 ];
33
34 postPatch = ''
35 # Upstream doesn't set version in the repo
36 substituteInPlace setup.py \
37 --replace 'version="main",' 'version="${version}",' \
38 --replace ', "pytest-runner"' ""
39 '';
40
41 pythonImportsCheck = [ "pylaunches" ];
42
43 meta = with lib; {
44 description = "Python module to get information about upcoming space launches";
45 homepage = "https://github.com/ludeeus/pylaunches";
46 license = licenses.mit;
47 maintainers = with maintainers; [ fab ];
48 };
49}