nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, mypy
7, packaging
8, poetry-core
9, pydantic
10, pytest-asyncio
11, pytest-mock
12, pytestCheckHook
13, pythonOlder
14, yarl
15}:
16
17buildPythonPackage rec {
18 pname = "bsblan";
19 version = "0.5.5";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "liudger";
26 repo = "python-bsblan";
27 rev = "v${version}";
28 hash = "sha256-kq4cML7D9XC/QRPjGfaWcs0H78OOc2IXGua7qJpWYOQ=";
29 };
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 aiohttp
37 packaging
38 pydantic
39 yarl
40 ];
41
42 checkInputs = [
43 aresponses
44 mypy
45 pytest-asyncio
46 pytest-mock
47 pytestCheckHook
48 ];
49
50 postPatch = ''
51 # Upstream doesn't set a version for the pyproject.toml
52 substituteInPlace pyproject.toml \
53 --replace 'version = "0.0.0"' 'version = "${version}"' \
54 --replace "--cov" ""
55 '';
56
57 pythonImportsCheck = [
58 "bsblan"
59 ];
60
61 meta = with lib; {
62 description = "Python client for BSB-Lan";
63 homepage = "https://github.com/liudger/python-bsblan";
64 license = with licenses; [ mit ];
65 maintainers = with maintainers; [ fab ];
66 };
67}