1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 aiohttp,
7 aresponses,
8 pytest-asyncio,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pyaftership";
14 version = "23.1.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "ludeeus";
21 repo = "pyaftership";
22 tag = version;
23 hash = "sha256-njlDScmxIYWxB4EL9lOSGCXqZDzP999gI9EkpcZyFlE=";
24 };
25
26 propagatedBuildInputs = [ aiohttp ];
27
28 nativeCheckInputs = [
29 aresponses
30 pytest-asyncio
31 pytestCheckHook
32 ];
33
34 postPatch = ''
35 # Upstream is releasing with the help of a CI to PyPI, GitHub releases
36 # are not in their focus
37 substituteInPlace setup.py \
38 --replace 'version="main",' 'version="${version}",'
39 '';
40
41 pythonImportsCheck = [ "pyaftership" ];
42
43 meta = with lib; {
44 description = "Python wrapper package for the AfterShip API";
45 homepage = "https://github.com/ludeeus/pyaftership";
46 changelog = "https://github.com/ludeeus/pyaftership/releases/tag/${version}";
47 license = licenses.mit;
48 maintainers = with maintainers; [ jamiemagee ];
49 };
50}