1{ lib
2, betamax
3, buildPythonPackage
4, cachetools
5, coloredlogs
6, emoji
7, fetchPypi
8, nose
9, pythonOlder
10, pytz
11, requests
12}:
13
14buildPythonPackage rec {
15 pname = "locationsharinglib";
16 version = "5.0.2";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-ydwtcIJ2trQ6xg2r5kU/ogvjdBwUZhYhBdc6nBmSGcg=";
24 };
25
26 propagatedBuildInputs = [
27 coloredlogs
28 requests
29 cachetools
30 pytz
31 ];
32
33 nativeCheckInputs = [
34 betamax
35 emoji
36 nose
37 ];
38
39 postPatch = ''
40 # Tests requirements want to pull in multiple modules which we don't need
41 substituteInPlace setup.py \
42 --replace "tests_require=test_requirements" "tests_require=[]"
43 substituteInPlace requirements.txt \
44 --replace "coloredlogs>=15.0.1" "coloredlogs" \
45 --replace "pytz>=2023.3" "pytz"
46 '';
47
48 checkPhase = ''
49 runHook preCheck
50 # Only coverage no real unit tests
51 nosetests
52 runHook postCheck
53 '';
54
55 pythonImportsCheck = [
56 "locationsharinglib"
57 ];
58
59 meta = with lib; {
60 description = "Python package to retrieve coordinates from a Google account";
61 homepage = "https://locationsharinglib.readthedocs.io/";
62 changelog = "https://github.com/costastf/locationsharinglib/blob/${version}/HISTORY.rst";
63 license = licenses.mit;
64 maintainers = with maintainers; [ fab ];
65 };
66}