1{ lib
2, aiohttp
3, aresponses
4, attrs
5, buildPythonPackage
6, fetchFromGitHub
7, fetchpatch
8, poetry-core
9, pytest-asyncio
10, pytestCheckHook
11, pythonOlder
12, pytz
13}:
14
15buildPythonPackage rec {
16 pname = "py17track";
17 version = "2021.12.2";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "bachya";
24 repo = pname;
25 rev = version;
26 hash = "sha256-T0Jjdu6QC8rTqZwe4cdsBbs0hQXUY6CkrImCgYwWL9o=";
27 };
28
29 patches = [
30 # This patch removes references to setuptools and wheel that are no longer
31 # necessary and changes poetry to poetry-core, so that we don't need to add
32 # unnecessary nativeBuildInputs.
33 #
34 # https://github.com/bachya/py17track/pull/80
35 #
36 (fetchpatch {
37 name = "clean-up-build-dependencies.patch";
38 url = "https://github.com/bachya/py17track/commit/3b52394759aa50c62e2a56581e30cdb94003e2f1.patch";
39 hash = "sha256-iLgklhEZ61rrdzQoO6rp1HGZcqLsqGNitwIiPNLNHQ4=";
40 })
41 ];
42
43 nativeBuildInputs = [
44 poetry-core
45 ];
46
47 propagatedBuildInputs = [
48 aiohttp
49 attrs
50 pytz
51 ];
52
53 __darwinAllowLocalNetworking = true;
54
55 nativeCheckInputs = [
56 aresponses
57 pytest-asyncio
58 pytestCheckHook
59 ];
60
61 disabledTestPaths = [
62 # Ignore the examples directory as the files are prefixed with test_
63 "examples/"
64 ];
65
66 pythonImportsCheck = [
67 "py17track"
68 ];
69
70 meta = with lib; {
71 description = "Python library to track package info from 17track.com";
72 homepage = "https://github.com/bachya/py17track";
73 license = with licenses; [ mit ];
74 maintainers = with maintainers; [ fab ];
75 };
76}