1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, flaky
5, hatch-vcs
6, hatchling
7, httpx
8, importlib-metadata
9, pytestCheckHook
10, pythonOlder
11}:
12
13buildPythonPackage rec {
14 pname = "pylast";
15 version = "5.2.0";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "pylast";
22 repo = pname;
23 rev = "refs/tags/${version}";
24 hash = "sha256-6yxsqruosSOJ5LeIBbvuEko4s9qU/ObNZiJD5YH/hvY=";
25 };
26
27 SETUPTOOLS_SCM_PRETEND_VERSION = version;
28
29 nativeBuildInputs = [
30 hatch-vcs
31 hatchling
32 ];
33
34 propagatedBuildInputs = [
35 httpx
36 ] ++ lib.optionals (pythonOlder "3.8") [
37 importlib-metadata
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 flaky
43 ];
44
45 pythonImportsCheck = [
46 "pylast"
47 ];
48
49 meta = with lib; {
50 description = "Python interface to last.fm (and compatibles)";
51 homepage = "https://github.com/pylast/pylast";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ fab rvolosatovs ];
54 };
55}