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