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