1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 geojson,
6 pysocks,
7 pythonOlder,
8 requests,
9 setuptools,
10 pytestCheckHook,
11 pythonRelaxDepsHook,
12}:
13
14buildPythonPackage rec {
15 pname = "pyowm";
16 version = "3.3.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "csparpa";
23 repo = "pyowm";
24 rev = "refs/tags/${version}";
25 hash = "sha256-cSOhm3aDksLBChZzgw1gjUjLQkElR2/xGFMOb9K9RME=";
26 };
27
28 pythonRelaxDeps = [ "geojson" ];
29
30 build-system = [ setuptools ];
31
32 nativeBuildInputs = [ pythonRelaxDepsHook ];
33
34 dependencies = [
35 geojson
36 pysocks
37 requests
38 setuptools
39 ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 # Run only tests which don't require network access
44 pytestFlagsArray = [ "tests/unit" ];
45
46 pythonImportsCheck = [ "pyowm" ];
47
48 meta = with lib; {
49 description = "Python wrapper around the OpenWeatherMap web API";
50 homepage = "https://pyowm.readthedocs.io/";
51 changelog = "https://github.com/csparpa/pyowm/releases/tag/${version}";
52 license = licenses.mit;
53 maintainers = with maintainers; [ fab ];
54 };
55}